103 for (
size_t j = 0; j < cols; ++j)
106 for (
size_t i = 0; i < rows; ++i)
108 (*matV)(i, j) = col[i];
136 for (
size_t j = 0; j < cols; ++j)
139 for (
size_t i = 0; i < rows; ++i)
141 (*matV)(i, j) = col[i];
168 V->GetRows(), V->GetColumns(), 0.0);
204 matT->GetRows(), matS->GetColumns(), 0.0);
208 *D = (*matT) * (*matS);
245 for (
size_t i = 0; i <=
m_degree; ++i)
247 for (
size_t j = 0; j <=
m_degree - i; ++j)
296 modes.first, 0.0, 0.0);
305 ret[i] = sqrt2 * jacobi_i[i] * jacobi_j[i] *
337 modes.first, 0.0, 0.0);
343 2.0 *
modes.first + 1.0, 0.0);
353 ret[i] = 2.0 * sqrt2 * jacobi_di[i] * jacobi_j[i];
356 ret[i] *= pow(1.0 -
m_eta[1][i],
modes.first - 1.0);
365 ret[i] = (1 +
m_eta[0][i]) * sqrt2 * jacobi_di[i] * jacobi_j[i];
368 ret[i] *= pow(1.0 -
m_eta[1][i],
modes.first - 1.0);
374 tmp -=
modes.first * jacobi_j[i] *
378 ret[i] += sqrt2 * jacobi_i[i] * tmp;
421 for (
size_t i = 0; i <=
m_degree; ++i)
423 for (
size_t j = 0; j <=
m_degree - i; ++j)
425 for (
size_t k = 0; k <=
m_degree - i - j; ++k)
461 2.0 * (1.0 +
m_xi[0][i]) / (-
m_xi[1][i] -
m_xi[2][i]) - 1.0;
463 m_eta[1][i] = 2.0 * (1.0 +
m_xi[1][i]) / (1.0 -
m_xi[2][i]) - 1.0;
498 2.0 * (I + J) + 2.0, 0.0);
505 ret[i] = sqrt8 * jacA[i] * jacB[i] * jacC[i] *
506 pow(1.0 -
m_eta[1][i], I) * pow(1.0 -
m_eta[2][i], I + J);
542 2.0 * (I + J) + 2.0, 0.0);
547 2.0 * (I + J) + 2.0, 0.0);
556 ret[i] = 4.0 * sqrt8 * jacDerivA[i] * jacB[i] * jacC[i];
560 ret[i] *= pow(1 -
m_eta[1][i], I - 1);
565 ret[i] *= pow(1 -
m_eta[2][i], I + J - 1);
576 ret[i] *= 0.5 * (
m_eta[0][i] + 1.0);
578 tmp[i] = 2.0 * sqrt8 * jacA[i] * jacC[i];
581 tmp[i] *= pow(1.0 -
m_eta[2][i], I + J - 1);
587 tmp2 -= I * jacB[i] * pow(1.0 -
m_eta[1][i], I - 1);
601 ret[i] += 0.5 * (1.0 +
m_eta[1][i]) * tmp[i];
606 tmp2 -= jacC[i] * (I + J) * pow(1.0 -
m_eta[2][i], I + J - 1);
610 sqrt8 * jacA[i] * jacB[i] * pow(1.0 -
m_eta[1][i], I) * tmp2;
652 for (
size_t i = 0; i <=
m_degree; ++i)
654 for (
size_t j = 0; j <=
m_degree; ++j)
656 for (
size_t k = 0; k <=
m_degree - i; ++k)
681 m_eta[0][i] = 2.0 * (1.0 +
m_xi[0][i]) / (1.0 -
m_xi[2][i]) - 1.0;
724 sqrt2 * jacA[i] * jacB[i] * jacC[i] * pow(1.0 -
m_eta[2][i], I);
772 ret[i] = sqrt2 * jacA[i] * jacDerivB[i] * jacC[i] *
773 pow(1.0 -
m_eta[2][i], I);
780 ret[i] = 2.0 * sqrt2 * jacDerivA[i] * jacB[i] * jacC[i];
784 ret[i] *= pow(1.0 -
m_eta[2][i], I - 1);
795 ret[i] *= 0.5 * (1.0 +
m_eta[0][i]);
801 tmp -= jacC[i] * I * pow(1.0 -
m_eta[2][i], I - 1);
804 ret[i] += sqrt2 * jacA[i] * jacB[i] * tmp;
834 for (
size_t j = 0; j <=
m_degree; ++j)
836 for (
size_t i = 0; i <=
m_degree; ++i)
863 modes.first, 0.0, 0.0);
865 modes.second, 0.0, 0.0);
871 ret[i] = jacobi_i[i] * jacobi_j[i];
894 modes.first, 0.0, 0.0);
896 modes.second, 0.0, 0.0);
908 ret[i] = jacobi_di[i] * jacobi_j[i];
915 ret[i] = jacobi_i[i] * jacobi_dj[i];
946 for (
size_t k = 0; k <=
m_degree; ++k)
948 for (
size_t j = 0; j <=
m_degree; ++j)
950 for (
size_t i = 0; i <=
m_degree; ++i)
990 ret[i] = jacobi_i[i] * jacobi_j[i] * jacobi_k[i];
1026 ret[i] = jacobi_di[i] * jacobi_j[i] * jacobi_k[i];
1033 ret[i] = jacobi_dj[i] * jacobi_i[i] * jacobi_k[i];
1040 ret[i] = jacobi_i[i] * jacobi_j[i] * jacobi_dk[i];
NekVector< NekDouble > v_OrthoBasis(const size_t mode) override
Return the value of the modal functions for the hex element at the nodal points m_xi for a given mode...
NodalUtilHex(size_t degree, Array< OneD, NekDouble > r, Array< OneD, NekDouble > s, Array< OneD, NekDouble > t)
Construct the nodal utility class for a hexahedron.
NekVector< NekDouble > v_OrthoBasisDeriv(const size_t dir, const size_t mode) override
Return the values of the derivative of the orthogonal basis at the nodal points for a given mode.
std::vector< Mode > m_ordering
Mapping from the indexing of the basis to a continuous ordering.
std::tuple< int, int, int > Mode
A class to assist in the construction of nodal simplex and hybrid elements in two and three dimension...
SharedMatrix GetDerivMatrix(size_t dir)
Return the derivative matrix 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.
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.
virtual NekVector< NekDouble > v_OrthoBasisDeriv(const size_t dir, const size_t mode)=0
Return the values of the derivative of the orthogonal basis at the nodal points for a given mode.
size_t m_degree
Degree of the nodal element.
size_t m_numPoints
Total number of nodal points.
SharedMatrix GetVandermondeForDeriv(size_t dir)
Return the Vandermonde matrix of the derivative of the basis functions 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_OrthoBasis(const size_t mode)=0
Return the values of the orthogonal basis at the nodal points for a given mode.
virtual size_t v_NumModes()=0
Calculate the number of degrees of freedom for this element.
SharedMatrix GetInterpolationMatrix(Array< OneD, Array< OneD, NekDouble > > &xi)
Construct the interpolation matrix used to evaluate the basis at the points xi inside the element.
NekVector< NekDouble > v_OrthoBasisDeriv(const size_t dir, const size_t mode) override
Return the value of the derivative of the modal functions for the prismatic element at the nodal poin...
NodalUtilPrism(size_t degree, Array< OneD, NekDouble > r, Array< OneD, NekDouble > s, Array< OneD, NekDouble > t)
Construct the nodal utility class for a prism.
Array< OneD, Array< OneD, NekDouble > > m_eta
Collapsed coordinates of the nodal points.
std::vector< Mode > m_ordering
Mapping from the indexing of the basis to a continuous ordering.
NekVector< NekDouble > v_OrthoBasis(const size_t mode) override
Return the value of the modal functions for the prismatic element at the nodal points m_xi for a give...
std::tuple< int, int, int > Mode
NodalUtilQuad(size_t degree, Array< OneD, NekDouble > r, Array< OneD, NekDouble > s)
Construct the nodal utility class for a quadrilateral.
std::vector< std::pair< int, int > > m_ordering
Mapping from the indexing of the basis to a continuous ordering.
NekVector< NekDouble > v_OrthoBasis(const size_t mode) override
Return the value of the modal functions for the quad element at the nodal points m_xi for a given mod...
NekVector< NekDouble > v_OrthoBasisDeriv(const size_t dir, const size_t mode) override
Return the value of the derivative of the modal functions for the quadrilateral element at the nodal ...
std::tuple< int, int, int > Mode
NekVector< NekDouble > v_OrthoBasis(const size_t mode) override
Return the value of the modal functions for the tetrahedral element at the nodal points m_xi for a gi...
Array< OneD, Array< OneD, NekDouble > > m_eta
Collapsed coordinates of the nodal points.
NekVector< NekDouble > v_OrthoBasisDeriv(const size_t dir, const size_t mode) override
Return the value of the derivative of the modal functions for the tetrahedral element at the nodal po...
NodalUtilTetrahedron(size_t degree, Array< OneD, NekDouble > r, Array< OneD, NekDouble > s, Array< OneD, NekDouble > t)
Construct the nodal utility class for a tetrahedron.
std::vector< Mode > m_ordering
Mapping from the indexing of the basis to a continuous ordering.
NekVector< NekDouble > v_OrthoBasisDeriv(const size_t dir, const size_t mode) override
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.
NodalUtilTriangle(size_t degree, Array< OneD, NekDouble > r, Array< OneD, NekDouble > s)
Construct the nodal utility class for a triangle.
Array< OneD, Array< OneD, NekDouble > > m_eta
Collapsed coordinates of the nodal points.
NekVector< NekDouble > v_OrthoBasis(const size_t mode) override
Return the value of the modal functions for the triangular element at the nodal points m_xi for a giv...
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
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)