PolyDiM
C++ library for POLYtopal DIscretization Methods
Loading...
Searching...
No Matches
Polydim::Utilities::Monomials_Utilities< dimension > Struct Template Referencefinal

#include <Monomials_Utilities.hpp>

Public Member Functions

Eigen::MatrixXi Exponents (const Polydim::Utilities::Monomials_Data &data) const
 Collect the monomial exponents into a single matrix.
 
Eigen::MatrixXd Vander (const Polydim::Utilities::Monomials_Data &data, const Eigen::MatrixXd &points, const Eigen::Vector3d &centroid, const double &diam) const
 Evaluate the Vandermonde matrix of the scaled monomial basis.
 
template<typename MonomialType >
std::vector< Eigen::MatrixXd > VanderDerivatives (const Polydim::Utilities::Monomials_Data &data, const MonomialType &monomials, const Eigen::MatrixXd &Vander, const double &diam) const
 Evaluate the Vandermonde matrices of the first-order partial derivatives.
 
template<typename MonomialType >
Eigen::MatrixXd VanderLaplacian (const Polydim::Utilities::Monomials_Data &data, const MonomialType &monomials, const Eigen::MatrixXd &Vander, const double &diam) const
 Evaluate the Vandermonde matrix of the monomial Laplacian.
 
void MGSOrthonormalize (const Eigen::VectorXd &weights, const Eigen::MatrixXd &Vander, Eigen::MatrixXd &Hmatrix, Eigen::MatrixXd &QmatrixInv, Eigen::MatrixXd &Qmatrix) const
 \(L^2(E)\)-orthonormalize the monomial basis via modified Gram–Schmidt.
 

Member Function Documentation

◆ Exponents()

template<unsigned short dimension>
Eigen::MatrixXi Polydim::Utilities::Monomials_Utilities< dimension >::Exponents ( const Polydim::Utilities::Monomials_Data data) const
inline

Collect the monomial exponents into a single matrix.

Parameters
dataMonomial basis data.
Returns
A \(\text{dimension} \times N_{\text{mon}}\) integer matrix whose \(m\)-th column is the exponent multi-index \(\alpha\) of the \(m\)-th monomial.

◆ MGSOrthonormalize()

template<unsigned short dimension>
void Polydim::Utilities::Monomials_Utilities< dimension >::MGSOrthonormalize ( const Eigen::VectorXd &  weights,
const Eigen::MatrixXd &  Vander,
Eigen::MatrixXd &  Hmatrix,
Eigen::MatrixXd &  QmatrixInv,
Eigen::MatrixXd &  Qmatrix 
) const
inline

\(L^2(E)\)-orthonormalize the monomial basis via modified Gram–Schmidt.

Orthonormalizes the scaled monomials with respect to the weighted \(L^2(E)\) inner product defined by the quadrature weights, using a modified Gram–Schmidt factorization followed by a re-orthogonalization step for numerical stability. The routine returns the change-of-basis matrices mapping between the monomial and the orthonormal basis.

Parameters
weightsQuadrature weights defining the \(L^2(E)\) inner product.
VanderVandermonde matrix of the monomials at the quadrature points.
[out]HmatrixMass matrix in the orthonormal basis, \(Q_2^\top Q_2\) (close to the identity).
[out]QmatrixInvLower-triangular inverse change-of-basis matrix, \((R_2 R_1)^\top\).
[out]QmatrixChange-of-basis matrix to the orthonormal basis (inverse of QmatrixInv).

◆ Vander()

template<unsigned short dimension>
Eigen::MatrixXd Polydim::Utilities::Monomials_Utilities< dimension >::Vander ( const Polydim::Utilities::Monomials_Data data,
const Eigen::MatrixXd &  points,
const Eigen::Vector3d &  centroid,
const double &  diam 
) const
inline

Evaluate the Vandermonde matrix of the scaled monomial basis.

Builds the matrix whose \((p, m)\) entry is the \(m\)-th scaled monomial evaluated at the \(p\)-th point, \(\prod_d \left(\frac{x_d - x_{E,d}}{h_E}\right)^{\alpha_d}\). Per-coordinate integer powers are precomputed once (VanderPartial) and combined according to each monomial's exponent multi-index.

Parameters
dataMonomial basis data (degree, exponents, number of monomials).
pointsEvaluation points, one per column.
centroidElement centroid \(\boldsymbol{x}_E\).
diamElement diameter \(h_E\) used to scale the coordinates.
Returns
A \(N_{\text{points}} \times N_{\text{mon}}\) Vandermonde matrix; a column of ones is returned when the basis reduces to the constant.

◆ VanderDerivatives()

template<unsigned short dimension>
template<typename MonomialType >
std::vector< Eigen::MatrixXd > Polydim::Utilities::Monomials_Utilities< dimension >::VanderDerivatives ( const Polydim::Utilities::Monomials_Data data,
const MonomialType &  monomials,
const Eigen::MatrixXd &  Vander,
const double &  diam 
) const
inline

Evaluate the Vandermonde matrices of the first-order partial derivatives.

For each spatial direction \(i\), returns the Vandermonde matrix of \(\partial_{x_i} m_\alpha\), reusing the already-evaluated monomial values in Vander. Each derivative maps to a lower-degree monomial (via DerivativeIndices) scaled by the derivative coefficient and by the chain-rule factor \(1/h_E\); directions with no contribution yield a zero column.

Template Parameters
MonomialTypeMonomial type exposing DerivativeIndices and DerivativeMatrix.
Parameters
dataMonomial basis data.
monomialsMonomial object providing the derivative maps.
VanderVandermonde matrix of the monomials at the same points (see Vander()).
diamElement diameter \(h_E\).
Returns
A vector of dimension matrices, the \(i\)-th being the Vandermonde matrix of \(\partial_{x_i}\) of the basis (same shape as Vander).

◆ VanderLaplacian()

template<unsigned short dimension>
template<typename MonomialType >
Eigen::MatrixXd Polydim::Utilities::Monomials_Utilities< dimension >::VanderLaplacian ( const Polydim::Utilities::Monomials_Data data,
const MonomialType &  monomials,
const Eigen::MatrixXd &  Vander,
const double &  diam 
) const
inline

Evaluate the Vandermonde matrix of the monomial Laplacian.

Returns the matrix whose \(k\)-th column holds \(\Delta m_k\) evaluated at the points, assembled from the precomputed data.Laplacian coefficients and the second-derivative maps (SecondDerivativeIndices), scaled by \(1/h_E^2\). The constant and linear monomials, whose Laplacian vanishes, give zero columns.

Template Parameters
MonomialTypeMonomial type exposing SecondDerivativeIndices.
Parameters
dataMonomial basis data (must provide the Laplacian matrix).
monomialsMonomial object providing the second-derivative maps.
VanderVandermonde matrix of the monomials at the same points (see Vander()).
diamElement diameter \(h_E\).
Returns
A matrix, shaped like Vander, holding \(\Delta\) of the basis.

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