|
MAIA bb96820c
Multiphysics at AIA
|
Holds helper functions for the interpolation. More...
Functions | |
| void | calcLegendrePolyAndDeriv (MInt Nmax, MFloat x, MFloat *polynomial, MFloat *derivative) |
| Evaluates the Legendre polynomial and its derivative of degree Nmax at point x. More... | |
| void | calcLegendreGaussNodesAndWeights (MInt Nmax, MFloat *nodes, MFloat *wInt) |
| Calculate the Gauss integration nodes and weight for the Legendre polynomials on the interval [-1,1]. More... | |
| void | calcQandL (MInt Nmax, MFloat x, MFloat &q, MFloat &qDeriv, MFloat &poly) |
| Auxiliary function (only used by calcLegendreGaussLobattoNodesAndWeights()) More... | |
| void | calcLegendreGaussLobattoNodesAndWeights (MInt Nmax, MFloat *nodes, MFloat *wInt) |
| Calculate the Gauss-Lobatto integration nodes and weight for the Legendre polynomials on the interval [-1,1]. More... | |
| void | calcBarycentricWeights (MInt Nmax, const MFloat *nodes, MFloat *weights) |
| Calculates the barycentric weights for Lagrange interpolation at thei specified nodes. More... | |
| MFloat | getLagrangeInterpolation (MFloat x, MInt Nmax, const MFloat *nodes, const MFloat *values, const MFloat *wBary) |
| Calculates the interpolated value at point x given a set of nodes, values, and weights. More... | |
| void | calcLagrangeInterpolatingPolynomials (const MFloat x, const MInt polyDeg, const MFloat *nodes, const MFloat *wBary, MFloat *polynomials) |
| Calculates the values of the Lagrangian polynomials l_j for a given point x in [-1,1]. More... | |
| void | calcLhat (const MFloat x, const MInt polyDeg, const MFloat *nodes, const MFloat *wInt, const MFloat *wBary, MFloat *Lhat) |
| Calculates the Lagrange polynomials evaluated at point x in [-1,1] and pre-divides them by the integration weights. More... | |
| MBool | ascendingAbsVal (MFloat i, MFloat j) |
| void | calcPolynomialDerivativeMatrix (MInt Nmax, const MFloat *nodes, const MFloat *wBary, MFloat *derivMatrix) |
| Calculates the first derivative approximation matrix. More... | |
| void | calcDhat (MInt Nmax, const MFloat *nodes, const MFloat *wInt, const MFloat *wBary, MFloat *dhatMatrix) |
| Calculates the polynomial derivative matrix and normalizes it using the integration weights. More... | |
| template<MInt nDim, MInt noVariables> | |
| void | prolongToFaceGauss (const MFloat *const source, const MInt faceId, const MInt noNodes1D, const MFloat *const LFaceN, const MFloat *const LFaceP, MFloat *const destination) |
| Extrapolates ("prolongs") the Gauss node values of an element to a given face. More... | |
| template<MInt nDim, MInt noVariables, class T , class U > | |
| void | prolongToFaceGaussLobatto (const T source, const MInt faceId, const MInt noNodes1D, U destination) |
| Extrapolates ("prolongs") the Gauss-Lobatto node values of an element to a given face. More... | |
| template<class T , class U , class V , class W > | |
| void | calcPolynomialInterpolationMatrix (MInt noNodesIn, const T nodesIn, MInt noNodesOut, const U nodesOut, const V wBary, W vandermonde) |
| Calculate the polynomial interpolation matrix (Vandermonde) to interpolate from one set of nodes to another. More... | |
| template<MInt nDim, class T , class U , class V > | |
| void | interpolateNodes (const T source, U vandermonde, MInt noNodesIn, MInt noNodesOut, MInt noVariables, V destination) |
| void | calcSBPNodes (const MInt noNodes, MFloat *nodes) |
| Generates an equidistant node distribution. More... | |
| void | calcSBPWeights (const MInt noNodes, MFloatVector sbpP, MFloat *wInt) |
| Calulates the diagonal weight matrix (H) entries. More... | |
| MBool | checkSBPProp (const MFloatMatrix &Q) |
| Helper function for checking the SBP property of a given operator. More... | |
| void | readCSV (std::string path, std::vector< std::vector< MFloat > > &data) |
| Reads .csv-file on rank 0 and broadcasts it to all ranks. More... | |
| void | readDDRP (MFloat *nodesVector, MFloat *wIntVector, MFloat *dhatMatrix) |
| Reads DDRP operator and nodal distribution from file. More... | |
| void | calcDhatSBP (const MInt noNodes, MFloatVector sbpA, MFloatVector sbpQ, const MFloat *wInt, MFloat *dhatMatrix) |
| Calculates SBP operator from coefficients. More... | |
| void | readSbpOperator (MInt noNodes1D, MString opName, MFloatVector &sbpA, MFloatVector &sbpP, MFloatVector &sbpQ) |
| Reads all coefficient files to contruct SBP operator. More... | |
| MBool | getSBPOperator (const MInt noNodes1D, const MString opName, MFloatVector &sbpA, MFloatVector &sbpP, MFloatVector &sbpQ) |
| Gets SBP Coefficients from corresponding header if existent. More... | |
| void | findNodeIndicesAtPoint (const MFloat point, const MFloat *nodes, const MInt noNodes, MInt &idx1, MInt &idx2) |
| Finds the neighboring indices to point in one dimension. More... | |
| void | calcLinearInterpolationBase (const MFloat x, const MInt noNodes, const MFloat *nodes, MFloat *const polynomials) |
| Calculates linear interpolation base for point (1D). More... | |
| template<class T , class U , class V > | |
| void | calcLinearInterpolationMatrix (const MInt noNodesIn, const T nodesIn, const MInt noNodesOut, const U nodesOut, V vandermonde) |
| Calculates the linear interpolation matrix (Vandermonde) to interpolate from one set of nodes to another. More... | |
| void | calcBilinearInterpolation (MFloat *point, const MFloat *nodes, const MInt noNodes, const MInt noVars, const MFloat *u, MFloat *const out) |
| Calculates bilinear interpolation at given point (2D) More... | |
| void | calcTrilinearInterpolation (MFloat *point, const MFloat *nodes, const MInt noNodes, const MInt noVars, const MFloat *u, MFloat *const out) |
| Calculates trilinear interpolation at given point (3D) More... | |
Holds helper functions for the construction of operators and interpolation in SBP mode.
The following two sources may be cited:
Kopriva09: David A. Kopriva, Implementing Spectral Methods for Partial Differential Equations, Springer, 2009
HesthavenWarburton08: J. S. Hesthaven and T. Warburton, Nodal Discontinuous Galerkin Methods, Springer, 2008
Definition at line 409 of file dgcartesianinterpolation.h.
|
inline |
| [in] | Nmax | The polynomial degree. |
| [in] | nodes | Nodes of the interpolating polynomial. |
| [out] | weights | The barycentric weights. |
Taken from Kopriva09, p. 75, algorithm 30
Definition at line 277 of file dgcartesianinterpolation.h.
|
inline |
| [in] | point | Point at wich interpolation is evaluated |
| [in] | nodes | Nodal distribution |
| [in] | noNodes | Number of nodes 1D |
| [in] | noVars | Number of variables per node |
| [in] | u | Solution field at all nodes |
| [out] | out | Interpolated solution at point |
Definition at line 532 of file sbpcartesianinterpolation.h.
|
inline |
| [in] | Nmax | Maximum polynomial degree. |
| [in] | nodes | The integration nodes. |
| [in] | wInt | The integration weights. |
| [in] | wBary | The barycentric weights. |
This method returns Dhat(j,n) = -D(n,j) * w(n) / w(j) as defined in Kopriva 09, p. 137, Eq. (4.139).
Definition at line 488 of file dgcartesianinterpolation.h.
|
inline |
| [in] | noNodes | Number of nodes |
| [in] | sbpA | Coefficients for the inner stencil |
| [in] | sbpQ | Coefficients for the boundary solver |
| [in] | wInt | Integration weights |
| [out] | dHatMatrix | SBP operator (already scaled by wInt) |
Definition at line 246 of file sbpcartesianinterpolation.h.
|
inline |
| [in] | x | The point at which the polynomials should be evaluated. |
| [in] | noNodes | Number of nodes.. |
| [in] | nodes | The nodes of the Lagrange polynomials. |
| [in] | wBary | The barycentric weights of the Lagrange polynomials. |
| [out] | polynomials | The Nmax+1 Lagrange polynomials l_j, evaluated at x. |
Taken from Kopriva09, p. 77, algorithm 34.
Definition at line 351 of file dgcartesianinterpolation.h.
|
inline |
| [in] | Nmax | Maximum degree of the polynomials. |
| [out] | nodes | The resulting integration nodes. |
| [out] | wInt | The resulting integration weights. |
Taken from Kopriva09, p. 66, algorithm 25.
Definition at line 198 of file dgcartesianinterpolation.h.
|
inline |
| [in] | Nmax | Maximum degree of the polynomials. |
| [out] | nodes | The resulting integration nodes. |
| [out] | wInt | The resulting integration weights. |
Taken from Kopriva09, p. 64, algorithm 23.
Definition at line 131 of file dgcartesianinterpolation.h.
|
inline |
| [in] | Nmax | The polynomial degree. |
| [in] | x | The evaluation point. |
| [out] | polynomial | The resulting value of the Legendre polynomial. |
| [out] | derivative | The resulting value of the derivative. |
Taken from Kopriva09, p. 63, algorithm 22.
Definition at line 114 of file dgcartesianinterpolation.h.
|
inline |
| [in] | x | Evaluation point. |
| [in] | polyDeg | Maximum polynomial degree. |
| [in] | nodes | The integration nodes. |
| [in] | wInt | The integration weights. |
| [in] | wBary | The barycentric weights. |
| [out] | Lhat | The Lagrange polynomials divided by the integration weights, i.e. Lhat_j(x) = L_j(x) / w(j). |
Definition at line 395 of file dgcartesianinterpolation.h.
|
inline |
| [in] | x | Point at which the solution is interpolated |
| [in] | noNodes | Number of nodes |
| [in] | nodes | Nodal distribution |
| [out] | polynomials | Coefficients for the linear interpolation |
Definition at line 467 of file sbpcartesianinterpolation.h.
| void maia::dg::interpolation::calcLinearInterpolationMatrix | ( | const MInt | noNodesIn, |
| const T | nodesIn, | ||
| const MInt | noNodesOut, | ||
| const U | nodesOut, | ||
| V | vandermonde | ||
| ) |
| T,U,V | Any container type that overloads operator[] for element access (including pointers). |
| [in] | noNodesIn | Number of incoming nodes |
| [in] | nodesIn | Incoming nodal distribution |
| [in] | noNodesOut | Number of outgoing nodes |
| [in] | nodesOut | Outgoing nodal distribution |
| [out] | vandermonde | Interpolation matrix |
Definition at line 496 of file sbpcartesianinterpolation.h.
|
inline |
| [in] | Nmax | Maximum polynomial degree. |
| [in] | nodes | The nodes of the Lagrange polynomial. |
| [in] | wBary | The barycentric weights of the Lagrange polynomial. |
| [out] | derivMatrix | The derivative matrix. |
Taken from Kopriva09, p. 82, algorithm 37.
Definition at line 426 of file dgcartesianinterpolation.h.
| void maia::dg::interpolation::calcPolynomialInterpolationMatrix | ( | MInt | noNodesIn, |
| const T | nodesIn, | ||
| MInt | noNodesOut, | ||
| const U | nodesOut, | ||
| const V | wBary, | ||
| W | vandermonde | ||
| ) |
| T,U,V,W | Any container type that overloads operator[] for element access (including pointers). |
| [in] | noNodesIn | |
| [in] | nodesIn | |
| [in] | noNodesOut | |
| [in] | nodesOut | |
| [in] | wBary | |
| [out] | vandermonde |
Definition at line 729 of file dgcartesianinterpolation.h.
|
inline |
| [in] | Nmax | The polynomial degree. |
| [in] | x | The evaluation point. |
| [out] | q | The resulting q value. |
| [out] | qDeriv | The resulting q' value. |
| [out] | poly | The resulting value of the Legendre polynomial. |
Taken from Kopriva09, p. 65, algorithm 24.
Definition at line 151 of file dgcartesianinterpolation.h.
| [in] | noNodes | Number of nodes |
| [out] | nodes | Node distribution |
Definition at line 42 of file sbpcartesianinterpolation.h.
|
inline |
| [in] | noNodes | Number of nodes |
| [in] | sbpP | Coefficients for the boundary nodes |
| [out] | wInt | Integration matrix (1D diagonal) |
Definition at line 65 of file sbpcartesianinterpolation.h.
|
inline |
| [in] | point | Point at wich interpolation is evaluated |
| [in] | nodes | Nodal distribution |
| [in] | noNodes | Number of nodes 1D |
| [in] | noVars | Number of variables per node |
| [in] | u | Solution field at all nodes |
| [out] | out | Interpolated solution at point |
Definition at line 572 of file sbpcartesianinterpolation.h.
|
inline |
| [in] | Q | (hopefully) SBP operator |
Definition at line 89 of file sbpcartesianinterpolation.h.
|
inline |
| [in] | point | 1D Point |
| [in] | nodes | Nodal distribution |
| [in] | noNodes | Number of nodes |
| [out] | idx1 | First index (more negativer) |
Definition at line 438 of file sbpcartesianinterpolation.h.
|
inline |
| [in] | x | The point which should be evaluated. |
| [in] | Nmax | The maximum polynomial degree. |
| [in] | nodes | The set of Nmax+1 node locations. |
| [in] | values | The set of values at the nodes. |
| [in] | wBary | The barycentric weights for the given set of nodes. |
Taken from Kopriva09, p. 75, algorithm 31.
Definition at line 315 of file dgcartesianinterpolation.h.
|
inline |
| [in] | noNodes1D | Number of nodes |
| [in] | opName | Name of SBP operator |
| [out] | sbpA | Coefficients for the inner stencil |
| [out] | sbpP | Coefficients for the integration matrix |
| [out] | sbpQ | Coefficients for the boundary solver |
Definition at line 381 of file sbpcartesianinterpolation.h.
| void maia::dg::interpolation::interpolateNodes | ( | const T | source, |
| U | vandermonde, | ||
| MInt | noNodesIn, | ||
| MInt | noNodesOut, | ||
| MInt | noVariables, | ||
| V | destination | ||
| ) |
| nDim | Number of spatial dimensions of the element. |
| T,U,V | Any container type that overloads operator[] for element access (including pointers). |
| [in] | source | |
| [in] | vandermonde | |
| [in] | noNodesIn | |
| [in] | noNodesOut | |
| [in] | noVariables | |
| [out] | destination |
Definition at line 777 of file dgcartesianinterpolation.h.
| void maia::dg::interpolation::prolongToFaceGauss | ( | const MFloat *const | source, |
| const MInt | faceId, | ||
| const MInt | noNodes1D, | ||
| const MFloat *const | LFaceN, | ||
| const MFloat *const | LFaceP, | ||
| MFloat *const | destination | ||
| ) |
| nDim | Number of spatial dimensions of the element. |
| noVariables | Number of variables per node. |
| T,U,V | Any container type that overloads operator[] for element access (including pointers). |
| [in] | source | Pointer to memory where the values at the nodes are located. |
| [in] | faceId | Face to which the values are prolonged ([-x, x, -y, y] = [0, 1, 2, 3]) |
| [in] | polyDeg | Polynomial degree inside the element. |
| [in] | LFace | Array with Lagrange polynomials at x = -1.0 (index 0) and +1.0 (index 1) |
| [out] | destination | Pointer to memory where the extrapolated values should be stored. |
Definition at line 528 of file dgcartesianinterpolation.h.
| void maia::dg::interpolation::prolongToFaceGaussLobatto | ( | const T | source, |
| const MInt | faceId, | ||
| const MInt | noNodes1D, | ||
| U | destination | ||
| ) |
| nDim | Number of spatial dimensions of the element. |
| noVariables | Number of variables per node. |
| T,U,V,W | Any container type that overloads operator[] for element access (including pointers). |
| [in] | source | Pointer to memory where the values at the nodes are located. |
| [in] | faceId | Face to which the values are prolonged ([-x, x, -y, y] = [0, 1, 2, 3]) |
| [in] | polyDeg | Polynomial degree inside the element. |
| [out] | destination | Pointer to memory where the extrapolated values should be stored. |
Definition at line 640 of file dgcartesianinterpolation.h.
|
inline |
| [in] | path | Absolute path to .csv-file |
| [out] | data | Read data |
Definition at line 127 of file sbpcartesianinterpolation.h.
|
inline |
| [out] | nodesVector | Nodal distribution from file |
| [out] | wIntVector | Integration matrix (1D diagonal) |
| [out] | dHatMatrix | DDRP operator (already scaled by wInt) |
Definition at line 207 of file sbpcartesianinterpolation.h.
|
inline |
| [in] | noNodes1D | Number of nodes |
| [in] | opName | Name of the SBP operator |
| [out] | sbpA | Coefficients for the inner stencil |
| [out] | sbpP | Coefficients for the integration matrix |
| [out] | sbpQ | Coefficients for the boundary solver |
Definition at line 326 of file sbpcartesianinterpolation.h.