48 #ifndef __INTREPID2_TYPES_HPP__
49 #define __INTREPID2_TYPES_HPP__
51 #include <Kokkos_Core.hpp>
52 #include <Kokkos_DynRankView.hpp>
59 typedef int ordinal_type;
60 typedef size_t size_type;
62 template<
typename ValueType>
63 KOKKOS_FORCEINLINE_FUNCTION
69 KOKKOS_FORCEINLINE_FUNCTION
70 double epsilon<double>() {
79 return (s.i64 < 0 ? 1 - s.d64 : s.d64 - 1);
83 KOKKOS_FORCEINLINE_FUNCTION
84 float epsilon<float>() {
93 return (s.i32 < 0 ? 1 - s.f32 : s.f32 - 1);
96 KOKKOS_FORCEINLINE_FUNCTION
98 return epsilon<double>();
101 KOKKOS_FORCEINLINE_FUNCTION
103 return 100.0*epsilon();
106 KOKKOS_FORCEINLINE_FUNCTION
108 return 10.0*epsilon();
163 POLYTYPE_GAUSS_RADAU_LEFT,
164 POLYTYPE_GAUSS_RADAU_RIGHT,
165 POLYTYPE_GAUSS_LOBATTO,
169 KOKKOS_INLINE_FUNCTION
170 const char* EPolyTypeToString(
const EPolyType polytype) {
172 case POLYTYPE_GAUSS:
return "Gauss";
173 case POLYTYPE_GAUSS_RADAU_LEFT:
return "GaussRadauLeft";
174 case POLYTYPE_GAUSS_RADAU_RIGHT:
return "GaussRadauRight";
175 case POLYTYPE_GAUSS_LOBATTO:
return "GaussRadauLobatto";
176 case POLYTYPE_MAX:
return "Max PolyType";
178 return "INVALID EPolyType";
186 KOKKOS_FORCEINLINE_FUNCTION
188 return( polytype == POLYTYPE_GAUSS ||
189 polytype == POLYTYPE_GAUSS_RADAU_LEFT ||
190 polytype == POLYTYPE_GAUSS_RADAU_RIGHT ||
191 polytype == POLYTYPE_GAUSS_LOBATTO );
199 COORDINATES_CARTESIAN=0,
201 COORDINATES_CYLINDRICAL,
202 COORDINATES_SPHERICAL,
206 KOKKOS_INLINE_FUNCTION
207 const char* ECoordinatesToString(
const ECoordinates coords) {
209 case COORDINATES_CARTESIAN:
return "Cartesian";
210 case COORDINATES_POLAR:
return "Polar";
211 case COORDINATES_CYLINDRICAL:
return "Cylindrical";
212 case COORDINATES_SPHERICAL:
return "Spherical";
213 case COORDINATES_MAX:
return "Max. Coordinates";
215 return "INVALID ECoordinates";
223 KOKKOS_FORCEINLINE_FUNCTION
225 return( coordinateType == COORDINATES_CARTESIAN ||
226 coordinateType == COORDINATES_POLAR ||
227 coordinateType == COORDINATES_CYLINDRICAL ||
228 coordinateType == COORDINATES_SPHERICAL );
242 KOKKOS_INLINE_FUNCTION
243 const char* ENormToString(
const ENorm norm) {
245 case NORM_ONE:
return "1-Norm";
246 case NORM_TWO:
return "2-Norm";
247 case NORM_INF:
return "Infinity Norm";
248 case NORM_FRO:
return "Frobenius Norm";
249 case NORM_MAX:
return "Max. Norm";
251 return "INVALID ENorm";
259 KOKKOS_FORCEINLINE_FUNCTION
261 return( normType == NORM_ONE ||
262 normType == NORM_TWO ||
263 normType == NORM_INF ||
264 normType == NORM_FRO ||
265 normType == NORM_MAX );
289 OPERATOR_MAX = OPERATOR_Dn
292 KOKKOS_INLINE_FUNCTION
293 const char* EOperatorToString(
const EOperator op) {
295 case OPERATOR_VALUE:
return "Value";
296 case OPERATOR_GRAD:
return "Grad";
297 case OPERATOR_CURL:
return "Curl";
298 case OPERATOR_DIV:
return "Div";
299 case OPERATOR_D1:
return "D1";
300 case OPERATOR_D2:
return "D2";
301 case OPERATOR_D3:
return "D3";
302 case OPERATOR_D4:
return "D4";
303 case OPERATOR_D5:
return "D5";
304 case OPERATOR_D6:
return "D6";
305 case OPERATOR_D7:
return "D7";
306 case OPERATOR_D8:
return "D8";
307 case OPERATOR_D9:
return "D9";
308 case OPERATOR_D10:
return "D10";
309 case OPERATOR_MAX:
return "Dn Operator";
311 return "INVALID EOperator";
319 KOKKOS_FORCEINLINE_FUNCTION
321 return ( operatorType == OPERATOR_VALUE ||
322 operatorType == OPERATOR_GRAD ||
323 operatorType == OPERATOR_CURL ||
324 operatorType == OPERATOR_DIV ||
325 operatorType == OPERATOR_D1 ||
326 operatorType == OPERATOR_D2 ||
327 operatorType == OPERATOR_D3 ||
328 operatorType == OPERATOR_D4 ||
329 operatorType == OPERATOR_D5 ||
330 operatorType == OPERATOR_D6 ||
331 operatorType == OPERATOR_D7 ||
332 operatorType == OPERATOR_D8 ||
333 operatorType == OPERATOR_D9 ||
334 operatorType == OPERATOR_D10 );
341 enum EFunctionSpace {
342 FUNCTION_SPACE_HGRAD = 0,
343 FUNCTION_SPACE_HCURL = 1,
344 FUNCTION_SPACE_HDIV = 2,
345 FUNCTION_SPACE_HVOL = 3,
346 FUNCTION_SPACE_VECTOR_HGRAD = 4,
347 FUNCTION_SPACE_TENSOR_HGRAD = 5,
351 KOKKOS_INLINE_FUNCTION
352 const char* EFunctionSpaceToString(
const EFunctionSpace space) {
354 case FUNCTION_SPACE_HGRAD:
return "H(grad)";
355 case FUNCTION_SPACE_HCURL:
return "H(curl)";
356 case FUNCTION_SPACE_HDIV:
return "H(div)";
357 case FUNCTION_SPACE_HVOL:
return "H(vol)";
358 case FUNCTION_SPACE_VECTOR_HGRAD:
return "Vector H(grad)";
359 case FUNCTION_SPACE_TENSOR_HGRAD:
return "Tensor H(grad)";
360 case FUNCTION_SPACE_MAX:
return "Max. Function space";
362 return "INVALID EFunctionSpace";
370 KOKKOS_FORCEINLINE_FUNCTION
372 return ( spaceType == FUNCTION_SPACE_HGRAD ||
373 spaceType == FUNCTION_SPACE_HCURL ||
374 spaceType == FUNCTION_SPACE_HDIV ||
375 spaceType == FUNCTION_SPACE_HVOL ||
376 spaceType == FUNCTION_SPACE_VECTOR_HGRAD ||
377 spaceType == FUNCTION_SPACE_TENSOR_HGRAD );
388 enum EDiscreteSpace {
389 DISCRETE_SPACE_COMPLETE = 0,
390 DISCRETE_SPACE_INCOMPLETE,
391 DISCRETE_SPACE_BROKEN,
395 KOKKOS_INLINE_FUNCTION
396 const char* EDiscreteSpaceToString(
const EDiscreteSpace space) {
398 case DISCRETE_SPACE_COMPLETE:
return "Complete";
399 case DISCRETE_SPACE_INCOMPLETE:
return "Incomplete";
400 case DISCRETE_SPACE_BROKEN:
return "Broken";
401 case DISCRETE_SPACE_MAX:
return "Max. Rec. Space";
403 return "INVALID EDiscreteSpace";
411 KOKKOS_FORCEINLINE_FUNCTION
413 return ( spaceType == DISCRETE_SPACE_COMPLETE ||
414 spaceType == DISCRETE_SPACE_INCOMPLETE ||
415 spaceType == DISCRETE_SPACE_BROKEN );
422 POINTTYPE_EQUISPACED = 0,
428 KOKKOS_INLINE_FUNCTION
429 const char* EPointTypeToString(
const EPointType pointType) {
431 case POINTTYPE_EQUISPACED:
return "Equispaced Points";
432 case POINTTYPE_WARPBLEND:
return "WarpBlend Points";
433 case POINTTYPE_GAUSS:
return "Gauss Points";
434 case POINTTYPE_DEFAULT:
return "Default Points";
436 return "INVALID EPointType";
443 KOKKOS_FORCEINLINE_FUNCTION
445 return ( pointType == POINTTYPE_EQUISPACED ||
446 pointType == POINTTYPE_WARPBLEND ||
447 pointType == POINTTYPE_GAUSS );
454 BASIS_FEM_DEFAULT = 0,
455 BASIS_FEM_HIERARCHICAL,
456 BASIS_FEM_LAGRANGIAN,
463 KOKKOS_INLINE_FUNCTION
464 const char* EBasisToString(
const EBasis basis) {
466 case BASIS_FEM_DEFAULT:
return "FEM Default";
467 case BASIS_FEM_HIERARCHICAL:
return "FEM Hierarchical";
468 case BASIS_FEM_LAGRANGIAN:
return "FEM FIAT";
469 case BASIS_FVD_DEFAULT:
return "FVD Default";
470 case BASIS_FVD_COVOLUME:
return "FVD Covolume";
471 case BASIS_FVD_MIMETIC:
return "FVD Mimetic";
472 case BASIS_MAX:
return "Max. Basis";
474 return "INVALID EBasis";
482 KOKKOS_FORCEINLINE_FUNCTION
484 return ( basisType == BASIS_FEM_DEFAULT ||
485 basisType == BASIS_FEM_HIERARCHICAL ||
486 basisType == BASIS_FEM_LAGRANGIAN ||
487 basisType == BASIS_FVD_DEFAULT ||
488 basisType == BASIS_FVD_COVOLUME ||
489 basisType == BASIS_FVD_MIMETIC );
KOKKOS_FORCEINLINE_FUNCTION bool isValidFunctionSpace(const EFunctionSpace spaceType)
Verifies validity of a function space enum.
KOKKOS_FORCEINLINE_FUNCTION bool isValidPointType(const EPointType pointType)
Verifies validity of a point type enum.
KOKKOS_FORCEINLINE_FUNCTION bool isValidPolyType(const EPolyType polytype)
Verifies validity of a PolyType enum.
KOKKOS_FORCEINLINE_FUNCTION bool isValidNorm(const ENorm normType)
Verifies validity of a Norm enum.
KOKKOS_FORCEINLINE_FUNCTION bool isValidBasis(const EBasis basisType)
Verifies validity of a basis enum.
KOKKOS_FORCEINLINE_FUNCTION bool isValidCoordinate(const ECoordinates coordinateType)
Verifies validity of a Coordinate enum.
KOKKOS_FORCEINLINE_FUNCTION bool isValidDiscreteSpace(const EDiscreteSpace spaceType)
Verifies validity of a discrete space enum.
KOKKOS_FORCEINLINE_FUNCTION bool isValidOperator(const EOperator operatorType)
Verifies validity of an operator enum.
static constexpr ordinal_type MaxCubatureDegreeTri
The maximum degree of the polynomial that can be integrated exactly by a direct triangle rule.
static constexpr ordinal_type MaxCubatureDegreePyr
The maximum degree of the polynomial that can be integrated exactly by a direct pyramid rule.
static constexpr ordinal_type MaxCubatureDegreeTet
The maximum degree of the polynomial that can be integrated exactly by a direct tetrahedron rule.
static constexpr ordinal_type MaxCubatureDegreeEdge
The maximum degree of the polynomial that can be integrated exactly by a direct edge rule.
static constexpr ordinal_type MaxOrder
The maximum reconstruction order.
static constexpr ordinal_type MaxIntegrationPoints
The maximum number of integration points for direct cubature rules.
static constexpr ordinal_type MaxNewton
Maximum number of Newton iterations used internally in methods such as computing the action of the in...
static constexpr ordinal_type MaxTensorComponents
Maximum number of tensor/Cartesian products that can be taken: this allows hypercube basis in 7D to b...
static constexpr ordinal_type MaxNumPtsPerBasisEval
The maximum number of points to eval in serial mode.
static constexpr ordinal_type MaxDimension
The maximum ambient space dimension.
static constexpr ordinal_type MaxDerivative
Maximum order of derivatives allowed in intrepid.