Feellgood
Public Member Functions | Public Attributes | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
element< N, NPI > Class Template Referenceabstract

Template abstract class, mother class for tetraedrons and triangles. More...

#include <element.h>

Inheritance diagram for element< N, NPI >:
Tetra::Tet Triangle::Tri

Public Member Functions

 element (const std::vector< Nodes::Node > &_p_node, const int _idx, const std::initializer_list< int > &_i)
 
constexpr int getN (void) const
 
constexpr int getNPI (void) const
 
void buildMatP (Eigen::Ref< Eigen::Matrix< double, 2 *N, 3 *N >> P)
 
virtual void getPtGauss (Eigen::Ref< Eigen::Matrix< double, Nodes::DIM, NPI >> result) const =0
 
void infos (void) const
 
virtual Eigen::Matrix< double, NPI, 1 > charges (const double &Ms_or_dMs, const std::function< Eigen::Vector3d(const Nodes::Node &)> &getter) const =0
 
bool existNodes (void) const
 

Public Attributes

std::vector< int > ind
 
int idxPrm
 
Eigen::Matrix< double, NPI, 1 > weight
 
Eigen::Matrix< double, 2 *N, 2 *N > Kp
 
Eigen::Matrix< double, 2 *N, 1 > Lp
 

Protected Member Functions

const Nodes::NodegetNode (const int i) const
 
void zeroBasing (void)
 

Private Member Functions

virtual void orientate ()=0
 

Private Attributes

const std::vector< Nodes::Node > & refNode
 

Detailed Description

template<int N, int NPI>
class element< N, NPI >

Template abstract class, mother class for tetraedrons and triangles.

template parameters are N number of sommits and NPI number of interpolation points. It contains a list of indices to the N nodes of the element, a reference to the full nodes vector, and index refering to the associated material parameters. All indices are zero based, derived class constructor should call zerobasing() if needed. It contains also the vector and matrix weight, Kp, Lp, P related to finite element computations. weight values are not initialized, they have to be set by derived class constructor. Member function getPtGauss() returns Gauss points. orientate() is a pure virtual function, it should manipulate indices to orientate positively the element.

Constructor & Destructor Documentation

◆ element()

template<int N, int NPI>
element< N, NPI >::element ( const std::vector< Nodes::Node > &  _p_node,
const int  _idx,
const std::initializer_list< int > &  _i 
)
inlineexplicit

constructor

Parameters
_p_nodevector of nodes
_idxindex to params
_iindices to the nodes

Member Function Documentation

◆ buildMatP()

template<int N, int NPI>
void element< N, NPI >::buildMatP ( Eigen::Ref< Eigen::Matrix< double, 2 *N, 3 *N >>  P)
inline

build matrix P direcly from ep,eq in nodes P is block diagonal: ( Epx Epy Epz ) ( Eqz Eqy Eqz ) with each block E(p|q)(x|y|z) a N*N diagonal matrix see here http://eigen.tuxfamily.org/dox-devel/TopicTemplateKeyword.html for the wierd template syntax

Parameters
[out]Pblock diagonal matrix

◆ charges()

template<int N, int NPI>
virtual Eigen::Matrix<double,NPI,1> element< N, NPI >::charges ( const double &  Ms_or_dMs,
const std::function< Eigen::Vector3d(const Nodes::Node &)> &  getter 
) const
pure virtual

Compute the magnetic charges on the element. The first parameter is Ms on a volume element, and dMs on a surface element.

Implemented in Tetra::Tet, and Triangle::Tri.

◆ existNodes()

template<int N, int NPI>
bool element< N, NPI >::existNodes ( void  ) const
inline

returns true if all mesh node indices in ind are referring to existing nodes in refNode. It does not test if two indices are equal, so this function does not detect degenerated element

◆ getN()

template<int N, int NPI>
constexpr int element< N, NPI >::getN ( void  ) const
inlineconstexpr

getter for N

◆ getNode()

template<int N, int NPI>
const Nodes::Node& element< N, NPI >::getNode ( const int  i) const
inlineprotected

returns reference to node at ind[i] from mesh node vector

◆ getNPI()

template<int N, int NPI>
constexpr int element< N, NPI >::getNPI ( void  ) const
inlineconstexpr

getter for NPI

◆ getPtGauss()

template<int N, int NPI>
virtual void element< N, NPI >::getPtGauss ( Eigen::Ref< Eigen::Matrix< double, Nodes::DIM, NPI >>  result) const
pure virtual

computes Gauss point of the element, return in result

Implemented in Triangle::Tri, and Tetra::Tet.

◆ infos()

template<int N, int NPI>
void element< N, NPI >::infos ( void  ) const
inline

print the vector index of the associated region and the node indices of the element

◆ orientate()

template<int N, int NPI>
virtual void element< N, NPI >::orientate ( )
privatepure virtual

a method to orientate the element. It should also call exit if element is degenerated

Implemented in Triangle::Tri, and Tetra::Tet.

◆ zeroBasing()

template<int N, int NPI>
void element< N, NPI >::zeroBasing ( void  )
inlineprotected

zeroBasing: index convention Matlab/msh (one based) -> C++ (zero based)

Member Data Documentation

◆ idxPrm

template<int N, int NPI>
int element< N, NPI >::idxPrm

index of the material region of the element

◆ ind

template<int N, int NPI>
std::vector<int> element< N, NPI >::ind

indices to the nodes

◆ Kp

template<int N, int NPI>
Eigen::Matrix<double,2*N,2*N> element< N, NPI >::Kp

matrix for integrales

◆ Lp

template<int N, int NPI>
Eigen::Matrix<double,2*N,1> element< N, NPI >::Lp

vector for integrales

◆ refNode

template<int N, int NPI>
const std::vector<Nodes::Node>& element< N, NPI >::refNode
private

vector of nodes

◆ weight

template<int N, int NPI>
Eigen::Matrix<double,NPI,1> element< N, NPI >::weight

weights hat function of the element


The documentation for this class was generated from the following file: