CEPS  24.01
Cardiac ElectroPhysiology Simulator
LagrangeBasisFunctions.cpp File Reference

Go to the source code of this file.

Functions

void buildSimplexUniformPoints (CepsUInt dim, CepsUInt numberOfPoints, CepsVector< CepsReal3D > &points, CepsVector< CepsInt > &geomCellIndex)
 Constructs the list of uniform points of the simplex of given dimension. More...
 
CepsVector< CepsArray3< CepsInt > > buildBasisFunctionExponents (CepsUInt dim, CepsUInt numberOfPoints)
 Constructs the list of ordered exponents for a given number of points, typically constructed x^i y^j z^k with i,j,k < numberOfPoints. Beware the list must be resized when used. More...
 
void buildPolysBasisFunction (CepsUInt dim, CepsUInt order, CepsVector< CepsReal3D > &points, CepsVector< CepsInt > &geomCellIndex, CepsVector< Polynomial< 3U >> &polys, void(*pointBuilder)(CepsUInt, CepsUInt, CepsVector< CepsReal3D > &, CepsVector< CepsInt > &))
 Constructs the list of base functions in the form of Polynomials. More...
 

Detailed Description

Functions that build basis functions of Lagrange FEs

Definition in file LagrangeBasisFunctions.cpp.

Function Documentation

◆ buildBasisFunctionExponents()

CepsVector<CepsArray3<CepsInt> > buildBasisFunctionExponents ( CepsUInt  dim,
CepsUInt  numberOfPoints 
)

Constructs the list of ordered exponents for a given number of points, typically constructed x^i y^j z^k with i,j,k < numberOfPoints. Beware the list must be resized when used.

Parameters
[in]dimthe simplex dimension
[in]numberOfPointsnumber of points in first dimension
Returns
CepsVector<CepsArray3<CepsInt>> the list of exponents

Definition at line 99 of file LagrangeBasisFunctions.cpp.

◆ buildPolysBasisFunction()

void buildPolysBasisFunction ( CepsUInt  dim,
CepsUInt  order,
CepsVector< CepsReal3D > &  points,
CepsVector< CepsInt > &  geomCellIndex,
CepsVector< Polynomial< 3U >> &  polys,
void(*)(CepsUInt, CepsUInt, CepsVector< CepsReal3D > &, CepsVector< CepsInt > &)  pointsBuilder 
)

Constructs the list of base functions in the form of Polynomials.

See also
Polynomial
Parameters
[in]dimthe simplex dimension
[in]orderthe order wanted
[out]pointsthe list of points used to buid basis function (with phi_i(x_j) = delta_ij)
[in]geomCellIndexgeom indices of cell points
[out]polysthe list of Polynomial
[in]pointsBuilderfunction which creates the list of points

Definition at line 144 of file LagrangeBasisFunctions.cpp.

◆ buildSimplexUniformPoints()

void buildSimplexUniformPoints ( CepsUInt  dim,
CepsUInt  numberOfPoints,
CepsVector< CepsReal3D > &  points,
CepsVector< CepsInt > &  geomCellIndex 
)

Constructs the list of uniform points of the simplex of given dimension.

1D: cable (0)-(1) 2D: triangle (0,0)-(1,0)-(0,1) 3D: tetra (0,0,0)-(1,0,0)-(0,1,0)-(0,0,1)

The following conventions are followed for node numbering of P2 elements:

1D:

\begin{tikzpicture} \begin{scope}[x=2cm] \node (x0) at (0,0) {0}; \node (x2) at (1,0) {2}; \node (x1) at (0.5,0) {1}; \draw (x0) -- (x2); \draw (x1) -- (x2); \end{scope} \end{tikzpicture}

2D:

\begin{tikzpicture} \begin{scope}[x=2cm,y=2cm] \node (x0) at (0,0) {0}; \node (x1) at (1,0) {5}; \node (x2) at (0,1) {2}; \node (x3) at (0.5,0.5) {4}; \node (x4) at (0,0.5) {1}; \node (x5) at (0.5,0) {3}; \draw (x0) -- (x5) -- (x1) -- (x3) -- (x2) -- (x4) -- (x0); \end{scope} \end{tikzpicture}

3D:

\begin{tikzpicture} \begin{scope}[x=2cm,y=2cm,z=-1.2cm] \node (x0) at (0,0,0) {0}; \node (x1) at (1,0,0) {9}; \node (x2) at (0,1,0) {5}; \node (x3) at (0,0,1) {2}; \node (x4) at (0,0.5,0.5) {4}; \node (x5) at (0.5,0,0.5) {7}; \node (x6) at (0.5,0.5,0) {8}; \node (x7) at (0.5,0,0) {6}; \node (x8) at (0,0.5,0) {3}; \node (x9) at (0,0,0.5) {1}; \draw (x0) -- (x7) -- (x1) -- (x6) -- (x2) -- (x8) -- (x0); \draw (x0) -- (x9) -- (x3) -- (x4) -- (x2); \draw (x1) -- (x5) -- (x3); \end{scope} \end{tikzpicture}

Parameters
[in]dimthe simplex dimension
[in]numberOfPointsnumber of points in the first dimension
[out]pointsthe list of points
[out]geomCellIndextells if i-th node matches a geometrical node

Definition at line 63 of file LagrangeBasisFunctions.cpp.