1 #ifndef INTREPID_HGRAD_TET_CN_FEMDEF_HPP 2 #define INTREPID_HGRAD_TET_CN_FEMDEF_HPP 53 template<
class Scalar,
class ArrayScalar>
57 V((n+1)*(n+2)*(n+3)/6,(n+1)*(n+2)*(n+3)/6),
58 Vinv((n+1)*(n+2)*(n+3)/6,(n+1)*(n+2)*(n+3)/6),
59 latticePts( (n+1)*(n+2)*(n+3)/6 , 3 )
61 const int N = (n+1)*(n+2)*(n+3)/6;
64 this ->
basisCellTopology_ = shards::CellTopology(shards::getCellTopologyData<shards::Tetrahedron<4> >() );
71 PointTools::getLattice<Scalar,FieldContainer<Scalar> >(
latticePts ,
81 Phis.getValues(
V , latticePts , OPERATOR_VALUE );
84 Teuchos::SerialDenseMatrix<int,Scalar> Vsdm(N,N);
85 for (
int i=0;i<N;i++) {
86 for (
int j=0;j<N;j++) {
92 Teuchos::SerialDenseSolver<int,Scalar> solver;
93 solver.setMatrix( rcp( &Vsdm ,
false ) );
97 for (
int i=0;i<N;i++) {
98 for (
int j=0;j<N;j++) {
99 Vinv(i,j) = Vsdm(j,i);
106 template<
class Scalar,
class ArrayScalar>
120 const int numEdgeDof = degree - 1;
121 const int numFaceDof =
PointTools::getLatticeSize( shards::CellTopology( shards::getCellTopologyData<shards::Triangle<3> >() ) ,
127 int edge_dof_cur[] = {0,0,0,0,0,0};
128 int face_dof_cur[] = {0,0,0,0};
129 int cell_dof_cur = 0;
134 tag_cur[0] = 0; tag_cur[1] = 0; tag_cur[2] = 0; tag_cur[3] = 1;
139 for (
int i=1;i<degree;i++) {
140 tag_cur[0] = 1; tag_cur[1] = 0; tag_cur[2] = edge_dof_cur[0]; tag_cur[3] = numEdgeDof;
147 tag_cur[0] = 0; tag_cur[1] = 1; tag_cur[2] = 0; tag_cur[3] = 1;
152 for (
int i=1;i<degree;i++) {
154 tag_cur[0] = 1; tag_cur[1] = 2; tag_cur[2] = edge_dof_cur[2]; tag_cur[3] = numEdgeDof;
160 for (
int j=1;j<degree-i;j++) {
161 tag_cur[0] = 2; tag_cur[1] = 3; tag_cur[2] = face_dof_cur[3]; tag_cur[3] = numFaceDof;
168 tag_cur[0] = 1; tag_cur[1] = 1; tag_cur[2] = edge_dof_cur[1]; tag_cur[3] = numEdgeDof;
176 tag_cur[0] = 0; tag_cur[1] = 2; tag_cur[2] = 0; tag_cur[3] = 1;
183 for (
int i=1;i<degree;i++) {
186 tag_cur[0] = 1; tag_cur[1] = 3; tag_cur[2] = edge_dof_cur[3]; tag_cur[3] = numEdgeDof;
191 for (
int j=1;j<degree-i;j++) {
192 tag_cur[0] = 2; tag_cur[1] = 0; tag_cur[2] = face_dof_cur[0]; tag_cur[3] = numFaceDof;
198 tag_cur[0] = 1; tag_cur[1] = 4; tag_cur[2] = edge_dof_cur[4]; tag_cur[3] = numEdgeDof;
205 for (
int j=1;j<degree-i;j++) {
207 tag_cur[0] = 2; tag_cur[1] = 2; tag_cur[2] = face_dof_cur[2]; tag_cur[3] = numFaceDof;
212 for (
int k=1;k<degree-i-j;k++) {
213 tag_cur[0] = 3; tag_cur[1] = 0; tag_cur[2] = cell_dof_cur; tag_cur[3] = numCellDof;
219 tag_cur[0] = 2; tag_cur[1] = 1; tag_cur[2] = face_dof_cur[1]; tag_cur[3] = numFaceDof;
226 tag_cur[0] = 1; tag_cur[1] = 5; tag_cur[2] = edge_dof_cur[5]; tag_cur[3] = numEdgeDof;
234 tag_cur[0] = 0; tag_cur[1] = 3; tag_cur[2] = 0; tag_cur[3] = 1;
256 template<
class Scalar,
class ArrayScalar>
258 const ArrayScalar & inputPoints,
262 #ifdef HAVE_INTREPID_DEBUG 263 Intrepid::getValues_HGRAD_Args<Scalar, ArrayScalar>(outputValues,
269 const int numPts = inputPoints.dimension(0);
273 switch (operatorType) {
277 Phis.getValues( phisCur , inputPoints , operatorType );
278 for (
int i=0;i<outputValues.dimension(0);i++) {
279 for (
int j=0;j<outputValues.dimension(1);j++) {
280 outputValues(i,j) = 0.0;
282 outputValues(i,j) += this->
Vinv(k,i) * phisCur(k,j);
304 Phis.getValues( phisCur , inputPoints , operatorType );
306 for (
int i=0;i<outputValues.dimension(0);i++) {
307 for (
int j=0;j<outputValues.dimension(1);j++) {
308 for (
int k=0;k<outputValues.dimension(2);k++) {
309 outputValues(i,j,k) = 0.0;
311 outputValues(i,j,k) += this->
Vinv(l,i) * phisCur(l,j,k);
320 TEUCHOS_TEST_FOR_EXCEPTION(
true , std::invalid_argument,
321 ">>> ERROR (Basis_HGRAD_TET_Cn_FEM): Operator type not implemented");
325 catch (std::invalid_argument &exception){
326 TEUCHOS_TEST_FOR_EXCEPTION(
true , std::invalid_argument,
327 ">>> ERROR (Basis_HGRAD_TET_Cn_FEM): Operator type not implemented");
334 template<
class Scalar,
class ArrayScalar>
336 const ArrayScalar & inputPoints,
337 const ArrayScalar & cellVertices,
339 TEUCHOS_TEST_FOR_EXCEPTION( (
true), std::logic_error,
340 ">>> ERROR (Basis_HGRAD_TET_Cn_FEM): FEM Basis calling an FVD member function");
virtual int getCardinality() const
Returns cardinality of the basis.
Basis_HGRAD_TET_Cn_FEM_ORTH< Scalar, FieldContainer< Scalar > > Phis
The orthogonal basis on triangles, out of which the nodal basis is constructed.
EBasis basisType_
Type of the basis.
Basis_HGRAD_TET_Cn_FEM(const int n, const EPointType pointType)
Constructor.
void setOrdinalTagData(std::vector< std::vector< std::vector< int > > > &tagToOrdinal, std::vector< std::vector< int > > &ordinalToTag, const int *tags, const int basisCard, const int tagSize, const int posScDim, const int posScOrd, const int posDfOrd)
Fills ordinalToTag_ and tagToOrdinal_ by basis-specific tag data.
bool basisTagsAreSet_
"true" if tagToOrdinal_ and ordinalToTag_ have been initialized
EOperator
Enumeration of primitive operators available in Intrepid. Primitive operators act on reconstructed fu...
ECoordinates basisCoordinates_
The coordinate system for which the basis is defined.
FieldContainer< Scalar > Vinv
The inverse of V. The columns of Vinv express the Lagrange basis in terms of the orthogonal basis...
shards::CellTopology basisCellTopology_
Base topology of the cells for which the basis is defined. See the Shards package http://trilinos...
int getDkCardinality(const EOperator operatorType, const int spaceDim)
Returns cardinality of Dk, i.e., the number of all derivatives of order k.
virtual int getDegree() const
Returns the degree of the basis.
EPointType
Enumeration of types of point distributions in Intrepid.
FieldContainer< Scalar > latticePts
stores the points at which degrees of freedom are located.
virtual void initializeTags()
Initializes tagToOrdinal_ and ordinalToTag_ lookup arrays.
virtual const shards::CellTopology getBaseCellTopology() const
Returns the base cell topology for which the basis is defined. See Shards documentation http://trilin...
void getValues(ArrayScalar &outputValues, const ArrayScalar &inputPoints, const EOperator operatorType) const
Evaluation of a FEM basis on a reference Triangle cell.
int basisDegree_
Degree of the largest complete polynomial space that can be represented by the basis.
FieldContainer< Scalar > V
The Vandermonde matrix with V_{ij} = phi_i(x_j), where x_j is the j_th point in the lattice...
std::vector< std::vector< std::vector< int > > > tagToOrdinal_
DoF tag to ordinal lookup table.
int basisCardinality_
Cardinality of the basis, i.e., the number of basis functions/degrees-of-freedom. ...
std::vector< std::vector< int > > ordinalToTag_
DoF ordinal to tag lookup table.