50 namespace LibUtilities
108 for (
int j = 0; j < cols; ++j)
111 for (
int i = 0; i < rows; ++i)
113 (*matV)(i, j) = col[i];
141 for (
int j = 0; j < cols; ++j)
144 for (
int i = 0; i < rows; ++i)
146 (*matV)(i, j) = col[i];
173 V->GetRows(), V->GetColumns(), 0.0);
205 boost::shared_ptr<NodalUtil> subUtil =
v_CreateUtil(xi);
209 matT->GetRows(), matS->GetColumns(), 0.0);
213 *D = (*matT) * (*matS);
253 for (
int j = 0; j <=
m_degree - i; ++j)
272 m_eta[0][i] = 2*(1+
m_xi[0][i])/(1-
m_xi[1][i])-1.0;
273 m_eta[1][i] =
m_xi[1][i];
305 2.0 * modes.first + 1.0, 0.0);
312 ret[i] = sqrt2 * jacobi_i[i] * jacobi_j[i] *
313 pow(1.0 -
m_eta[1][i], modes.first);
334 const int dir,
const int mode)
348 2.0*modes.first + 1.0, 0.0);
353 2.0*modes.first + 1.0, 0.0);
363 ret[i] = 2.0 * sqrt2 * jacobi_di[i] * jacobi_j[i];
366 ret[i] *= pow(1.0 -
m_eta[1][i], modes.first - 1.0);
375 ret[i] = (1 +
m_eta[0][i]) * sqrt2 * jacobi_di[i] * jacobi_j[i];
378 ret[i] *= pow(1.0 -
m_eta[1][i], modes.first - 1.0);
381 NekDouble tmp = jacobi_dj[i] * pow(1.0 -
m_eta[1][i], modes.first);
384 tmp -= modes.first * jacobi_j[i] *
385 pow(1.0 -
m_eta[1][i], modes.first-1);
388 ret[i] += sqrt2 * jacobi_i[i] * tmp;
433 for (
int j = 0; j <=
m_degree - i; ++j)
435 for (
int k = 0; k <=
m_degree - i - j; ++k)
454 m_eta[2][i] =
m_xi[2][i];
470 m_eta[0][i] = 2.0 * (1.0 +
m_xi[0][i]) /
473 m_eta[1][i] = 2.0 * (1.0 +
m_xi[1][i]) / (1.0 -
m_xi[2][i]) - 1.0;
474 m_eta[2][i] =
m_xi[2][i];
501 const int I = modes.get<0>(), J = modes.get<1>(), K = modes.get<2>();
516 ret[i] = sqrt8 * jacA[i] * jacB[i] * jacC[i] *
517 pow(1.0 -
m_eta[1][i], I) * pow(1.0 -
m_eta[2][i], I + J);
538 const int dir,
const int mode)
546 const int I = modes.get<0>(), J = modes.get<1>(), K = modes.get<2>();
569 ret[i] = 4.0 * sqrt8 * jacDerivA[i] * jacB[i] * jacC[i];
573 ret[i] *= pow(1 -
m_eta[1][i], I - 1);
578 ret[i] *= pow(1 -
m_eta[2][i], I + J - 1);
589 ret[i] *= 0.5 * (
m_eta[0][i] + 1.0);
591 tmp[i] = 2.0 * sqrt8 * jacA[i] * jacC[i];
594 tmp[i] *= pow(1.0 -
m_eta[2][i], I + J - 1);
600 tmp2 -= I * jacB[i] * pow(1.0 -
m_eta[1][i], I - 1);
614 ret[i] += 0.5 * (1.0 +
m_eta[1][i]) * tmp[i];
619 tmp2 -= jacC[i] * (I + J) * pow(1.0 -
m_eta[2][i], I + J - 1);
622 ret[i] += sqrt8 * jacA[i] * jacB[i] * pow(1.0 -
m_eta[1][i], I) *
670 for (
int k = 0; k <=
m_degree - i; ++k)
688 m_eta[1][i] =
m_xi[1][i];
695 m_eta[0][i] = 2.0*(1.0 +
m_xi[0][i])/(1.0 -
m_xi[2][i]) - 1.0;
696 m_eta[1][i] =
m_xi[1][i];
697 m_eta[2][i] =
m_xi[2][i];
724 const int I = modes.get<0>(), J = modes.get<1>(), K = modes.get<2>();
739 ret[i] = sqrt2 * jacA[i] * jacB[i] * jacC[i] *
740 pow(1.0 -
m_eta[2][i], I);
761 const int dir,
const int mode)
769 const int I = modes.get<0>(), J = modes.get<1>(), K = modes.get<2>();
792 ret[i] = sqrt2 * jacA[i] * jacDerivB[i] * jacC[i] *
793 pow(1.0 -
m_eta[2][i], I);
800 ret[i] = 2.0 * sqrt2 * jacDerivA[i] * jacB[i] * jacC[i];
804 ret[i] *= pow(1.0 -
m_eta[2][i], I - 1);
815 ret[i] *= 0.5 * (1.0 +
m_eta[0][i]);
821 tmp -= jacC[i] * I * pow(1.0 -
m_eta[2][i], I - 1);
824 ret[i] += sqrt2 * jacA[i] * jacB[i] * tmp;
892 ret[i] = jacobi_i[i] * jacobi_j[i];
905 const int dir,
const int mode)
929 ret[i] = jacobi_di[i] * jacobi_j[i];
936 ret[i] = jacobi_i[i] * jacobi_dj[i];
1000 const int I = modes.get<0>(), J = modes.get<1>(), K = modes.get<2>();
1014 ret[i] = jacobi_i[i] * jacobi_j[i] * jacobi_k[i];
1021 const int dir,
const int mode)
1029 const int I = modes.get<0>(), J = modes.get<1>(), K = modes.get<2>();
1053 ret[i] = jacobi_di[i] * jacobi_j[i] * jacobi_k[i];
1060 ret[i] = jacobi_dj[i] * jacobi_i[i] * jacobi_k[i];
1067 ret[i] = jacobi_i[i] * jacobi_j[i] * jacobi_dk[i];
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...
A class to assist in the construction of nodal simplex and hybrid elements in two and three dimension...
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...
General purpose memory allocation routines with the ability to allocate from thread specific memory p...
boost::tuple< int, int, int > Mode
NodalUtilPrism(int 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.
Array< OneD, Array< OneD, NekDouble > > m_eta
Collapsed coordinates of the nodal points.
SharedMatrix GetVandermondeForDeriv(int dir)
Return the Vandermonde matrix of the derivative of the basis functions for the nodal distribution...
SharedMatrix GetInterpolationMatrix(Array< OneD, Array< OneD, NekDouble > > &xi)
Construct the interpolation matrix used to evaluate the basis at the points xi inside the element...
boost::tuple< int, int, int > Mode
std::vector< std::pair< int, int > > m_ordering
Mapping from the indexing of the basis to a continuous ordering.
int m_degree
Degree of the nodal element.
boost::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.
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.
SharedMatrix GetDerivMatrix(int dir)
Return the derivative matrix for the nodal distribution.
std::vector< Mode > m_ordering
Mapping from the indexing of the basis to a continuous ordering.
NekVector< NekDouble > GetWeights()
Obtain the integration weights for the given nodal distribution.
virtual boost::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 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 ...
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...
SharedMatrix GetVandermonde()
Return the Vandermonde matrix for the nodal distribution.
NodalUtilHex(int degree, Array< OneD, NekDouble > r, Array< OneD, NekDouble > s, Array< OneD, NekDouble > t)
Construct the nodal utility class for a hexahedron.
NodalUtilQuad(int degree, Array< OneD, NekDouble > r, Array< OneD, NekDouble > s)
Construct the nodal utility class for a quadrilateral.
Array< OneD, Array< OneD, NekDouble > > m_xi
Coordinates of the nodal points defining the basis.
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...
std::vector< Mode > m_ordering
Mapping from the indexing of the basis to a continuous ordering.
virtual NekVector< NekDouble > v_OrthoBasis(const int mode)=0
Return the values of the orthogonal basis at the nodal points for a given mode.
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...
int m_numPoints
Total number of nodal points.
NodalUtilTriangle(int degree, Array< OneD, NekDouble > r, Array< OneD, NekDouble > s)
Construct the nodal utility class for a triangle.
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...
boost::tuple< int, int, int > Mode
std::vector< std::pair< int, int > > m_ordering
Mapping from the indexing of the basis to a continuous ordering.
virtual int v_NumModes()=0
Calculate the number of degrees of freedom for this element.
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...
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...
RawType< VectorType >::type SolveTranspose(const VectorType &b)
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...
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, .
virtual NekDouble v_ModeZeroIntegral()=0
Return the value of the integral of the zero-th mode for this element.
NodalUtilTetrahedron(int degree, Array< OneD, NekDouble > r, Array< OneD, NekDouble > s, Array< OneD, NekDouble > t)
Construct the nodal utility class for a tetrahedron.