1 #ifndef INTREPID_HGRAD_TRI_CN_FEMDEF_HPP 2 #define INTREPID_HGRAD_TRI_CN_FEMDEF_HPP 53 template<
class Scalar,
class ArrayScalar>
57 V((n+1)*(n+2)/2,(n+1)*(n+2)/2),
58 Vinv((n+1)*(n+2)/2,(n+1)*(n+2)/2),
59 latticePts( (n+1)*(n+2)/2 , 2 )
61 const int N = (n+1)*(n+2)/2;
64 this ->
basisCellTopology_ = shards::CellTopology(shards::getCellTopologyData<shards::Triangle<3> >() );
71 shards::CellTopology myTri_3( shards::getCellTopologyData< shards::Triangle<3> >() );
72 PointTools::getLattice<Scalar,FieldContainer<Scalar> >(
latticePts ,
82 Phis.getValues(
V , latticePts , OPERATOR_VALUE );
85 Teuchos::SerialDenseMatrix<int,Scalar> Vsdm(N,N);
86 for (
int i=0;i<N;i++) {
87 for (
int j=0;j<N;j++) {
93 Teuchos::SerialDenseSolver<int,Scalar> solver;
94 solver.setMatrix( rcp( &Vsdm ,
false ) );
98 for (
int i=0;i<N;i++) {
99 for (
int j=0;j<N;j++) {
100 Vinv(i,j) = Vsdm(j,i);
107 template<
class Scalar,
class ArrayScalar>
125 tag_cur[0] = 0; tag_cur[1] = 0; tag_cur[2] = 0; tag_cur[3] = 1;
129 for (
int i=1;i<degree;i++) {
130 tag_cur[0] = 1; tag_cur[1] = 0; tag_cur[2] = i-1; tag_cur[3] = degree-1;
135 tag_cur[0] = 0; tag_cur[1] = 1; tag_cur[2] = 0; tag_cur[3] = 1;
144 int internal_dof_cur = 0;
147 for (
int i=1;i<degree;i++) {
149 tag_cur[0] = 1; tag_cur[1] = 2; tag_cur[2] = i-1; tag_cur[3] = degree-1;
153 for (
int j=1;j<degree-i;j++) {
154 tag_cur[0] = 2; tag_cur[1] = 0; tag_cur[2] = internal_dof_cur; tag_cur[3] = num_internal_dof;
160 tag_cur[0] = 1; tag_cur[1] = 1; tag_cur[2] = i-1; tag_cur[3] = degree-1;
167 tag_cur[0] = 0; tag_cur[1] = 2; tag_cur[2] = 0; tag_cur[3] = 1;
186 template<
class Scalar,
class ArrayScalar>
188 const ArrayScalar & inputPoints,
192 #ifdef HAVE_INTREPID_DEBUG 193 Intrepid::getValues_HGRAD_Args<Scalar, ArrayScalar>(outputValues,
199 const int numPts = inputPoints.dimension(0);
203 switch (operatorType) {
207 Phis.getValues( phisCur , inputPoints , operatorType );
208 for (
int i=0;i<outputValues.dimension(0);i++) {
209 for (
int j=0;j<outputValues.dimension(1);j++) {
210 outputValues(i,j) = 0.0;
212 outputValues(i,j) += this->
Vinv(k,i) * phisCur(k,j);
234 Phis.getValues( phisCur , inputPoints , operatorType );
236 for (
int i=0;i<outputValues.dimension(0);i++) {
237 for (
int j=0;j<outputValues.dimension(1);j++) {
238 for (
int k=0;k<outputValues.dimension(2);k++) {
239 outputValues(i,j,k) = 0.0;
241 outputValues(i,j,k) += this->
Vinv(l,i) * phisCur(l,j,k);
251 Phis.getValues( phisCur , inputPoints , OPERATOR_D1 );
253 for (
int i=0;i<outputValues.dimension(0);i++) {
254 for (
int j=0;j<outputValues.dimension(1);j++) {
255 outputValues(i,j,0) = 0.0;
256 outputValues(i,j,1) = 0.0;
258 outputValues(i,j,0) = this->
Vinv(k,i) * phisCur(k,j,1);
261 outputValues(i,j,1) -= this->
Vinv(k,i) * phisCur(k,j,0);
268 TEUCHOS_TEST_FOR_EXCEPTION(
true , std::invalid_argument,
269 ">>> ERROR (Basis_HGRAD_TRI_Cn_FEM): Operator type not implemented");
273 catch (std::invalid_argument &exception){
274 TEUCHOS_TEST_FOR_EXCEPTION(
true , std::invalid_argument,
275 ">>> ERROR (Basis_HGRAD_TRI_Cn_FEM): Operator type not implemented");
282 template<
class Scalar,
class ArrayScalar>
284 const ArrayScalar & inputPoints,
285 const ArrayScalar & cellVertices,
287 TEUCHOS_TEST_FOR_EXCEPTION( (
true), std::logic_error,
288 ">>> ERROR (Basis_HGRAD_TRI_Cn_FEM): FEM Basis calling an FVD member function");
virtual int getCardinality() const
Returns cardinality of the basis.
FieldContainer< Scalar > latticePts
stores the points at which degrees of freedom are located.
EBasis basisType_
Type of the basis.
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.
Basis_HGRAD_TRI_Cn_FEM(const int n, const EPointType pointType)
Constructor.
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 > V
The Vandermonde matrix with V_{ij} = phi_i(x_j), where x_j is the j_th point in the lattice...
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.
void getValues(ArrayScalar &outputValues, const ArrayScalar &inputPoints, const EOperator operatorType) const
Evaluation of a FEM basis on a reference Triangle cell.
EPointType
Enumeration of types of point distributions in Intrepid.
virtual const shards::CellTopology getBaseCellTopology() const
Returns the base cell topology for which the basis is defined. See Shards documentation http://trilin...
virtual void initializeTags()
Initializes tagToOrdinal_ and ordinalToTag_ lookup arrays.
Basis_HGRAD_TRI_Cn_FEM_ORTH< Scalar, FieldContainer< Scalar > > Phis
The orthogonal basis on triangles, out of which the nodal basis is constructed.
int basisDegree_
Degree of the largest complete polynomial space that can be represented by the basis.
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.