#include <CrouzeixRaviart.h>
Inheritance diagram for CrouzeixRaviart:
Public Member Functions | |
CrouzeixRaviart () | |
~CrouzeixRaviart () | |
void | set (int order) |
void | set (Polygon &p) |
void | compute_basis_functions () |
virtual int | nbf () |
virtual GiNaC::ex | N (int i) |
virtual GiNaC::ex | dof (int i) |
Definition at line 8 of file CrouzeixRaviart.h.
|
Definition at line 4 of file CrouzeixRaviart.cpp. References StandardFE::order. 00004 : StandardFE() { 00005 order = 1; 00006 }
|
|
Definition at line 11 of file CrouzeixRaviart.h.
|
|
Reimplemented from StandardFE. Definition at line 13 of file CrouzeixRaviart.cpp. References bernstein(), dirac(), StandardFE::dofs, Triangle::integrate(), Line::integrate(), Triangle::line(), StandardFE::Ns, StandardFE::p, Polygon::str(), and Tetrahedron::triangle(). Referenced by check_CrouzeixRaviart(), and VectorCrouzeixRaviart::compute_basis_functions(). 00013 { 00014 00015 // see e.g. Brezzi and Fortin book page 116 for the definition 00016 00017 if (p->str() == "ReferenceLine") { 00018 cout <<"Can not define the Raviart-Thomas element on a line"<<endl; 00019 } else if (p->str() == "ReferenceTriangle" || p->str() == "Triangle" ) { 00020 Triangle& triangle = (Triangle&)(*p); 00021 00022 // create the polynomial space 00023 GiNaC::ex polynom_space = bernstein(1, triangle, "a"); 00024 GiNaC::ex polynom = polynom_space.op(0); 00025 GiNaC::ex variables = polynom_space.op(1); 00026 GiNaC::ex basis = polynom_space.op(2); 00027 00028 // create the dofs 00029 int counter = 0; 00030 GiNaC::symbol t("t"); 00031 for (int i=1; i<= 3; i++) { 00032 Line line = triangle.line(i); 00033 GiNaC::ex dofi = line.integrate(polynom); 00034 dofs.insert(dofs.end(),dofi); 00035 } 00036 00037 // solve the linear system to compute 00038 // each of the basis functions 00039 for (int i=1; i<= 3; i++) { 00040 GiNaC::lst equations; 00041 for (int j=1; j<= 3; j++) { 00042 equations.append(dofs[j-1] == dirac(i,j)); 00043 } 00044 GiNaC::ex sub = lsolve(equations, variables); 00045 GiNaC::ex Ni = polynom.subs(sub); 00046 Ns.insert(Ns.end(),Ni); 00047 } 00048 00049 } else if ( p->str() == "ReferenceTetrahedron" || p->str() == "Tetrahedron" ) { 00050 Tetrahedron& tetrahedron = (Tetrahedron&)(*p); 00051 GiNaC::ex polynom_space = bernstein(1, tetrahedron, "a"); 00052 GiNaC::ex polynom = polynom_space.op(0); 00053 GiNaC::ex variables = polynom_space.op(1); 00054 GiNaC::ex basis = polynom_space.op(2); 00055 00056 00057 GiNaC::ex bernstein_pol; 00058 00059 int counter = 0; 00060 GiNaC::symbol t("t"); 00061 // dofs related to edges 00062 for (int i=1; i<= 4; i++) { 00063 Triangle triangle = tetrahedron.triangle(i); 00064 GiNaC::ex dofi = triangle.integrate(polynom); 00065 dofs.insert(dofs.end(),dofi); 00066 } 00067 for (int i=1; i<= 4; i++) { 00068 GiNaC::lst equations; 00069 for (int j=1; j<= 4; j++) { 00070 equations.append(dofs[j-1] == dirac(i,j)); 00071 } 00072 GiNaC::ex sub = lsolve(equations, variables); 00073 GiNaC::ex Ni = polynom.subs(sub); 00074 Ns.insert(Ns.end(),Ni); 00075 } 00076 00077 00078 00079 } 00080 }
|
|
Reimplemented from StandardFE. Definition at line 95 of file CrouzeixRaviart.cpp. References StandardFE::dof(). Referenced by VectorCrouzeixRaviart::compute_basis_functions(). 00095 { 00096 return StandardFE::dof(i); 00097 }
|
|
Reimplemented from StandardFE. Definition at line 100 of file CrouzeixRaviart.cpp. References StandardFE::N(). Referenced by VectorCrouzeixRaviart::compute_basis_functions(). 00100 { 00101 return StandardFE::N(i); 00102 }
|
|
Reimplemented from StandardFE. Definition at line 9 of file CrouzeixRaviart.cpp. References StandardFE::Ns. Referenced by VectorCrouzeixRaviart::compute_basis_functions(). 00009 { 00010 return Ns.size(); 00011 }
|
|
Reimplemented from StandardFE. Definition at line 83 of file CrouzeixRaviart.cpp. References StandardFE::set(). 00083 { 00084 StandardFE:: set(p_); 00085 }
|
|
Reimplemented from StandardFE. Definition at line 88 of file CrouzeixRaviart.cpp. Referenced by check_CrouzeixRaviart(), and VectorCrouzeixRaviart::compute_basis_functions(). 00088 { 00089 if (order_ != 1) { 00090 cout <<"Only Crouziex-Raviart elements of order 1 is possible"<<endl; 00091 } 00092 }
|