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();
161 POLYTYPE_GAUSS_RADAU_LEFT,
162 POLYTYPE_GAUSS_RADAU_RIGHT,
163 POLYTYPE_GAUSS_LOBATTO,
167 KOKKOS_INLINE_FUNCTION
168 const char* EPolyTypeToString(
const EPolyType polytype) {
170 case POLYTYPE_GAUSS:
return "Gauss";
171 case POLYTYPE_GAUSS_RADAU_LEFT:
return "GaussRadauLeft";
172 case POLYTYPE_GAUSS_RADAU_RIGHT:
return "GaussRadauRight";
173 case POLYTYPE_GAUSS_LOBATTO:
return "GaussRadauLobatto";
174 case POLYTYPE_MAX:
return "Max PolyType";
176 return "INVALID EPolyType";
184 KOKKOS_FORCEINLINE_FUNCTION
186 return( polytype == POLYTYPE_GAUSS ||
187 polytype == POLYTYPE_GAUSS_RADAU_LEFT ||
188 polytype == POLYTYPE_GAUSS_RADAU_RIGHT ||
189 polytype == POLYTYPE_GAUSS_LOBATTO );
197 COORDINATES_CARTESIAN=0,
199 COORDINATES_CYLINDRICAL,
200 COORDINATES_SPHERICAL,
204 KOKKOS_INLINE_FUNCTION
205 const char* ECoordinatesToString(
const ECoordinates coords) {
207 case COORDINATES_CARTESIAN:
return "Cartesian";
208 case COORDINATES_POLAR:
return "Polar";
209 case COORDINATES_CYLINDRICAL:
return "Cylindrical";
210 case COORDINATES_SPHERICAL:
return "Spherical";
211 case COORDINATES_MAX:
return "Max. Coordinates";
213 return "INVALID ECoordinates";
221 KOKKOS_FORCEINLINE_FUNCTION
223 return( coordinateType == COORDINATES_CARTESIAN ||
224 coordinateType == COORDINATES_POLAR ||
225 coordinateType == COORDINATES_CYLINDRICAL ||
226 coordinateType == COORDINATES_SPHERICAL );
240 KOKKOS_INLINE_FUNCTION
241 const char* ENormToString(
const ENorm norm) {
243 case NORM_ONE:
return "1-Norm";
244 case NORM_TWO:
return "2-Norm";
245 case NORM_INF:
return "Infinity Norm";
246 case NORM_FRO:
return "Frobenius Norm";
247 case NORM_MAX:
return "Max. Norm";
249 return "INVALID ENorm";
257 KOKKOS_FORCEINLINE_FUNCTION
259 return( normType == NORM_ONE ||
260 normType == NORM_TWO ||
261 normType == NORM_INF ||
262 normType == NORM_FRO ||
263 normType == NORM_MAX );
287 OPERATOR_MAX = OPERATOR_Dn
290 KOKKOS_INLINE_FUNCTION
291 const char* EOperatorToString(
const EOperator op) {
293 case OPERATOR_VALUE:
return "Value";
294 case OPERATOR_GRAD:
return "Grad";
295 case OPERATOR_CURL:
return "Curl";
296 case OPERATOR_DIV:
return "Div";
297 case OPERATOR_D1:
return "D1";
298 case OPERATOR_D2:
return "D2";
299 case OPERATOR_D3:
return "D3";
300 case OPERATOR_D4:
return "D4";
301 case OPERATOR_D5:
return "D5";
302 case OPERATOR_D6:
return "D6";
303 case OPERATOR_D7:
return "D7";
304 case OPERATOR_D8:
return "D8";
305 case OPERATOR_D9:
return "D9";
306 case OPERATOR_D10:
return "D10";
307 case OPERATOR_MAX:
return "Dn Operator";
309 return "INVALID EOperator";
317 KOKKOS_FORCEINLINE_FUNCTION
319 return ( operatorType == OPERATOR_VALUE ||
320 operatorType == OPERATOR_GRAD ||
321 operatorType == OPERATOR_CURL ||
322 operatorType == OPERATOR_DIV ||
323 operatorType == OPERATOR_D1 ||
324 operatorType == OPERATOR_D2 ||
325 operatorType == OPERATOR_D3 ||
326 operatorType == OPERATOR_D4 ||
327 operatorType == OPERATOR_D5 ||
328 operatorType == OPERATOR_D6 ||
329 operatorType == OPERATOR_D7 ||
330 operatorType == OPERATOR_D8 ||
331 operatorType == OPERATOR_D9 ||
332 operatorType == OPERATOR_D10 );
339 enum EFunctionSpace {
340 FUNCTION_SPACE_HGRAD = 0,
341 FUNCTION_SPACE_HCURL = 1,
342 FUNCTION_SPACE_HDIV = 2,
343 FUNCTION_SPACE_HVOL = 3,
344 FUNCTION_SPACE_VECTOR_HGRAD = 4,
345 FUNCTION_SPACE_TENSOR_HGRAD = 5,
349 KOKKOS_INLINE_FUNCTION
350 const char* EFunctionSpaceToString(
const EFunctionSpace space) {
352 case FUNCTION_SPACE_HGRAD:
return "H(grad)";
353 case FUNCTION_SPACE_HCURL:
return "H(curl)";
354 case FUNCTION_SPACE_HDIV:
return "H(div)";
355 case FUNCTION_SPACE_HVOL:
return "H(vol)";
356 case FUNCTION_SPACE_VECTOR_HGRAD:
return "Vector H(grad)";
357 case FUNCTION_SPACE_TENSOR_HGRAD:
return "Tensor H(grad)";
358 case FUNCTION_SPACE_MAX:
return "Max. Function space";
360 return "INVALID EFunctionSpace";
368 KOKKOS_FORCEINLINE_FUNCTION
370 return ( spaceType == FUNCTION_SPACE_HGRAD ||
371 spaceType == FUNCTION_SPACE_HCURL ||
372 spaceType == FUNCTION_SPACE_HDIV ||
373 spaceType == FUNCTION_SPACE_HVOL ||
374 spaceType == FUNCTION_SPACE_VECTOR_HGRAD ||
375 spaceType == FUNCTION_SPACE_TENSOR_HGRAD );
387 DISCRETE_SPACE_COMPLETE = 0,
388 DISCRETE_SPACE_INCOMPLETE,
389 DISCRETE_SPACE_BROKEN,
393 KOKKOS_INLINE_FUNCTION
394 const char* EDiscreteSpaceToString(
const EDiscreteSpace space) {
396 case DISCRETE_SPACE_COMPLETE:
return "Complete";
397 case DISCRETE_SPACE_INCOMPLETE:
return "Incomplete";
398 case DISCRETE_SPACE_BROKEN:
return "Broken";
399 case DISCRETE_SPACE_MAX:
return "Max. Rec. Space";
401 return "INVALID EDiscreteSpace";
409 KOKKOS_FORCEINLINE_FUNCTION
411 return ( spaceType == DISCRETE_SPACE_COMPLETE ||
412 spaceType == DISCRETE_SPACE_INCOMPLETE ||
413 spaceType == DISCRETE_SPACE_BROKEN );
420 POINTTYPE_EQUISPACED = 0,
425 KOKKOS_INLINE_FUNCTION
426 const char* EPointTypeToString(
const EPointType pointType) {
428 case POINTTYPE_EQUISPACED:
return "Equispaced Points";
429 case POINTTYPE_WARPBLEND:
return "WarpBlend Points";
430 case POINTTYPE_GAUSS:
return "Gauss Points";
432 return "INVALID EPointType";
439 KOKKOS_FORCEINLINE_FUNCTION
441 return ( pointType == POINTTYPE_EQUISPACED ||
442 pointType == POINTTYPE_WARPBLEND ||
443 pointType == POINTTYPE_GAUSS );
450 BASIS_FEM_DEFAULT = 0,
451 BASIS_FEM_HIERARCHICAL,
459 KOKKOS_INLINE_FUNCTION
460 const char* EBasisToString(
const EBasis basis) {
462 case BASIS_FEM_DEFAULT:
return "FEM Default";
463 case BASIS_FEM_HIERARCHICAL:
return "FEM Hierarchical";
464 case BASIS_FEM_FIAT:
return "FEM FIAT";
465 case BASIS_FVD_DEFAULT:
return "FVD Default";
466 case BASIS_FVD_COVOLUME:
return "FVD Covolume";
467 case BASIS_FVD_MIMETIC:
return "FVD Mimetic";
468 case BASIS_MAX:
return "Max. Basis";
470 return "INVALID EBasis";
478 KOKKOS_FORCEINLINE_FUNCTION
480 return ( basisType == BASIS_FEM_DEFAULT ||
481 basisType == BASIS_FEM_HIERARCHICAL ||
482 basisType == BASIS_FEM_FIAT ||
483 basisType == BASIS_FVD_DEFAULT ||
484 basisType == BASIS_FVD_COVOLUME ||
485 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...
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.