SyFi
0.3
|
#include <SpaceTimeElement.h>
Public Member Functions | |
SpaceTimeElement () | |
SpaceTimeElement (Line *time_line_, unsigned int order_, StandardFE *fe_) | |
virtual | ~SpaceTimeElement () |
void | set_time_domain (Line *line) |
void | set_order_in_time (unsigned int order) |
void | set_spatial_element (StandardFE *fe) |
virtual void | compute_basis_functions () |
Private Attributes | |
int | order |
Line * | time_line |
StandardFE * | fe |
Definition at line 49 of file SpaceTimeElement.h.
Definition at line 92 of file SpaceTimeElement.cpp.
References SyFi::StandardFE::description.
: StandardFE() { description = "SpaceTimeElement"; }
SyFi::SpaceTimeElement::SpaceTimeElement | ( | Line * | time_line_, |
unsigned int | order_, | ||
StandardFE * | fe_ | ||
) |
Definition at line 97 of file SpaceTimeElement.cpp.
References compute_basis_functions(), fe, order, and time_line.
{ time_line = time_line_; order = order_; fe = fe_; compute_basis_functions(); }
virtual SyFi::SpaceTimeElement::~SpaceTimeElement | ( | ) | [inline, virtual] |
Definition at line 58 of file SpaceTimeElement.h.
{}
void SyFi::SpaceTimeElement::compute_basis_functions | ( | ) | [virtual] |
Reimplemented from SyFi::StandardFE.
Definition at line 120 of file SpaceTimeElement.cpp.
References SyFi::StandardFE::description, SyFi::StandardFE::dof(), SyFi::StandardFE::dofs, fe, SyFi::StandardFE::N(), SyFi::StandardFE::nbf(), SyFi::StandardFE::Ns, order, SyFi::StandardFE::str(), SyFi::t, time_line, and SyFi::x.
Referenced by SpaceTimeElement().
{ // remove previously computed basis functions and dofs Ns.clear(); dofs.clear(); if ( order < 1 ) { throw(std::logic_error("The elements must be of order 1 or higher.")); } if ( time_line == NULL ) { throw(std::logic_error("You need to set a time domain before the basisfunctions can be computed")); } if ( fe == NULL ) { throw(std::logic_error("You need to set a spatial element before the basisfunctions can be computed")); } StandardFE* time_element; if ( order == 0) { time_element = new P0(*time_line); } else { time_element = new Lagrange(*time_line, order); } for (unsigned int j = 0; j < fe->nbf(); j++) { GiNaC::ex Nj = fe->N(j); for (unsigned int i = 0; i < (*time_element).nbf(); i++) { GiNaC::ex Ni = (*time_element).N(i); Ni = Ni.subs(x == t); GiNaC::ex N = Nj*Ni; Ns.insert(Ns.end(), N); dofs.insert(dofs.end(), GiNaC::lst((*time_element).dof(i), fe->dof(j))); } } description = time_element->str() + "_" + fe->str(); delete time_element; }
void SyFi::SpaceTimeElement::set_order_in_time | ( | unsigned int | order | ) |
void SyFi::SpaceTimeElement::set_spatial_element | ( | StandardFE * | fe | ) |
void SyFi::SpaceTimeElement::set_time_domain | ( | Line * | line | ) |
StandardFE* SyFi::SpaceTimeElement::fe [private] |
Definition at line 53 of file SpaceTimeElement.h.
Referenced by compute_basis_functions(), set_spatial_element(), and SpaceTimeElement().
int SyFi::SpaceTimeElement::order [private] |
Reimplemented from SyFi::StandardFE.
Definition at line 51 of file SpaceTimeElement.h.
Referenced by compute_basis_functions(), set_order_in_time(), and SpaceTimeElement().
Line* SyFi::SpaceTimeElement::time_line [private] |
Definition at line 52 of file SpaceTimeElement.h.
Referenced by compute_basis_functions(), set_time_domain(), and SpaceTimeElement().