1 #ifndef INTREPID_HGRAD_TET_C2_FEMDEF_HPP 2 #define INTREPID_HGRAD_TET_C2_FEMDEF_HPP 53 template<
class Scalar,
class ArrayScalar>
56 this -> basisCardinality_ = 10;
57 this -> basisDegree_ = 2;
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,
89 this -> ordinalToTag_,
91 this -> basisCardinality_,
100 template<
class Scalar,
class ArrayScalar>
102 const ArrayScalar & inputPoints,
106 #ifdef HAVE_INTREPID_DEBUG 107 Intrepid::getValues_HGRAD_Args<Scalar, ArrayScalar>(outputValues,
110 this -> getBaseCellTopology(),
111 this -> getCardinality() );
115 int dim0 = inputPoints.dimension(0);
122 switch (operatorType) {
125 for (
int i0 = 0; i0 < dim0; i0++) {
126 x = inputPoints(i0, 0);
127 y = inputPoints(i0, 1);
128 z = inputPoints(i0, 2);
131 outputValues(0, i0) = (-1. + x + y + z)*(-1. + 2.*x + 2.*y + 2.*z);
132 outputValues(1, i0) = x*(-1. + 2.*x);
133 outputValues(2, i0) = y*(-1. + 2.*y);
134 outputValues(3, i0) = z*(-1. + 2.*z);
136 outputValues(4, i0) = -4.*x*(-1. + x + y + z);
137 outputValues(5, i0) = 4.*x*y;
138 outputValues(6, i0) = -4.*y*(-1. + x + y + z);
139 outputValues(7, i0) = -4.*z*(-1. + x + y + z);
140 outputValues(8, i0) = 4.*x*z;
141 outputValues(9, i0) = 4.*y*z;
148 for (
int i0 = 0; i0 < dim0; i0++) {
149 x = inputPoints(i0, 0);
150 y = inputPoints(i0, 1);
151 z = inputPoints(i0, 2);
154 outputValues(0, i0, 0) = -3.+ 4.*x + 4.*y + 4.*z;
155 outputValues(0, i0, 1) = -3.+ 4.*x + 4.*y + 4.*z;
156 outputValues(0, i0, 2) = -3.+ 4.*x + 4.*y + 4.*z;
158 outputValues(1, i0, 0) = -1.+ 4.*x;
159 outputValues(1, i0, 1) = 0.;
160 outputValues(1, i0, 2) = 0.;
162 outputValues(2, i0, 0) = 0.;
163 outputValues(2, i0, 1) = -1.+ 4.*y;
164 outputValues(2, i0, 2) = 0.;
166 outputValues(3, i0, 0) = 0.;
167 outputValues(3, i0, 1) = 0.;
168 outputValues(3, i0, 2) = -1.+ 4.*z;
171 outputValues(4, i0, 0) = -4.*(-1.+ 2*x + y + z);
172 outputValues(4, i0, 1) = -4.*x;
173 outputValues(4, i0, 2) = -4.*x;
175 outputValues(5, i0, 0) = 4.*y;
176 outputValues(5, i0, 1) = 4.*x;
177 outputValues(5, i0, 2) = 0.;
179 outputValues(6, i0, 0) = -4.*y;
180 outputValues(6, i0, 1) = -4.*(-1.+ x + 2*y + z);
181 outputValues(6, i0, 2) = -4.*y;
183 outputValues(7, i0, 0) = -4.*z;
184 outputValues(7, i0, 1) = -4.*z;
185 outputValues(7, i0, 2) = -4.*(-1.+ x + y + 2*z);
187 outputValues(8, i0, 0) = 4.*z;
188 outputValues(8, i0, 1) = 0.;
189 outputValues(8, i0, 2) = 4.*x;
191 outputValues(9, i0, 0) = 0.;
192 outputValues(9, i0, 1) = 4.*z;
193 outputValues(9, i0, 2) = 4.*y;
199 TEUCHOS_TEST_FOR_EXCEPTION( (operatorType == OPERATOR_CURL), std::invalid_argument,
200 ">>> ERROR (Basis_HGRAD_TET_C2_FEM): CURL is invalid operator for rank-0 (scalar) functions in 3D");
204 TEUCHOS_TEST_FOR_EXCEPTION( (operatorType == OPERATOR_DIV), std::invalid_argument,
205 ">>> ERROR (Basis_HGRAD_TET_C2_FEM): DIV is invalid operator for rank-0 (scalar) functions in 3D");
209 for (
int i0 = 0; i0 < dim0; i0++) {
211 outputValues(0, i0, 0) = 4.;
212 outputValues(0, i0, 1) = 4.;
213 outputValues(0, i0, 2) = 4.;
214 outputValues(0, i0, 3) = 4.;
215 outputValues(0, i0, 4) = 4.;
216 outputValues(0, i0, 5) = 4.;
218 outputValues(1, i0, 0) = 4.;
219 outputValues(1, i0, 1) = 0.;
220 outputValues(1, i0, 2) = 0.;
221 outputValues(1, i0, 3) = 0.;
222 outputValues(1, i0, 4) = 0.;
223 outputValues(1, i0, 5) = 0.;
225 outputValues(2, i0, 0) = 0.;
226 outputValues(2, i0, 1) = 0.;
227 outputValues(2, i0, 2) = 0.;
228 outputValues(2, i0, 3) = 4.;
229 outputValues(2, i0, 4) = 0.;
230 outputValues(2, i0, 5) = 0.;
232 outputValues(3, i0, 0) = 0.;
233 outputValues(3, i0, 1) = 0.;
234 outputValues(3, i0, 2) = 0.;
235 outputValues(3, i0, 3) = 0.;
236 outputValues(3, i0, 4) = 0.;
237 outputValues(3, i0, 5) = 4.;
239 outputValues(4, i0, 0) = -8.;
240 outputValues(4, i0, 1) = -4.;
241 outputValues(4, i0, 2) = -4.;
242 outputValues(4, i0, 3) = 0.;
243 outputValues(4, i0, 4) = 0.;
244 outputValues(4, i0, 5) = 0.;
246 outputValues(5, i0, 0) = 0.;
247 outputValues(5, i0, 1) = 4.;
248 outputValues(5, i0, 2) = 0.;
249 outputValues(5, i0, 3) = 0.;
250 outputValues(5, i0, 4) = 0.;
251 outputValues(5, i0, 5) = 0.;
253 outputValues(6, i0, 0) = 0.;
254 outputValues(6, i0, 1) = -4.;
255 outputValues(6, i0, 2) = 0.;
256 outputValues(6, i0, 3) = -8.;
257 outputValues(6, i0, 4) = -4.;
258 outputValues(6, i0, 5) = 0;
260 outputValues(7, i0, 0) = 0.;
261 outputValues(7, i0, 1) = 0.;
262 outputValues(7, i0, 2) = -4.;
263 outputValues(7, i0, 3) = 0.;
264 outputValues(7, i0, 4) = -4.;
265 outputValues(7, i0, 5) = -8.;
267 outputValues(8, i0, 0) = 0.;
268 outputValues(8, i0, 1) = 0.;
269 outputValues(8, i0, 2) = 4.;
270 outputValues(8, i0, 3) = 0.;
271 outputValues(8, i0, 4) = 0.;
272 outputValues(8, i0, 5) = 0.;
274 outputValues(9, i0, 0) = 0.;
275 outputValues(9, i0, 1) = 0.;
276 outputValues(9, i0, 2) = 0.;
277 outputValues(9, i0, 3) = 0.;
278 outputValues(9, i0, 4) = 4.;
279 outputValues(9, i0, 5) = 0.;
294 this -> basisCellTopology_.getDimension() );
295 for(
int dofOrd = 0; dofOrd <
this -> basisCardinality_; dofOrd++) {
296 for (
int i0 = 0; i0 < dim0; i0++) {
297 for(
int dkOrd = 0; dkOrd < DkCardinality; dkOrd++){
298 outputValues(dofOrd, i0, dkOrd) = 0.0;
306 ">>> ERROR (Basis_HGRAD_TET_C2_FEM): Invalid operator type");
312 template<
class Scalar,
class ArrayScalar>
314 const ArrayScalar & inputPoints,
315 const ArrayScalar & cellVertices,
317 TEUCHOS_TEST_FOR_EXCEPTION( (
true), std::logic_error,
318 ">>> ERROR (Basis_HGRAD_TET_C2_FEM): FEM Basis calling an FVD member function");
void initializeTags()
Initializes tagToOrdinal_ and ordinalToTag_ lookup arrays.
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.
EOperator
Enumeration of primitive operators available in Intrepid. Primitive operators act on reconstructed fu...
int getDkCardinality(const EOperator operatorType, const int spaceDim)
Returns cardinality of Dk, i.e., the number of all derivatives of order k.
Basis_HGRAD_TET_C2_FEM()
Constructor.
int isValidOperator(const EOperator operatorType)
Verifies validity of an operator enum.
void getValues(ArrayScalar &outputValues, const ArrayScalar &inputPoints, const EOperator operatorType) const
FEM basis evaluation on a reference Tetrahedron cell.