#include <P0.h>
Inheritance diagram for P0:
Public Member Functions | |
P0 () | |
virtual | ~P0 () |
virtual void | compute_basis_functions () |
Definition at line 6 of file P0.h.
|
Definition at line 8 of file P0.h.
|
|
Definition at line 9 of file P0.h.
|
|
Reimplemented from StandardFE. Definition at line 3 of file P0.cpp. References StandardFE::dofs, Polygon::no_vertices(), StandardFE::Ns, StandardFE::p, and Polygon::vertex(). Referenced by main(). 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 // insert basis function 00011 Ns.insert(Ns.end(), GiNaC::numeric(1)); 00012 00013 // create and insert dof 00014 GiNaC::lst midpoint = GiNaC::lst(); 00015 for (int d=0; d< p->vertex(1).nops(); d++) { 00016 midpoint.append(GiNaC::numeric(0)); 00017 } 00018 for (int i=1; i<= p->no_vertices(); i++) { 00019 for (int d=0; d< p->vertex(i-1).nops(); d++) { 00020 midpoint.let_op(d) += p->vertex(i-1).op(d); 00021 } 00022 } 00023 00024 for (int d=0; d< p->vertex(1).nops(); d++) { 00025 midpoint.let_op(d) = midpoint.op(d)/p->no_vertices(); 00026 } 00027 00028 dofs.insert(dofs.end(), midpoint); 00029 }
|