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();
165 POLYTYPE_GAUSS_RADAU_LEFT,
166 POLYTYPE_GAUSS_RADAU_RIGHT,
167 POLYTYPE_GAUSS_LOBATTO,
171 KOKKOS_INLINE_FUNCTION
172 const char* EPolyTypeToString(
const EPolyType polytype) {
174 case POLYTYPE_GAUSS:
return "Gauss";
175 case POLYTYPE_GAUSS_RADAU_LEFT:
return "GaussRadauLeft";
176 case POLYTYPE_GAUSS_RADAU_RIGHT:
return "GaussRadauRight";
177 case POLYTYPE_GAUSS_LOBATTO:
return "GaussRadauLobatto";
178 case POLYTYPE_MAX:
return "Max PolyType";
180 return "INVALID EPolyType";
188 KOKKOS_FORCEINLINE_FUNCTION
190 return( polytype == POLYTYPE_GAUSS ||
191 polytype == POLYTYPE_GAUSS_RADAU_LEFT ||
192 polytype == POLYTYPE_GAUSS_RADAU_RIGHT ||
193 polytype == POLYTYPE_GAUSS_LOBATTO );
201 COORDINATES_CARTESIAN=0,
203 COORDINATES_CYLINDRICAL,
204 COORDINATES_SPHERICAL,
208 KOKKOS_INLINE_FUNCTION
209 const char* ECoordinatesToString(
const ECoordinates coords) {
211 case COORDINATES_CARTESIAN:
return "Cartesian";
212 case COORDINATES_POLAR:
return "Polar";
213 case COORDINATES_CYLINDRICAL:
return "Cylindrical";
214 case COORDINATES_SPHERICAL:
return "Spherical";
215 case COORDINATES_MAX:
return "Max. Coordinates";
217 return "INVALID ECoordinates";
225 KOKKOS_FORCEINLINE_FUNCTION
227 return( coordinateType == COORDINATES_CARTESIAN ||
228 coordinateType == COORDINATES_POLAR ||
229 coordinateType == COORDINATES_CYLINDRICAL ||
230 coordinateType == COORDINATES_SPHERICAL );
244 KOKKOS_INLINE_FUNCTION
245 const char* ENormToString(
const ENorm norm) {
247 case NORM_ONE:
return "1-Norm";
248 case NORM_TWO:
return "2-Norm";
249 case NORM_INF:
return "Infinity Norm";
250 case NORM_FRO:
return "Frobenius Norm";
251 case NORM_MAX:
return "Max. Norm";
253 return "INVALID ENorm";
261 KOKKOS_FORCEINLINE_FUNCTION
263 return( normType == NORM_ONE ||
264 normType == NORM_TWO ||
265 normType == NORM_INF ||
266 normType == NORM_FRO ||
267 normType == NORM_MAX );
291 OPERATOR_MAX = OPERATOR_Dn
294 KOKKOS_INLINE_FUNCTION
295 const char* EOperatorToString(
const EOperator op) {
297 case OPERATOR_VALUE:
return "Value";
298 case OPERATOR_GRAD:
return "Grad";
299 case OPERATOR_CURL:
return "Curl";
300 case OPERATOR_DIV:
return "Div";
301 case OPERATOR_D1:
return "D1";
302 case OPERATOR_D2:
return "D2";
303 case OPERATOR_D3:
return "D3";
304 case OPERATOR_D4:
return "D4";
305 case OPERATOR_D5:
return "D5";
306 case OPERATOR_D6:
return "D6";
307 case OPERATOR_D7:
return "D7";
308 case OPERATOR_D8:
return "D8";
309 case OPERATOR_D9:
return "D9";
310 case OPERATOR_D10:
return "D10";
311 case OPERATOR_MAX:
return "Dn Operator";
313 return "INVALID EOperator";
321 KOKKOS_FORCEINLINE_FUNCTION
323 return ( operatorType == OPERATOR_VALUE ||
324 operatorType == OPERATOR_GRAD ||
325 operatorType == OPERATOR_CURL ||
326 operatorType == OPERATOR_DIV ||
327 operatorType == OPERATOR_D1 ||
328 operatorType == OPERATOR_D2 ||
329 operatorType == OPERATOR_D3 ||
330 operatorType == OPERATOR_D4 ||
331 operatorType == OPERATOR_D5 ||
332 operatorType == OPERATOR_D6 ||
333 operatorType == OPERATOR_D7 ||
334 operatorType == OPERATOR_D8 ||
335 operatorType == OPERATOR_D9 ||
336 operatorType == OPERATOR_D10 );
343 enum EFunctionSpace {
344 FUNCTION_SPACE_HGRAD = 0,
345 FUNCTION_SPACE_HCURL = 1,
346 FUNCTION_SPACE_HDIV = 2,
347 FUNCTION_SPACE_HVOL = 3,
348 FUNCTION_SPACE_VECTOR_HGRAD = 4,
349 FUNCTION_SPACE_TENSOR_HGRAD = 5,
353 KOKKOS_INLINE_FUNCTION
354 const char* EFunctionSpaceToString(
const EFunctionSpace space) {
356 case FUNCTION_SPACE_HGRAD:
return "H(grad)";
357 case FUNCTION_SPACE_HCURL:
return "H(curl)";
358 case FUNCTION_SPACE_HDIV:
return "H(div)";
359 case FUNCTION_SPACE_HVOL:
return "H(vol)";
360 case FUNCTION_SPACE_VECTOR_HGRAD:
return "Vector H(grad)";
361 case FUNCTION_SPACE_TENSOR_HGRAD:
return "Tensor H(grad)";
362 case FUNCTION_SPACE_MAX:
return "Max. Function space";
364 return "INVALID EFunctionSpace";
372 KOKKOS_FORCEINLINE_FUNCTION
374 return ( spaceType == FUNCTION_SPACE_HGRAD ||
375 spaceType == FUNCTION_SPACE_HCURL ||
376 spaceType == FUNCTION_SPACE_HDIV ||
377 spaceType == FUNCTION_SPACE_HVOL ||
378 spaceType == FUNCTION_SPACE_VECTOR_HGRAD ||
379 spaceType == FUNCTION_SPACE_TENSOR_HGRAD );
391 DISCRETE_SPACE_COMPLETE = 0,
392 DISCRETE_SPACE_INCOMPLETE,
393 DISCRETE_SPACE_BROKEN,
397 KOKKOS_INLINE_FUNCTION
398 const char* EDiscreteSpaceToString(
const EDiscreteSpace space) {
400 case DISCRETE_SPACE_COMPLETE:
return "Complete";
401 case DISCRETE_SPACE_INCOMPLETE:
return "Incomplete";
402 case DISCRETE_SPACE_BROKEN:
return "Broken";
403 case DISCRETE_SPACE_MAX:
return "Max. Rec. Space";
405 return "INVALID EDiscreteSpace";
413 KOKKOS_FORCEINLINE_FUNCTION
415 return ( spaceType == DISCRETE_SPACE_COMPLETE ||
416 spaceType == DISCRETE_SPACE_INCOMPLETE ||
417 spaceType == DISCRETE_SPACE_BROKEN );
424 POINTTYPE_EQUISPACED = 0,
430 KOKKOS_INLINE_FUNCTION
431 const char* EPointTypeToString(
const EPointType pointType) {
433 case POINTTYPE_EQUISPACED:
return "Equispaced Points";
434 case POINTTYPE_WARPBLEND:
return "WarpBlend Points";
435 case POINTTYPE_GAUSS:
return "Gauss Points";
436 case POINTTYPE_DEFAULT:
return "Default Points";
438 return "INVALID EPointType";
445 KOKKOS_FORCEINLINE_FUNCTION
447 return ( pointType == POINTTYPE_EQUISPACED ||
448 pointType == POINTTYPE_WARPBLEND ||
449 pointType == POINTTYPE_GAUSS );
456 BASIS_FEM_DEFAULT = 0,
457 BASIS_FEM_HIERARCHICAL,
458 BASIS_FEM_LAGRANGIAN,
465 KOKKOS_INLINE_FUNCTION
466 const char* EBasisToString(
const EBasis basis) {
468 case BASIS_FEM_DEFAULT:
return "FEM Default";
469 case BASIS_FEM_HIERARCHICAL:
return "FEM Hierarchical";
470 case BASIS_FEM_LAGRANGIAN:
return "FEM FIAT";
471 case BASIS_FVD_DEFAULT:
return "FVD Default";
472 case BASIS_FVD_COVOLUME:
return "FVD Covolume";
473 case BASIS_FVD_MIMETIC:
return "FVD Mimetic";
474 case BASIS_MAX:
return "Max. Basis";
476 return "INVALID EBasis";
484 KOKKOS_FORCEINLINE_FUNCTION
486 return ( basisType == BASIS_FEM_DEFAULT ||
487 basisType == BASIS_FEM_HIERARCHICAL ||
488 basisType == BASIS_FEM_LAGRANGIAN ||
489 basisType == BASIS_FVD_DEFAULT ||
490 basisType == BASIS_FVD_COVOLUME ||
491 basisType == BASIS_FVD_MIMETIC );
KOKKOS_FORCEINLINE_FUNCTION bool isValidFunctionSpace(const EFunctionSpace spaceType)
Verifies validity of a function space enum.
static constexpr ordinal_type MaxDimension
The maximum ambient space dimension.
KOKKOS_FORCEINLINE_FUNCTION bool isValidCoordinate(const ECoordinates coordinateType)
Verifies validity of a Coordinate 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 MaxCubatureDegreeTet
The maximum degree of the polynomial that can be integrated exactly by a direct tetrahedron rule...
KOKKOS_FORCEINLINE_FUNCTION bool isValidPointType(const EPointType pointType)
Verifies validity of a point type enum.
ECoordinates
Enumeration of coordinate systems for geometrical entities (cells, points).
KOKKOS_FORCEINLINE_FUNCTION bool isValidNorm(const ENorm normType)
Verifies validity of a Norm enum.
static constexpr ordinal_type MaxNewton
Maximum number of Newton iterations used internally in methods such as computing the action of the in...
ENorm
Enumeration of norm types for vectors and functions.
static constexpr ordinal_type MaxNumPtsPerBasisEval
The maximum number of points to eval in serial mode.
EBasis
Enumeration of basis types for discrete spaces in Intrepid.
EOperator
Enumeration of primitive operators available in Intrepid. Primitive operators act on reconstructed fu...
KOKKOS_FORCEINLINE_FUNCTION bool isValidBasis(const EBasis basisType)
Verifies validity of a basis enum.
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 MaxVectorComponents
Maximum number of components that a VectorData object will store – 66 corresponds to OPERATOR_D10 on...
EDiscreteSpace
Enumeration of the discrete spaces used to define bases for function spaces. Intrepid allows up to th...
EPointType
Enumeration of types of point distributions in Intrepid.
static constexpr ordinal_type MaxIntegrationPoints
The maximum number of integration points for direct cubature rules.
KOKKOS_FORCEINLINE_FUNCTION bool isValidPolyType(const EPolyType polytype)
Verifies validity of a PolyType enum.
KOKKOS_FORCEINLINE_FUNCTION bool isValidOperator(const EOperator operatorType)
Verifies validity of an operator enum.
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.
KOKKOS_FORCEINLINE_FUNCTION bool isValidDiscreteSpace(const EDiscreteSpace spaceType)
Verifies validity of a discrete space enum.
static constexpr ordinal_type MaxDerivative
Maximum order of derivatives allowed in intrepid.
static constexpr ordinal_type MaxTensorComponents
Maximum number of tensor/Cartesian products that can be taken: this allows hypercube basis in 7D to b...