![]() |
Vulpes
0.1.0
Versatile and parallel compUtational Library for high-order discontinuous Polytopal Element Simulations
|
Namespaces | |
| namespace | internal |
Classes | |
| class | Monomial |
| Class representing a (possibly scaled) monomial. More... | |
Functions | |
| template<typename T, typename = std::enable_if_t<std::is_integral_v<T>>> | |
| std::array< T, 2 > | getMonomial2D (std::size_t n) |
| Computes the 2D monomial exponents for a given linear index. | |
| template<typename T, typename = std::enable_if_t<std::is_integral_v<T>>> | |
| std::array< T, 3 > | getMonomial3D (std::size_t n) |
| Computes the 3D monomial exponents for a given linear index. | |
| template<std::size_t Dim, typename T> | |
| std::array< T, Dim > | getMonomial (std::size_t n) |
| Computes the Dim-D monomial exponents for a given linear index. | |
| template<std::size_t Dim, typename T> | |
| T | getLinearIndex (const std::array< T, Dim > &monomial) |
| Computes the linear index given the exponents of the monomial. | |
|
inline |
Computes the linear index given the exponents of the monomial.
|
inline |
Computes the Dim-D monomial exponents for a given linear index.
|
inline |
Computes the 2D monomial exponents for a given linear index.
| T | The integral type used for the return array elements. |
| Dummy | A dummy template parameter used for SFINAE (Substitution Failure Is Not An Error). |
| n | The linear index for which the 2D monomial exponents are to be computed. |
This function calculates the exponents \(i\) and \(j\) for the monomial \(x^i y^j\) that corresponds to the linear index \(n\) in a 2D monomial ordering scheme. The function assumes the index \(n\) is non-negative and within the range where the floating-point precision of float is sufficient to handle the calculations. It uses a quadratic formula to determine the level of the monomial and then computes the specific exponents within that level. The triangle up to the \(s\)-th level contains \(s(s+1)/2\) elements
|
inline |
Computes the 3D monomial exponents for a given linear index.
| T | The integral type used for the return array elements. |
| Dummy | A dummy template parameter used for SFINAE (Substitution Failure Is Not An Error). |
| n | The linear index for which the 3D monomial exponents are to be computed. |
This function calculates the exponents \(i\), \(j\), and \(k\) for the monomial \(x^i y^j z^k\) that corresponds to the linear index \(n\) in a 3D monomial ordering scheme. The function handles the case when \(n = 0\) by returning \((0, 0, 0)\), and for \(n > 0\), it uses a cubic root approximation and Newton's method to determine the pyramid level. Namely, the pyramid up to the \(s\)-th level contains \(s(s+1)(s+2)/6\) elements The specific exponents within that level are then computed using the getMonomial2D function for the residual index.