50 template<
class Scalar,
class ArrayScalar>
53 const int subcDofOrd) {
54 if (!basisTagsAreSet_) {
56 basisTagsAreSet_ =
true;
59 int dofOrdinal = tagToOrdinal_.at(subcDim).at(subcOrd).at(subcDofOrd);
60 TEUCHOS_TEST_FOR_EXCEPTION( (dofOrdinal == -1), std::invalid_argument,
61 ">>> ERROR (Basis): Invalid DoF tag");
66 template<
class Scalar,
class ArrayScalar>
69 if (!basisTagsAreSet_) {
71 basisTagsAreSet_ =
true;
77 template<
class Scalar,
class ArrayScalar>
79 if (!basisTagsAreSet_) {
81 basisTagsAreSet_ =
true;
84 return ordinalToTag_.at(dofOrd);
88 template<
class Scalar,
class ArrayScalar>
90 if (!basisTagsAreSet_) {
92 basisTagsAreSet_ =
true;
99 template<
class Scalar,
class ArrayScalar>
101 return basisCardinality_;
105 template<
class Scalar,
class ArrayScalar>
111 template<
class Scalar,
class ArrayScalar>
113 return basisCellTopology_;
117 template<
class Scalar,
class ArrayScalar>
123 template<
class Scalar,
class ArrayScalar>
125 return basisCoordinates_;
135 template<
class Scalar,
class ArrayScalar>
136 void getValues_HGRAD_Args(ArrayScalar & outputValues,
137 const ArrayScalar & inputPoints,
138 const EOperator operatorType,
139 const shards::CellTopology& cellTopo,
140 const int basisCard){
142 int spaceDim = cellTopo.getDimension();
145 TEUCHOS_TEST_FOR_EXCEPTION( !(inputPoints.rank() == 2), std::invalid_argument,
146 ">>> ERROR: (Intrepid::getValues_HGRAD_Args) rank = 2 required for inputPoints array");
148 TEUCHOS_TEST_FOR_EXCEPTION( (inputPoints.dimension(0) <= 0), std::invalid_argument,
149 ">>> ERROR (Intrepid::getValues_HGRAD_Args): dim 0 (number of points) > 0 required for inputPoints array");
151 TEUCHOS_TEST_FOR_EXCEPTION( !(inputPoints.dimension(1) == spaceDim), std::invalid_argument,
152 ">>> ERROR: (Intrepid::getValues_HGRAD_Args) dim 1 (spatial dimension) of inputPoints array does not match cell dimension");
164 TEUCHOS_TEST_FOR_EXCEPTION( ( (spaceDim == 2) && (operatorType == OPERATOR_DIV) ), std::invalid_argument,
165 ">>> ERROR: (Intrepid::getValues_HGRAD_Args) DIV is invalid operator for rank-0 (scalar) fields in 2D.");
167 TEUCHOS_TEST_FOR_EXCEPTION( ( (spaceDim == 3) && ( (operatorType == OPERATOR_DIV) ||
168 (operatorType == OPERATOR_CURL) ) ), std::invalid_argument,
169 ">>> ERROR: (Intrepid::getValues_HGRAD_Args) DIV and CURL are invalid operators for rank-0 (scalar) fields in 3D.");
176 switch(operatorType){
178 TEUCHOS_TEST_FOR_EXCEPTION( !(outputValues.rank() == 2), std::invalid_argument,
179 ">>> ERROR: (Intrepid::getValues_HGRAD_Args) rank = 2 required for outputValues when operator = VALUE.");
194 TEUCHOS_TEST_FOR_EXCEPTION( !(outputValues.rank() == 3), std::invalid_argument,
195 ">>> ERROR: (Intrepid::getValues_HGRAD_Args) rank = 3 required for outputValues in 1D when operator = GRAD, CURL, DIV, or Dk.");
197 TEUCHOS_TEST_FOR_EXCEPTION( !(outputValues.dimension(2) == 1 ),
198 std::invalid_argument,
199 ">>> ERROR: (Intrepid::getValues_HGRAD_Args) dim 2 of outputValues must equal 1 when operator = GRAD, CURL, DIV, or Dk.");
202 TEUCHOS_TEST_FOR_EXCEPTION( (
true), std::invalid_argument,
">>> ERROR: (Intrepid::getValues_HGRAD_Args) Invalid operator");
205 else if(spaceDim > 1) {
206 switch(operatorType){
208 TEUCHOS_TEST_FOR_EXCEPTION( !(outputValues.rank() == 2), std::invalid_argument,
209 ">>> ERROR: (Intrepid::getValues_HGRAD_Args) rank = 2 required for outputValues when operator = VALUE.");
214 TEUCHOS_TEST_FOR_EXCEPTION( !(outputValues.rank() == 3), std::invalid_argument,
215 ">>> ERROR: (Intrepid::getValues_HGRAD_Args) rank = 3 required for outputValues in 2D and 3D when operator = GRAD, CURL (in 2D), or Dk.");
217 TEUCHOS_TEST_FOR_EXCEPTION( !(outputValues.dimension(2) == spaceDim ),
218 std::invalid_argument,
219 ">>> ERROR: (Intrepid::getValues_HGRAD_Args) dim 2 of outputValues must equal cell dimension when operator = GRAD, CURL (in 2D), or D1.");
230 TEUCHOS_TEST_FOR_EXCEPTION( !(outputValues.rank() == 3), std::invalid_argument,
231 ">>> ERROR: (Intrepid::getValues_HGRAD_Args) rank = 3 required for outputValues in 2D and 3D when operator = GRAD, CURL (in 2D), or Dk.");
233 TEUCHOS_TEST_FOR_EXCEPTION( !(outputValues.dimension(2) == Intrepid::getDkCardinality(operatorType, spaceDim) ),
234 std::invalid_argument,
235 ">>> ERROR: (Intrepid::getValues_HGRAD_Args) dim 2 of outputValues must equal cardinality of the Dk multiset.");
238 TEUCHOS_TEST_FOR_EXCEPTION( (
true), std::invalid_argument,
">>> ERROR: (Intrepid::getValues_HGRAD_Args) Invalid operator");
244 TEUCHOS_TEST_FOR_EXCEPTION( !(outputValues.dimension(1) == inputPoints.dimension(0) ),
245 std::invalid_argument,
246 ">>> ERROR: (Intrepid::getValues_HGRAD_Args) dim 1 (number of points) of outputValues must equal dim 0 of inputPoints.");
248 TEUCHOS_TEST_FOR_EXCEPTION( !(outputValues.dimension(0) == basisCard ),
249 std::invalid_argument,
250 ">>> ERROR: (Intrepid::getValues_HGRAD_Args) dim 0 (number of basis functions) of outputValues must equal basis cardinality.");
255 template<
class Scalar,
class ArrayScalar>
256 void getValues_HCURL_Args(ArrayScalar & outputValues,
257 const ArrayScalar & inputPoints,
258 const EOperator operatorType,
259 const shards::CellTopology& cellTopo,
260 const int basisCard){
262 int spaceDim = cellTopo.getDimension();
266 TEUCHOS_TEST_FOR_EXCEPTION( !( (spaceDim == 2) || (spaceDim == 3) ), std::invalid_argument,
267 ">>> ERROR: (Intrepid::getValues_HCURL_Args) cell dimension = 2 or 3 required for HCURL basis");
271 TEUCHOS_TEST_FOR_EXCEPTION( !(inputPoints.rank() == 2), std::invalid_argument,
272 ">>> ERROR: (Intrepid::getValues_HCURL_Args) rank = 2 required for inputPoints array");
273 TEUCHOS_TEST_FOR_EXCEPTION( (inputPoints.dimension(0) <= 0), std::invalid_argument,
274 ">>> ERROR (Intrepid::getValues_HCURL_Args): dim 0 (number of points) > 0 required for inputPoints array");
276 TEUCHOS_TEST_FOR_EXCEPTION( !(inputPoints.dimension(1) == spaceDim), std::invalid_argument,
277 ">>> ERROR: (Intrepid::getValues_HCURL_Args) dim 1 (spatial dimension) of inputPoints array does not match cell dimension");
287 TEUCHOS_TEST_FOR_EXCEPTION( !( (operatorType == OPERATOR_VALUE) || (operatorType == OPERATOR_CURL) ), std::invalid_argument,
288 ">>> ERROR: (Intrepid::getValues_HCURL_Args) operator = VALUE or CURL required for HCURL fields.");
292 switch(operatorType) {
295 TEUCHOS_TEST_FOR_EXCEPTION( !(outputValues.rank() == 3), std::invalid_argument,
296 ">>> ERROR: (Intrepid::getValues_HCURL_Args) rank = 3 required for outputValues when operator is VALUE");
297 TEUCHOS_TEST_FOR_EXCEPTION( !(outputValues.dimension(2) == spaceDim ),
298 std::invalid_argument,
299 ">>> ERROR: (Intrepid::getValues_HCURL_Args) dim 2 of outputValues must equal cell dimension when operator is VALUE.");
306 TEUCHOS_TEST_FOR_EXCEPTION( !(outputValues.rank() == 3 ) ,
307 std::invalid_argument,
308 ">>> ERROR: (Intrepid::getValues_HCURL_Args) rank = 3 required for outputValues in 3D when operator is CURL");
309 TEUCHOS_TEST_FOR_EXCEPTION( !(outputValues.dimension(2) == spaceDim),
310 std::invalid_argument,
311 ">>> ERROR: (Intrepid::getValues_HCURL_Args) dim 2 of outputValues must equal cell dimension in 3D when operator is CURL.");
314 else if(spaceDim == 2) {
315 TEUCHOS_TEST_FOR_EXCEPTION( !(outputValues.rank() == 2 ) ,
316 std::invalid_argument,
317 ">>> ERROR: (Intrepid::getValues_HCURL_Args) rank = 2 required for outputValues in 2D when operator is CURL");
322 TEUCHOS_TEST_FOR_EXCEPTION( (
true), std::invalid_argument,
">>> ERROR: (Intrepid::getValues_HCURL_Args) Invalid operator");
327 TEUCHOS_TEST_FOR_EXCEPTION( !(outputValues.dimension(1) == inputPoints.dimension(0) ),
328 std::invalid_argument,
329 ">>> ERROR: (Intrepid::getValues_HCURL_Args) dim 1 (number of points) of outputValues must equal dim 0 of inputPoints.");
331 TEUCHOS_TEST_FOR_EXCEPTION( !(outputValues.dimension(0) == basisCard ),
332 std::invalid_argument,
333 ">>> ERROR: (Intrepid::getValues_HCURL_Args) dim 0 (number of basis functions) of outputValues must equal basis cardinality.");
339 template<
class Scalar,
class ArrayScalar>
340 void getValues_HDIV_Args(ArrayScalar & outputValues,
341 const ArrayScalar & inputPoints,
342 const EOperator operatorType,
343 const shards::CellTopology& cellTopo,
344 const int basisCard){
346 int spaceDim = cellTopo.getDimension();
349 TEUCHOS_TEST_FOR_EXCEPTION( !(inputPoints.rank() == 2), std::invalid_argument,
350 ">>> ERROR: (Intrepid::getValues_HDIV_Args) rank = 2 required for inputPoints array");
351 TEUCHOS_TEST_FOR_EXCEPTION( (inputPoints.dimension(0) <= 0), std::invalid_argument,
352 ">>> ERROR (Intrepid::getValues_HDIV_Args): dim 0 (number of points) > 0 required for inputPoints array");
354 TEUCHOS_TEST_FOR_EXCEPTION( !(inputPoints.dimension(1) == spaceDim), std::invalid_argument,
355 ">>> ERROR: (Intrepid::getValues_HDIV_Args) dim 1 (spatial dimension) of inputPoints array does not match cell dimension");
365 TEUCHOS_TEST_FOR_EXCEPTION( !( (operatorType == OPERATOR_VALUE) || (operatorType == OPERATOR_DIV) ), std::invalid_argument,
366 ">>> ERROR: (Intrepid::getValues_HDIV_Args) operator = VALUE or DIV required for HDIV fields.");
370 switch(operatorType) {
372 TEUCHOS_TEST_FOR_EXCEPTION( !(outputValues.rank() == 3), std::invalid_argument,
373 ">>> ERROR: (Intrepid::getValues_HDIV_Args) rank = 3 required for outputValues when operator is VALUE.");
375 TEUCHOS_TEST_FOR_EXCEPTION( !(outputValues.dimension(2) == spaceDim ),
376 std::invalid_argument,
377 ">>> ERROR: (Intrepid::getValues_HDIV_Args) dim 2 of outputValues must equal cell dimension for operator VALUE.");
380 TEUCHOS_TEST_FOR_EXCEPTION( !(outputValues.rank() == 2), std::invalid_argument,
381 ">>> ERROR: (Intrepid::getValues_HDIV_Args) rank = 2 required for outputValues when operator is DIV.");
385 TEUCHOS_TEST_FOR_EXCEPTION( (
true), std::invalid_argument,
">>> ERROR: (Intrepid::getValues_HDIV_Args) Invalid operator");
390 TEUCHOS_TEST_FOR_EXCEPTION( !(outputValues.dimension(1) == inputPoints.dimension(0) ),
391 std::invalid_argument,
392 ">>> ERROR: (Intrepid::getValues_HDIV_Args) dim 1 (number of points) of outputValues must equal dim 0 of inputPoints.");
394 TEUCHOS_TEST_FOR_EXCEPTION( !(outputValues.dimension(0) == basisCard ),
395 std::invalid_argument,
396 ">>> ERROR: (Intrepid::getValues_HDIV_Args) dim 0 (number of basis functions) of outputValues must equal basis cardinality.");
402 template<
class ArrayScalar>
405 #if defined(Intrepid_SHOW_DEPRECATED_WARNINGS)
407 #warning "The Intrepid package is deprecated"
This is an interface class for bases whose degrees of freedom can be associated with spatial location...
An abstract base class that defines interface for concrete basis implementations for Finite Element (...