CEPS
24.01
Cardiac ElectroPhysiology Simulator
|
math typedef for matrix coefficients of a single element More...
Functions | |
CepsReal | polRef (CepsReal r) |
Pole function used in stimulation function definition. More... | |
CepsReal | d4Polynomial (CepsReal x) |
A polynomial satisfying 0-derivative equalities. More... | |
CepsReal | d5Polynomial (CepsReal r) |
Another polynomial satisfying more 0-derivative equalities. More... | |
CepsReal | cInfinityStim (CepsReal t, CepsReal duration, CepsReal *point, const CepsVector< CepsReal > &orig, CepsReal diam, CepsReal amp) |
Regular stimulation function. More... | |
CepsReal | constStim (CepsReal t, CepsReal duration, CepsReal *point, const CepsVector< CepsReal > &orig, CepsReal diam, CepsReal amp) |
Constant stimulation in a region (step function in time) More... | |
CepsReal | c4Stim (CepsReal t, CepsReal duration, CepsReal *point, const CepsVector< CepsReal > &orig, CepsReal diam, CepsReal amp) |
Regular stimulation function. More... | |
CepsReal | c5Stim (CepsReal t, CepsReal duration, CepsReal *point, const CepsVector< CepsReal > &orig, CepsReal diam, CepsReal amp) |
Regular stimulation function. More... | |
CepsReal | lagrangianPol4Pts (CepsReal x, CepsReal f0, CepsReal f1, CepsReal f2, CepsReal f3) |
Lagrange interpolation of degree 3. More... | |
CepsReal | derivativeLagrangianPol4Pts (CepsReal x, CepsReal f0, CepsReal f1, CepsReal f2, CepsReal f3) |
Derivative of Lagrange interpolating polynomial of degree 3. More... | |
CepsReal | newtonSolvePol4Pts (CepsReal f0, CepsReal f1, CepsReal f2, CepsReal f3, CepsReal c, CepsReal t0) |
Solves for , based on a 4 points interpolation of , using Newton method. More... | |
constexpr CepsUInt | factorial (CepsUInt n) |
Compile-time factorial. More... | |
void | computeInverse (const CepsMathDynamic2D &m, CepsMathDynamic2D &inv) |
Inverse of square matrices. More... | |
void | computeInverse (const Eigen::Matrix< CepsReal, 3, 2 > &m, Eigen::Matrix< CepsReal, 2, 3 > &inv) |
Left inverse for 3x2 matrices. More... | |
void | computeInverse (const Eigen::Matrix< CepsReal, 3, 1 > &m, Eigen::Matrix< CepsReal, 1, 3 > &inv) |
Left inverse 3x1 matrices. More... | |
void | computeInverse (const Eigen::Matrix< CepsReal, 2, 1 > &m, Eigen::Matrix< CepsReal, 1, 2 > &inv) |
Left inverse for 2x1 matrices. More... | |
CepsMathDynamic2D | compose (CepsUInt M, CepsVector< CepsMathDynamic2D * > blocks) |
Bloc matrices interleaving. More... | |
CepsMathDynamic1D | compose (CepsUInt M, CepsVector< CepsMathDynamic1D * > blocks) |
Interleaving of M vectors. More... | |
void | putRowsSumInDiagonal (CepsMathDynamic2D &mat) |
Mass lumping. More... | |
CepsMathDynamic2D | multiplyByBlocks (const CepsMathDynamic2D &A, const CepsMathDynamic2D &B, const CepsArray2< CepsUInt > a, const CepsArray2< CepsUInt > b) |
Compute a matrix product by blocks [[C_11, C_12], [C_21, C_22]] = [[A_11 * B_11, A_12 * B_12], [A_21 * B_21, A_22 * B_22]] = [[A_11, A_12], [A_21, A_22]] * [[B_11, B_12], [B_21, B_22]]. More... | |
CepsReal | interpolateLagrange (CepsReal x, const CepsVector< CepsReal > &f) |
Computes the interpolate of f at point x. assumes f is given at equidistant points on [0,1] Hard coded until 4 points are given. More... | |
CepsReal | interpolateLagrange (CepsReal x, const CepsVector< CepsReal > &f, CepsReal xmin, CepsReal xmax) |
Computes the interpolate of f at point x. assumes f is given at equidistant points on [xmin,xmax]. More... | |
CepsReal | interpolateLagrange (CepsReal x, const CepsVector< CepsReal > &f, const CepsVector< CepsReal > &xs) |
Computes the interpolate of f at point x. f given on points xs. More... | |
math typedef for matrix coefficients of a single element
math typedef for vector coefficients of a single element math typedef for vector coefficients of a single element (source term side) using CoeffVector = Eigen::Array<CepsReal, Eigen::Dynamic, 1>; math typedef for 3D point math typedef for data on dofs math typedef for vectory data on dofs using DofVertices = Eigen::Matrix<CepsReal, 3, Eigen::Dynamic>; math typedef for values of unknowns on dofs using UnknownVector = CepsMathDynamic1D;
CepsReal ceps::math::c4Stim | ( | CepsReal | t, |
CepsReal | duration, | ||
CepsReal * | point, | ||
const CepsVector< CepsReal > & | orig, | ||
CepsReal | diam, | ||
CepsReal | amp | ||
) |
Regular stimulation function.
Function is restricted to the compact support . It is a function such that .
[in] | t | time from stimulation start |
[in] | duration | stimulation duration |
[in] | point | spatial position |
[in] | orig | origin point |
[in] | diam | diameter |
[in] | amp | intensity |
Definition at line 83 of file CepsContinuousFunctions.cpp.
CepsReal ceps::math::c5Stim | ( | CepsReal | t, |
CepsReal | duration, | ||
CepsReal * | point, | ||
const CepsVector< CepsReal > & | orig, | ||
CepsReal | diam, | ||
CepsReal | amp | ||
) |
Regular stimulation function.
Function is restricted to the compact support . It is a function such that .
[in] | t | time from stimulation start |
[in] | duration | stimulation duration |
[in] | point | spatial position |
[in] | orig | origin point |
[in] | diam | diameter |
[in] | amp | intensity |
Definition at line 96 of file CepsContinuousFunctions.cpp.
CepsReal ceps::math::cInfinityStim | ( | CepsReal | t, |
CepsReal | duration, | ||
CepsReal * | point, | ||
const CepsVector< CepsReal > & | orig, | ||
CepsReal | diam, | ||
CepsReal | amp | ||
) |
Regular stimulation function.
Function is restricted to the compact support .
[in] | t | time from stimulation start |
[in] | duration | stimulation duration |
[in] | point | spatial position |
[in] | orig | origin point |
[in] | diam | diameter |
[in] | amp | intensity |
Definition at line 65 of file CepsContinuousFunctions.cpp.
CepsMathDynamic1D ceps::math::compose | ( | CepsUInt | M, |
CepsVector< CepsMathDynamic1D * > | blocks | ||
) |
Interleaving of M vectors.
[in] | M | number of vectors |
[in] | blocks | pointers on blocks of size N |
Definition at line 130 of file EigenTools.cpp.
CepsMathDynamic2D ceps::math::compose | ( | CepsUInt | M, |
CepsVector< CepsMathDynamic2D * > | blocks | ||
) |
Bloc matrices interleaving.
This is a helper method that enables the user to express a MNxMN matrix resulting from the union of M**2 block matrices of size N. Example with M=N=2:
This method is useful when several unknows need to be computed per node.
[in] | M | problem dimension |
[in] | blocks | pointers small N*N matrices |
Definition at line 96 of file EigenTools.cpp.
void ceps::math::computeInverse | ( | const CepsMathDynamic2D & | m, |
CepsMathDynamic2D & | inv | ||
) |
Inverse of square matrices.
Overload of ceps::math::computeInverse(...) function for square matrices.
[in] | m | square matrix of size MxM |
[out] | inv | inverse of param square matrix |
Definition at line 41 of file EigenTools.cpp.
void ceps::math::computeInverse | ( | const Eigen::Matrix< CepsReal, 2, 1 > & | m, |
Eigen::Matrix< CepsReal, 1, 2 > & | inv | ||
) |
Left inverse for 2x1 matrices.
Computes left inverse: where M is the rectangular matrix to inverse.
[in] | m | rectangular matrix to inverse |
[out] | inv | where the inverse will be stored |
Definition at line 85 of file EigenTools.cpp.
void ceps::math::computeInverse | ( | const Eigen::Matrix< CepsReal, 3, 1 > & | m, |
Eigen::Matrix< CepsReal, 1, 3 > & | inv | ||
) |
Left inverse 3x1 matrices.
Computes left inverse: where M is the rectangular matrix to inverse.
[in] | m | rectangular matrix to inverse |
[out] | inv | where the inverse will be stored |
Definition at line 47 of file EigenTools.cpp.
void ceps::math::computeInverse | ( | const Eigen::Matrix< CepsReal, 3, 2 > & | m, |
Eigen::Matrix< CepsReal, 2, 3 > & | inv | ||
) |
Left inverse for 3x2 matrices.
Computes left inverse: where M is the rectangular matrix to inverse.
[in] | m | rectangular matrix to inverse |
[out] | inv | where the inverse will be stored |
Definition at line 58 of file EigenTools.cpp.
CepsReal ceps::math::constStim | ( | CepsReal | t, |
CepsReal | duration, | ||
CepsReal * | point, | ||
const CepsVector< CepsReal > & | orig, | ||
CepsReal | diam, | ||
CepsReal | amp | ||
) |
Constant stimulation in a region (step function in time)
Time arguments are there for compatibility with other function calls, but are not used by the function. .
[in] | t | time from stimulation start |
[in] | duration | stimulation duration |
[in] | point | spatial position |
[in] | orig | origin point |
[in] | diam | diameter |
[in] | amp | intensity |
Definition at line 74 of file CepsContinuousFunctions.cpp.
A polynomial satisfying 0-derivative equalities.
with .
Definition at line 41 of file CepsContinuousFunctions.cpp.
Another polynomial satisfying more 0-derivative equalities.
Definition at line 53 of file CepsContinuousFunctions.cpp.
CepsReal ceps::math::derivativeLagrangianPol4Pts | ( | CepsReal | x, |
CepsReal | f0, | ||
CepsReal | f1, | ||
CepsReal | f2, | ||
CepsReal | f3 | ||
) |
Derivative of Lagrange interpolating polynomial of degree 3.
The function returns the value at position x, not the polynomial coefficients.
[in] | x | position |
[in] | f0 | f(0) |
[in] | f1 | f(1/3) |
[in] | f2 | f(2/3) |
[in] | f3 | f(1) |
Definition at line 121 of file CepsContinuousFunctions.cpp.
Compile-time factorial.
Definition at line 245 of file CepsContinuousFunctions.hpp.
CepsReal ceps::math::interpolateLagrange | ( | CepsReal | x, |
const CepsVector< CepsReal > & | f | ||
) |
Computes the interpolate of f at point x. assumes f is given at equidistant points on [0,1] Hard coded until 4 points are given.
Definition at line 37 of file LagrangeInterpolator.cpp.
CepsReal ceps::math::interpolateLagrange | ( | CepsReal | x, |
const CepsVector< CepsReal > & | f, | ||
CepsReal | xmin, | ||
CepsReal | xmax | ||
) |
Computes the interpolate of f at point x. assumes f is given at equidistant points on [xmin,xmax].
Definition at line 77 of file LagrangeInterpolator.cpp.
CepsReal ceps::math::interpolateLagrange | ( | CepsReal | x, |
const CepsVector< CepsReal > & | f, | ||
const CepsVector< CepsReal > & | xs | ||
) |
Computes the interpolate of f at point x. f given on points xs.
Definition at line 84 of file LagrangeInterpolator.cpp.
CepsReal ceps::math::lagrangianPol4Pts | ( | CepsReal | x, |
CepsReal | f0, | ||
CepsReal | f1, | ||
CepsReal | f2, | ||
CepsReal | f3 | ||
) |
Lagrange interpolation of degree 3.
The function returns the value at position x, not the polynomial coefficients.
[in] | x | position |
[in] | f0 | f(0) |
[in] | f1 | f(1/3) |
[in] | f2 | f(2/3) |
[in] | f3 | f(1) |
Definition at line 108 of file CepsContinuousFunctions.cpp.
CepsMathDynamic2D ceps::math::multiplyByBlocks | ( | const CepsMathDynamic2D & | A, |
const CepsMathDynamic2D & | B, | ||
const CepsArray2< CepsUInt > | a, | ||
const CepsArray2< CepsUInt > | b | ||
) |
Compute a matrix product by blocks [[C_11, C_12], [C_21, C_22]] = [[A_11 * B_11, A_12 * B_12], [A_21 * B_21, A_22 * B_22]] = [[A_11, A_12], [A_21, A_22]] * [[B_11, B_12], [B_21, B_22]].
A | the left side matrix |
B | the right side matrix |
a | shape block in A |
b | shape block in B |
Definition at line 183 of file EigenTools.cpp.
CepsReal ceps::math::newtonSolvePol4Pts | ( | CepsReal | f0, |
CepsReal | f1, | ||
CepsReal | f2, | ||
CepsReal | f3, | ||
CepsReal | c, | ||
CepsReal | t0 | ||
) |
Solves for , based on a 4 points interpolation of , using Newton method.
[in] | f0 | f(0) |
[in] | f1 | f(1/3) |
[in] | f2 | f(2/3) |
[in] | f3 | f(1) |
[in] | c | target value |
[in] | t0 | initial guess of |
Definition at line 133 of file CepsContinuousFunctions.cpp.
Pole function used in stimulation function definition.
This function belongs to . It is extended by 0 if .
Definition at line 35 of file CepsContinuousFunctions.cpp.
void ceps::math::putRowsSumInDiagonal | ( | CepsMathDynamic2D & | mat | ) |
Mass lumping.
Computes the mass lumping approximation putting the sum of off-diagonal entries into the diagonal
[in,out] | mat | elementary Eigen matrix to modify |
Definition at line 162 of file EigenTools.cpp.