SyFi
0.3
|
#include <Lagrange.h>
Public Member Functions | |
VectorLagrange () | |
VectorLagrange (Polygon &p, unsigned int order=1, unsigned int size=0) | |
~VectorLagrange () | |
virtual void | set_size (unsigned int size_) |
virtual void | compute_basis_functions () |
Protected Attributes | |
unsigned int | size |
Definition at line 36 of file Lagrange.h.
Definition at line 393 of file Lagrange.cpp.
References SyFi::StandardFE::description.
: StandardFE() { description = "VectorLagrange"; }
SyFi::VectorLagrange::VectorLagrange | ( | Polygon & | p, |
unsigned int | order = 1 , |
||
unsigned int | size = 0 |
||
) |
Definition at line 398 of file Lagrange.cpp.
References compute_basis_functions(), SyFi::nsd, and size.
: StandardFE(p, order) { size = size_ < 0 ? nsd: size_; compute_basis_functions(); }
SyFi::VectorLagrange::~VectorLagrange | ( | ) | [inline] |
Definition at line 43 of file Lagrange.h.
{}
void SyFi::VectorLagrange::compute_basis_functions | ( | ) | [virtual] |
Reimplemented from SyFi::StandardFE.
Reimplemented in SyFi::VectorDiscontinuousLagrange.
Definition at line 404 of file Lagrange.cpp.
References SyFi::Lagrange::compute_basis_functions(), SyFi::StandardFE::description, SyFi::StandardFE::dof(), SyFi::StandardFE::dofs, SyFi::StandardFE::N(), SyFi::StandardFE::nbf(), SyFi::StandardFE::Ns, SyFi::StandardFE::order, SyFi::StandardFE::p, SyFi::StandardFE::set_order(), SyFi::StandardFE::set_polygon(), size, and SyFi::StandardFE::str().
Referenced by main(), and VectorLagrange().
{ // remove previously computed basis functions and dofs Ns.clear(); dofs.clear(); if ( order < 1 ) { throw(std::logic_error("Lagrangian elements must be of order 1 or higher.")); } if ( p == NULL ) { throw(std::logic_error("You need to set a polygon before the basisfunctions can be computed")); } if ( size == 0) { throw(std::logic_error("You need to set the size of the vector before the basisfunctions can be computed")); } Lagrange fe; fe.set_order(order); fe.set_polygon(*p); fe.compute_basis_functions(); GiNaC::lst zero_list; for (unsigned int s=1; s<= size ; s++) { zero_list.append(0); } for (unsigned int s=0; s< size ; s++) { for (unsigned int i=0; i< fe.nbf() ; i++) { GiNaC::lst Nis = zero_list; Nis.let_op(s) = fe.N(i); GiNaC::ex Nmat = GiNaC::matrix(size,1,Nis); Ns.insert(Ns.end(), Nmat); GiNaC::lst dof = GiNaC::lst(fe.dof(i), s) ; dofs.insert(dofs.end(), dof); } } description = "Vector" + fe.str(); }
void SyFi::VectorLagrange::set_size | ( | unsigned int | size_ | ) | [virtual] |
Reimplemented in SyFi::VectorDiscontinuousLagrange.
Definition at line 453 of file Lagrange.cpp.
References size.
Referenced by main().
{ size = size_; }
unsigned int SyFi::VectorLagrange::size [protected] |
Definition at line 39 of file Lagrange.h.
Referenced by compute_basis_functions(), set_size(), and VectorLagrange().