#include <Bubble.h>
Inheritance diagram for Bubble:
Public Member Functions | |
Bubble () | |
virtual | ~Bubble () |
virtual void | compute_basis_functions () |
Definition at line 6 of file Bubble.h.
|
Definition at line 8 of file Bubble.h.
|
|
Definition at line 9 of file Bubble.h.
|
|
Reimplemented from StandardFE. Definition at line 3 of file Bubble.cpp. References barycenter_tetrahedron(), barycenter_triangle(), StandardFE::dofs, StandardFE::N(), Polygon::no_vertices(), StandardFE::Ns, StandardFE::p, Polygon::str(), Polygon::vertex(), and x. 00003 { 00004 00005 if ( p == NULL ) { 00006 cout <<"You need to set a polygon before the basisfunctions can be computed"<<endl; 00007 return; 00008 } 00009 00010 00011 if (p->str() == "ReferenceLine") { 00012 Ns.insert(Ns.end(), x*(1-x)); 00013 } else if (p->str() == "ReferenceTriangle" || p->str() == "Triangle" ) { 00014 00015 GiNaC::ex b = barycenter_triangle(p->vertex(0), p->vertex(1), p->vertex(2)); 00016 GiNaC::ex N = GiNaC::numeric(1); 00017 for (int d=0; d< b.nops(); d++) { 00018 N = N*b.op(d).rhs(); 00019 } 00020 cout <<"N "<<N<<endl; 00021 Ns.insert(Ns.end(), N); 00022 00023 } else if (p->str() == "ReferenceTetrahedron" || p->str() == "Tetrahedron" ) { 00024 GiNaC::ex b = barycenter_tetrahedron(p->vertex(0), p->vertex(1), 00025 p->vertex(2), p->vertex(3)); 00026 GiNaC::ex N = GiNaC::numeric(1); 00027 for (int d=0; d< b.nops(); d++) { 00028 N = N*b.op(d).rhs(); 00029 } 00030 cout <<"N "<<N<<endl; 00031 Ns.insert(Ns.end(), N); 00032 } 00033 00034 00035 // create and insert dof 00036 GiNaC::lst midpoint = GiNaC::lst(); 00037 for (int d=0; d< p->vertex(1).nops(); d++) { 00038 midpoint.append(GiNaC::numeric(0)); 00039 } 00040 for (int i=1; i<= p->no_vertices(); i++) { 00041 for (int d=0; d< p->vertex(i-1).nops(); d++) { 00042 midpoint.let_op(d) += p->vertex(i-1).op(d); 00043 } 00044 } 00045 00046 for (int d=0; d< p->vertex(1).nops(); d++) { 00047 midpoint.let_op(d) = midpoint.op(d)/p->no_vertices(); 00048 } 00049 00050 dofs.insert(dofs.end(), midpoint); 00051 }
|