1 #ifndef INTREPID_HGRAD_TET_C1_FEMDEF_HPP
2 #define INTREPID_HGRAD_TET_C1_FEMDEF_HPP
53 template<
class Scalar,
class ArrayScalar>
56 this -> basisCardinality_ = 4;
57 this -> basisDegree_ = 1;
58 this -> basisCellTopology_ = shards::CellTopology(shards::getCellTopologyData<shards::Tetrahedron<4> >() );
59 this -> basisType_ = BASIS_FEM_DEFAULT;
60 this -> basisCoordinates_ = COORDINATES_CARTESIAN;
61 this -> basisTagsAreSet_ =
false;
65 template<
class Scalar,
class ArrayScalar>
75 int tags[] = { 0, 0, 0, 1,
81 Intrepid::setOrdinalTagData(
this -> tagToOrdinal_,
82 this -> ordinalToTag_,
84 this -> basisCardinality_,
93 template<
class Scalar,
class ArrayScalar>
95 const ArrayScalar & inputPoints,
96 const EOperator operatorType)
const {
99 #ifdef HAVE_INTREPID_DEBUG
100 Intrepid::getValues_HGRAD_Args<Scalar, ArrayScalar>(outputValues,
103 this -> getBaseCellTopology(),
104 this -> getCardinality() );
108 int dim0 = inputPoints.dimension(0);
115 switch (operatorType) {
118 for (
int i0 = 0; i0 < dim0; i0++) {
119 x = inputPoints(i0, 0);
120 y = inputPoints(i0, 1);
121 z = inputPoints(i0, 2);
124 outputValues(0, i0) = 1.0 - x - y -z;
125 outputValues(1, i0) = x;
126 outputValues(2, i0) = y;
127 outputValues(3, i0) = z;
133 for (
int i0 = 0; i0 < dim0; i0++) {
136 outputValues(0, i0, 0) = -1.0;
137 outputValues(0, i0, 1) = -1.0;
138 outputValues(0, i0, 2) = -1.0;
140 outputValues(1, i0, 0) = 1.0;
141 outputValues(1, i0, 1) = 0.0;
142 outputValues(1, i0, 2) = 0.0;
144 outputValues(2, i0, 0) = 0.0;
145 outputValues(2, i0, 1) = 1.0;
146 outputValues(2, i0, 2) = 0.0;
148 outputValues(3, i0, 0) = 0.0;
149 outputValues(3, i0, 1) = 0.0;
150 outputValues(3, i0, 2) = 1.0;
155 TEUCHOS_TEST_FOR_EXCEPTION( (operatorType == OPERATOR_CURL), std::invalid_argument,
156 ">>> ERROR (Basis_HGRAD_TET_C1_FEM): CURL is invalid operator for rank-0 (scalar) functions in 3D");
160 TEUCHOS_TEST_FOR_EXCEPTION( (operatorType == OPERATOR_DIV), std::invalid_argument,
161 ">>> ERROR (Basis_HGRAD_TET_C1_FEM): DIV is invalid operator for rank-0 (scalar) functions in 3D");
175 int DkCardinality = Intrepid::getDkCardinality(operatorType,
176 this -> basisCellTopology_.getDimension() );
177 for(
int dofOrd = 0; dofOrd <
this -> basisCardinality_; dofOrd++) {
178 for (
int i0 = 0; i0 < dim0; i0++) {
179 for(
int dkOrd = 0; dkOrd < DkCardinality; dkOrd++){
180 outputValues(dofOrd, i0, dkOrd) = 0.0;
187 TEUCHOS_TEST_FOR_EXCEPTION( !( Intrepid::isValidOperator(operatorType) ), std::invalid_argument,
188 ">>> ERROR (Basis_HGRAD_TET_C1_FEM): Invalid operator type");
194 template<
class Scalar,
class ArrayScalar>
196 const ArrayScalar & inputPoints,
197 const ArrayScalar & cellVertices,
198 const EOperator operatorType)
const {
199 TEUCHOS_TEST_FOR_EXCEPTION( (
true), std::logic_error,
200 ">>> ERROR (Basis_HGRAD_TET_C1_FEM): FEM Basis calling an FVD member function");
205 template<
class Scalar,
class ArrayScalar>
207 #ifdef HAVE_INTREPID_DEBUG
209 TEUCHOS_TEST_FOR_EXCEPTION( !(DofCoords.rank() == 2), std::invalid_argument,
210 ">>> ERROR: (Intrepid::Basis_HGRAD_TET_C1_FEM::getDofCoords) rank = 2 required for DofCoords array");
212 TEUCHOS_TEST_FOR_EXCEPTION( !( DofCoords.dimension(0) ==
this -> basisCardinality_ ), std::invalid_argument,
213 ">>> ERROR: (Intrepid::Basis_HGRAD_TET_C1_FEM::getDofCoords) mismatch in number of DoF and 0th dimension of DofCoords array");
215 TEUCHOS_TEST_FOR_EXCEPTION( !( DofCoords.dimension(1) == (int)(
this -> basisCellTopology_.getDimension()) ), std::invalid_argument,
216 ">>> ERROR: (Intrepid::Basis_HGRAD_TET_C1_FEM::getDofCoords) incorrect reference cell (1st) dimension in DofCoords array");
219 DofCoords(0,0) = 0.0; DofCoords(0,1) = 0.0; DofCoords(0,2) = 0.0;
220 DofCoords(1,0) = 1.0; DofCoords(1,1) = 0.0; DofCoords(1,2) = 0.0;
221 DofCoords(2,0) = 0.0; DofCoords(2,1) = 1.0; DofCoords(2,2) = 0.0;
222 DofCoords(3,0) = 0.0; DofCoords(3,1) = 0.0; DofCoords(3,2) = 1.0;
228 #if defined(Intrepid_SHOW_DEPRECATED_WARNINGS)
230 #warning "The Intrepid package is deprecated"
void initializeTags()
Initializes tagToOrdinal_ and ordinalToTag_ lookup arrays.
void getValues(ArrayScalar &outputValues, const ArrayScalar &inputPoints, const EOperator operatorType) const
FEM basis evaluation on a reference Tetrahedron cell.
void getDofCoords(ArrayScalar &DofCoords) const
Returns spatial locations (coordinates) of degrees of freedom on a reference Tetrahedron.
Basis_HGRAD_TET_C1_FEM()
Constructor.