49 namespace LibUtilities
107 for (
int j = 0; j < cols; ++j)
110 for (
int i = 0; i < rows; ++i)
112 (*matV)(i, j) = col[i];
140 for (
int j = 0; j < cols; ++j)
143 for (
int i = 0; i < rows; ++i)
145 (*matV)(i, j) = col[i];
172 V->GetRows(), V->GetColumns(), 0.0);
208 matT->GetRows(), matS->GetColumns(), 0.0);
212 *D = (*matT) * (*matS);
252 for (
int j = 0; j <=
m_degree - i; ++j)
304 2.0 *
modes.first + 1.0, 0.0);
311 ret[i] = sqrt2 * jacobi_i[i] * jacobi_j[i] *
333 const int dir,
const int mode)
347 2.0*
modes.first + 1.0, 0.0);
352 2.0*
modes.first + 1.0, 0.0);
362 ret[i] = 2.0 * sqrt2 * jacobi_di[i] * jacobi_j[i];
365 ret[i] *= pow(1.0 -
m_eta[1][i],
modes.first - 1.0);
374 ret[i] = (1 +
m_eta[0][i]) * sqrt2 * jacobi_di[i] * jacobi_j[i];
377 ret[i] *= pow(1.0 -
m_eta[1][i],
modes.first - 1.0);
383 tmp -=
modes.first * jacobi_j[i] *
387 ret[i] += sqrt2 * jacobi_i[i] * tmp;
432 for (
int j = 0; j <=
m_degree - i; ++j)
434 for (
int k = 0; k <=
m_degree - i - j; ++k)
472 m_eta[1][i] = 2.0 * (1.0 +
m_xi[1][i]) / (1.0 -
m_xi[2][i]) - 1.0;
515 ret[i] = sqrt8 * jacA[i] * jacB[i] * jacC[i] *
516 pow(1.0 -
m_eta[1][i], I) * pow(1.0 -
m_eta[2][i], I + J);
537 const int dir,
const int mode)
568 ret[i] = 4.0 * sqrt8 * jacDerivA[i] * jacB[i] * jacC[i];
572 ret[i] *= pow(1 -
m_eta[1][i], I - 1);
577 ret[i] *= pow(1 -
m_eta[2][i], I + J - 1);
588 ret[i] *= 0.5 * (
m_eta[0][i] + 1.0);
590 tmp[i] = 2.0 * sqrt8 * jacA[i] * jacC[i];
593 tmp[i] *= pow(1.0 -
m_eta[2][i], I + J - 1);
599 tmp2 -= I * jacB[i] * pow(1.0 -
m_eta[1][i], I - 1);
613 ret[i] += 0.5 * (1.0 +
m_eta[1][i]) * tmp[i];
618 tmp2 -= jacC[i] * (I + J) * pow(1.0 -
m_eta[2][i], I + J - 1);
621 ret[i] += sqrt8 * jacA[i] * jacB[i] * pow(1.0 -
m_eta[1][i], I) *
669 for (
int k = 0; k <=
m_degree - i; ++k)
694 m_eta[0][i] = 2.0*(1.0 +
m_xi[0][i])/(1.0 -
m_xi[2][i]) - 1.0;
738 ret[i] = sqrt2 * jacA[i] * jacB[i] * jacC[i] *
739 pow(1.0 -
m_eta[2][i], I);
760 const int dir,
const int mode)
791 ret[i] = sqrt2 * jacA[i] * jacDerivB[i] * jacC[i] *
792 pow(1.0 -
m_eta[2][i], I);
799 ret[i] = 2.0 * sqrt2 * jacDerivA[i] * jacB[i] * jacC[i];
803 ret[i] *= pow(1.0 -
m_eta[2][i], I - 1);
814 ret[i] *= 0.5 * (1.0 +
m_eta[0][i]);
820 tmp -= jacC[i] * I * pow(1.0 -
m_eta[2][i], I - 1);
823 ret[i] += sqrt2 * jacA[i] * jacB[i] * tmp;
891 ret[i] = jacobi_i[i] * jacobi_j[i];
904 const int dir,
const int mode)
928 ret[i] = jacobi_di[i] * jacobi_j[i];
935 ret[i] = jacobi_i[i] * jacobi_dj[i];
1013 ret[i] = jacobi_i[i] * jacobi_j[i] * jacobi_k[i];
1020 const int dir,
const int mode)
1052 ret[i] = jacobi_di[i] * jacobi_j[i] * jacobi_k[i];
1059 ret[i] = jacobi_dj[i] * jacobi_i[i] * jacobi_k[i];
1066 ret[i] = jacobi_i[i] * jacobi_j[i] * jacobi_dk[i];
virtual NekVector< NekDouble > v_OrthoBasisDeriv(const int dir, const int mode)
Return the values of the derivative of the orthogonal basis at the nodal points for a given mode.
NodalUtilHex(int degree, Array< OneD, NekDouble > r, Array< OneD, NekDouble > s, Array< OneD, NekDouble > t)
Construct the nodal utility class for a hexahedron.
std::vector< Mode > m_ordering
Mapping from the indexing of the basis to a continuous ordering.
virtual NekVector< NekDouble > v_OrthoBasis(const int mode)
Return the value of the modal functions for the hex element at the nodal points m_xi for a given mode...
std::tuple< int, int, int > Mode
A class to assist in the construction of nodal simplex and hybrid elements in two and three dimension...
int m_degree
Degree of the nodal element.
int m_numPoints
Total number of nodal points.
Array< OneD, Array< OneD, NekDouble > > m_xi
Coordinates of the nodal points defining the basis.
NekVector< NekDouble > GetWeights()
Obtain the integration weights for the given nodal distribution.
SharedMatrix GetVandermonde()
Return the Vandermonde matrix for the nodal distribution.
SharedMatrix GetVandermondeForDeriv(int dir)
Return the Vandermonde matrix of the derivative of the basis functions for the nodal distribution.
virtual std::shared_ptr< NodalUtil > v_CreateUtil(Array< OneD, Array< OneD, NekDouble > > &xi)=0
Construct a NodalUtil object of the appropriate element type for a given set of points.
virtual int v_NumModes()=0
Calculate the number of degrees of freedom for this element.
SharedMatrix GetDerivMatrix(int dir)
Return the derivative matrix for the nodal distribution.
virtual NekDouble v_ModeZeroIntegral()=0
Return the value of the integral of the zero-th mode for this element.
virtual NekVector< NekDouble > v_OrthoBasisDeriv(const int dir, const int mode)=0
Return the values of the derivative of the orthogonal basis at the nodal points for a given mode.
SharedMatrix GetInterpolationMatrix(Array< OneD, Array< OneD, NekDouble > > &xi)
Construct the interpolation matrix used to evaluate the basis at the points xi inside the element.
virtual NekVector< NekDouble > v_OrthoBasis(const int mode)=0
Return the values of the orthogonal basis at the nodal points for a given mode.
NodalUtilPrism(int degree, Array< OneD, NekDouble > r, Array< OneD, NekDouble > s, Array< OneD, NekDouble > t)
Construct the nodal utility class for a prism.
virtual NekVector< NekDouble > v_OrthoBasisDeriv(const int dir, const int mode)
Return the value of the derivative of the modal functions for the prismatic element at the nodal poin...
Array< OneD, Array< OneD, NekDouble > > m_eta
Collapsed coordinates of the nodal points.
virtual NekVector< NekDouble > v_OrthoBasis(const int mode)
Return the value of the modal functions for the prismatic element at the nodal points m_xi for a give...
std::vector< Mode > m_ordering
Mapping from the indexing of the basis to a continuous ordering.
std::tuple< int, int, int > Mode
NodalUtilQuad(int degree, Array< OneD, NekDouble > r, Array< OneD, NekDouble > s)
Construct the nodal utility class for a quadrilateral.
virtual NekVector< NekDouble > v_OrthoBasis(const int mode)
Return the value of the modal functions for the quad element at the nodal points m_xi for a given mod...
virtual NekVector< NekDouble > v_OrthoBasisDeriv(const int dir, const int mode)
Return the value of the derivative of the modal functions for the quadrilateral element at the nodal ...
std::vector< std::pair< int, int > > m_ordering
Mapping from the indexing of the basis to a continuous ordering.
std::tuple< int, int, int > Mode
Array< OneD, Array< OneD, NekDouble > > m_eta
Collapsed coordinates of the nodal points.
NodalUtilTetrahedron(int degree, Array< OneD, NekDouble > r, Array< OneD, NekDouble > s, Array< OneD, NekDouble > t)
Construct the nodal utility class for a tetrahedron.
virtual NekVector< NekDouble > v_OrthoBasis(const int mode)
Return the value of the modal functions for the tetrahedral element at the nodal points m_xi for a gi...
std::vector< Mode > m_ordering
Mapping from the indexing of the basis to a continuous ordering.
virtual NekVector< NekDouble > v_OrthoBasisDeriv(const int dir, const int mode)
Return the value of the derivative of the modal functions for the tetrahedral element at the nodal po...
NodalUtilTriangle(int degree, Array< OneD, NekDouble > r, Array< OneD, NekDouble > s)
Construct the nodal utility class for a triangle.
virtual NekVector< NekDouble > v_OrthoBasisDeriv(const int dir, const int mode)
Return the value of the derivative of the modal functions for the triangular element at the nodal poi...
std::vector< std::pair< int, int > > m_ordering
Mapping from the indexing of the basis to a continuous ordering.
virtual NekVector< NekDouble > v_OrthoBasis(const int mode)
Return the value of the modal functions for the triangular element at the nodal points m_xi for a giv...
Array< OneD, Array< OneD, NekDouble > > m_eta
Collapsed coordinates of the nodal points.
RawType_t< VectorType > SolveTranspose(const VectorType &b)
General purpose memory allocation routines with the ability to allocate from thread specific memory p...
std::shared_ptr< NekMatrix< NekDouble > > SharedMatrix
static const NekDouble kNekZeroTol
The above copyright notice and this permission notice shall be included.
void jacobd(const int np, const double *z, double *polyd, const int n, const double alpha, const double beta)
Calculate the derivative of Jacobi polynomials.
void jacobfd(const int np, const double *z, double *poly_in, double *polyd, const int n, const double alpha, const double beta)
Routine to calculate Jacobi polynomials, , and their first derivative, .
scalarT< T > sqrt(scalarT< T > in)