Vulpes  0.1.0
Versatile and parallel compUtational Library for high-order discontinuous Polytopal Element Simulations
Loading...
Searching...
No Matches
vulpes::fe::internal Namespace Reference

Classes

struct  PolynomialTypeHelper
struct  PolynomialTypeHelper< T, std::enable_if_t< std::is_same_v< T, void > > >
struct  LagrangianNodesPolicy
 Compute the equi-spaced nodes on a simplex in Dim dimensions. More...
struct  WarpAndBlendNodesPolicy
 Compute the warp&blend nodes on a simplex in Dim dimensions See: Warburton, Tim. "An explicit construction of interpolation nodes on the simplex." Journal of engineering mathematics 56 (2006): 247-262. More...
struct  IsUnscaledSparsePolynomial
 True for a double SparsePolynomial with unscaled monomials. More...
struct  IsUnscaledSparsePolynomial< polynomial::SparsePolynomial< D, I, double, false > >

Typedefs

using real_t = mpf_class

Functions

static VULPES_ALWAYS_INLINE auto hcat (const auto &u, const auto &v)
 Horizontally concatenate two matrices that have the same number of rows.
template<typename FromMat, typename ToPoly>
auto liftConstant (const FromMat &m)
 Convert a matrix of scalars into a matrix of polynomials (constant polynomials).
template<typename FromMat, typename ToPoly>
auto liftDimension (const FromMat &m)
 Convert a matrix of polynomials of lower dimension into a matrix of polynomials of higher dimension (by lifting them).
static VULPES_ALWAYS_INLINE auto lift_to_same_space (const auto &u, const auto &v)
 Given two matrices of polynomials u and v, lift the one with lower dimension to the higher dimension, so that both have the same polynomial type.
static VULPES_ALWAYS_INLINE auto cartesian_hcat (const auto &u, const auto &v)
 Horizontal concatenation of the cartesian product of the columns of two matrices.
double conditionNumber (const Eigen::MatrixXd &A)
 : Estimate condition number of a dense matrix using SVD
template<typename FloatType, std::size_t Dim>
Eigen::Matrix< FloatType, -1, -1 > buildVandermonde (const std::vector< Point< FloatType, Dim > > &points)
 : Build Vandermonde matrix for a polynomial of P space
template<typename FloatType>
Eigen::Matrix< FloatType, -1, -1 > computeInverse (const Eigen::Matrix< FloatType, -1, -1 > &matrix)
 : Invert a matrix, use partial pivot if we have exact arithmetic
template<std::size_t Dim, typename FloatType>
Eigen::Matrix< FloatType, -1, -1 > computeLagrangianPolyCoef (const std::vector< Point< FloatType, Dim > > &points)
 : Compute the coefficients of interpolatory lagrangian polynomials of a set of points
Eigen::VectorXd gaussLobattoRoots (Eigen::Index N)
Eigen::VectorXd evalLegendre (const Eigen::VectorXd &x, Eigen::Index n)
Eigen::VectorXd computeWarp (Eigen::Index N, const Eigen::VectorXd &rout)
std::pair< Eigen::VectorXd, Eigen::VectorXd > computeWarpAndBlend (Eigen::Index N, double alpha, const Eigen::VectorXd &L1, const Eigen::VectorXd &L2, const Eigen::VectorXd &L3)
std::pair< Eigen::VectorXd, Eigen::VectorXd > nodes2D (Eigen::Index N)
Eigen::Matrix2Xd xy2rs (const std::pair< Eigen::VectorXd, Eigen::VectorXd > &xy)
Eigen::Vector3d normalize (const Eigen::Vector3d &v)
Eigen::MatrixXd equinNodes3D (Eigen::Index N)
Eigen::Matrix3Xd nodes3D (Eigen::Index p)
Eigen::Matrix3Xd xyz2rst (const Eigen::Matrix3Xd &xyz)
template<typename T>
T jacobiP (const T &x, std::size_t alpha, std::size_t beta, std::size_t N)
 Evaluate the Jacobi Polynomial of degree N and parameters (alpha,beta) at point x.
template<typename T>
T simplex2DP (const Eigen::Vector< T, 2 > &ab, const std::array< std::size_t, 2 > &ij)
 Evaluate the 2D modal basis functions on simplex elements in barycentric coordinates.
template<typename T>
T simplex3DP (const Eigen::Vector< T, 3 > &abc, const std::array< std::size_t, 3 > &ijk)
 Evaluate the 3D modal basis functions on simplex elements in barycentric coordinates.
template<typename T>
Eigen::Vector< T, 2 > rs2ab (const Eigen::Vector< T, 2 > &rs)
 Map from (r,s) to (a,b) coordinates for 2D simplex.
template<typename T>
Eigen::Vector< T, 3 > rst2abc (const Eigen::Vector< T, 3 > &rst)
 Map from (r,s,t) to (a,b,c) coordinates for 3D simplex.
template<typename T, std::size_t Dim>
T evalSimplex (const Eigen::Vector< T, Dim > &x, std::size_t n)
 Evaluate the modal basis function of index n at point x in the Dim-simplex.
template<typename T, std::size_t Dim>
Eigen::Vector< T, -1 > interpolateFunctionAtNodes (const std::vector< Eigen::Vector< T, Dim > > &nodes, const std::function< T(const Eigen::Vector< T, Dim > &)> &f, std::size_t deg)
 Interpolate a function f at given nodes in the Dim-simplex and return the coefficients of the interpolating polynomial.

Typedef Documentation

◆ real_t

using vulpes::fe::internal::real_t = mpf_class

Function Documentation

◆ buildVandermonde()

template<typename FloatType, std::size_t Dim>
Eigen::Matrix< FloatType, -1, -1 > vulpes::fe::internal::buildVandermonde ( const std::vector< Point< FloatType, Dim > > & points)

: Build Vandermonde matrix for a polynomial of P space

◆ cartesian_hcat()

VULPES_ALWAYS_INLINE auto vulpes::fe::internal::cartesian_hcat ( const auto & u,
const auto & v )
inlinestatic

Horizontal concatenation of the cartesian product of the columns of two matrices.

Given two matrices u and v with the same number of rows, create a new matrix where each column is formed by multiplying a column from u with a column from v (element-wise). The resulting matrix contains all possible combinations of columns

Parameters
uFirst matrix
vSecond matrix
Returns
Concatenated matrix

◆ computeInverse()

template<typename FloatType>
Eigen::Matrix< FloatType, -1, -1 > vulpes::fe::internal::computeInverse ( const Eigen::Matrix< FloatType, -1, -1 > & matrix)

: Invert a matrix, use partial pivot if we have exact arithmetic

◆ computeLagrangianPolyCoef()

template<std::size_t Dim, typename FloatType>
Eigen::Matrix< FloatType, -1, -1 > vulpes::fe::internal::computeLagrangianPolyCoef ( const std::vector< Point< FloatType, Dim > > & points)

: Compute the coefficients of interpolatory lagrangian polynomials of a set of points

◆ computeWarp()

Eigen::VectorXd vulpes::fe::internal::computeWarp ( Eigen::Index N,
const Eigen::VectorXd & rout )

◆ computeWarpAndBlend()

std::pair< Eigen::VectorXd, Eigen::VectorXd > vulpes::fe::internal::computeWarpAndBlend ( Eigen::Index N,
double alpha,
const Eigen::VectorXd & L1,
const Eigen::VectorXd & L2,
const Eigen::VectorXd & L3 )

◆ conditionNumber()

double vulpes::fe::internal::conditionNumber ( const Eigen::MatrixXd & A)
inline

: Estimate condition number of a dense matrix using SVD

◆ equinNodes3D()

Eigen::MatrixXd vulpes::fe::internal::equinNodes3D ( Eigen::Index N)

◆ evalLegendre()

Eigen::VectorXd vulpes::fe::internal::evalLegendre ( const Eigen::VectorXd & x,
Eigen::Index n )

◆ evalSimplex()

template<typename T, std::size_t Dim>
T vulpes::fe::internal::evalSimplex ( const Eigen::Vector< T, Dim > & x,
std::size_t n )

Evaluate the modal basis function of index n at point x in the Dim-simplex.

◆ gaussLobattoRoots()

Eigen::VectorXd vulpes::fe::internal::gaussLobattoRoots ( Eigen::Index N)

◆ hcat()

VULPES_ALWAYS_INLINE auto vulpes::fe::internal::hcat ( const auto & u,
const auto & v )
inlinestatic

Horizontally concatenate two matrices that have the same number of rows.

Parameters
uFirst matrix
vSecond matrix
Returns
Concatenated matrix

◆ interpolateFunctionAtNodes()

template<typename T, std::size_t Dim>
Eigen::Vector< T, -1 > vulpes::fe::internal::interpolateFunctionAtNodes ( const std::vector< Eigen::Vector< T, Dim > > & nodes,
const std::function< T(const Eigen::Vector< T, Dim > &)> & f,
std::size_t deg )

Interpolate a function f at given nodes in the Dim-simplex and return the coefficients of the interpolating polynomial.

◆ jacobiP()

template<typename T>
T vulpes::fe::internal::jacobiP ( const T & x,
std::size_t alpha,
std::size_t beta,
std::size_t N )
inline

Evaluate the Jacobi Polynomial of degree N and parameters (alpha,beta) at point x.

◆ lift_to_same_space()

VULPES_ALWAYS_INLINE auto vulpes::fe::internal::lift_to_same_space ( const auto & u,
const auto & v )
inlinestatic

Given two matrices of polynomials u and v, lift the one with lower dimension to the higher dimension, so that both have the same polynomial type.

Parameters
uFirst matrix
vSecond matrix
Returns
Pair of matrices with lifted polynomials

◆ liftConstant()

template<typename FromMat, typename ToPoly>
auto vulpes::fe::internal::liftConstant ( const FromMat & m)

Convert a matrix of scalars into a matrix of polynomials (constant polynomials).

Template Parameters
FromMatInput matrix type
ToPolyOutput polynomial type
Parameters
mInput matrix of scalars
Returns
Matrix of polynomials

◆ liftDimension()

template<typename FromMat, typename ToPoly>
auto vulpes::fe::internal::liftDimension ( const FromMat & m)

Convert a matrix of polynomials of lower dimension into a matrix of polynomials of higher dimension (by lifting them).

Template Parameters
FromMatInput matrix type
ToPolyOutput polynomial type
Parameters
mInput matrix of polynomials
Returns
Matrix of lifted polynomials

◆ nodes2D()

std::pair< Eigen::VectorXd, Eigen::VectorXd > vulpes::fe::internal::nodes2D ( Eigen::Index N)

◆ nodes3D()

Eigen::Matrix3Xd vulpes::fe::internal::nodes3D ( Eigen::Index p)

◆ normalize()

Eigen::Vector3d vulpes::fe::internal::normalize ( const Eigen::Vector3d & v)

◆ rs2ab()

template<typename T>
Eigen::Vector< T, 2 > vulpes::fe::internal::rs2ab ( const Eigen::Vector< T, 2 > & rs)
inline

Map from (r,s) to (a,b) coordinates for 2D simplex.

◆ rst2abc()

template<typename T>
Eigen::Vector< T, 3 > vulpes::fe::internal::rst2abc ( const Eigen::Vector< T, 3 > & rst)
inline

Map from (r,s,t) to (a,b,c) coordinates for 3D simplex.

◆ simplex2DP()

template<typename T>
T vulpes::fe::internal::simplex2DP ( const Eigen::Vector< T, 2 > & ab,
const std::array< std::size_t, 2 > & ij )

Evaluate the 2D modal basis functions on simplex elements in barycentric coordinates.

◆ simplex3DP()

template<typename T>
T vulpes::fe::internal::simplex3DP ( const Eigen::Vector< T, 3 > & abc,
const std::array< std::size_t, 3 > & ijk )

Evaluate the 3D modal basis functions on simplex elements in barycentric coordinates.

◆ xy2rs()

Eigen::Matrix2Xd vulpes::fe::internal::xy2rs ( const std::pair< Eigen::VectorXd, Eigen::VectorXd > & xy)

◆ xyz2rst()

Eigen::Matrix3Xd vulpes::fe::internal::xyz2rst ( const Eigen::Matrix3Xd & xyz)