SyFi
0.3
|
#include <Lagrange.h>
Public Member Functions | |
TensorLagrange () | |
TensorLagrange (Polygon &p, unsigned int order=1, unsigned int size=0) | |
~TensorLagrange () | |
virtual void | set_size (unsigned int size_) |
virtual void | compute_basis_functions () |
Protected Attributes | |
unsigned int | size |
Definition at line 49 of file Lagrange.h.
Definition at line 460 of file Lagrange.cpp.
References SyFi::StandardFE::description.
: StandardFE() { description = "TensorLagrange"; }
SyFi::TensorLagrange::TensorLagrange | ( | Polygon & | p, |
unsigned int | order = 1 , |
||
unsigned int | size = 0 |
||
) |
Definition at line 465 of file Lagrange.cpp.
References compute_basis_functions(), SyFi::nsd, and size.
: StandardFE(p, order) { size = size_ < 0 ? nsd: size_; compute_basis_functions(); }
SyFi::TensorLagrange::~TensorLagrange | ( | ) | [inline] |
Definition at line 56 of file Lagrange.h.
{}
void SyFi::TensorLagrange::compute_basis_functions | ( | ) | [virtual] |
Reimplemented from SyFi::StandardFE.
Definition at line 471 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 TensorLagrange().
{ // 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*size ; s++) { zero_list.append(0); } for (unsigned int r=0; r< size ; r++) { 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((size)*r + s) = fe.N(i); GiNaC::ex Nmat = GiNaC::matrix(size,size,Nis); Ns.insert(Ns.end(), Nmat); GiNaC::lst dof = GiNaC::lst(fe.dof(i), r, s) ; dofs.insert(dofs.end(), dof); } } } description = "Tensor" + fe.str(); }
void SyFi::TensorLagrange::set_size | ( | unsigned int | size_ | ) | [virtual] |
unsigned int SyFi::TensorLagrange::size [protected] |
Definition at line 52 of file Lagrange.h.
Referenced by compute_basis_functions(), set_size(), and TensorLagrange().