22#if defined(SVMP_FE_WITH_MESH) && SVMP_FE_WITH_MESH
23# include "Mesh/Core/MeshTypes.h"
25# define SVMP_FE_HAS_MESH_TYPES 1
29# define SVMP_FE_HAS_MESH_TYPES 0
32#if !SVMP_FE_HAS_MESH_TYPES
34#ifndef SVMP_CELL_FAMILY_DEFINED
36#define SVMP_CELL_FAMILY_DEFINED 1
130#if SVMP_FE_HAS_MESH_TYPES
308template<
int SpatialDim,
int ReferenceDim = SpatialDim>
309using Jacobian = std::array<std::array<double, static_cast<std::size_t>(ReferenceDim)>,
static_cast<std::size_t
>(SpatialDim)>;
324template<
typename T,
typename Tag>
331 constexpr StrongType() noexcept(std::is_nothrow_default_constructible_v<T>)
338 constexpr explicit StrongType(T value)
noexcept(std::is_nothrow_move_constructible_v<T>)
339 : value_(std::move(value)) {}
345 constexpr T&
get() noexcept {
return value_; }
350 constexpr const T&
get() const noexcept {
return value_; }
356 constexpr explicit operator T() const noexcept {
return value_; }
364 return value_ == other.value_;
372 return value_ != other.value_;
380 return value_ < other.value_;
472 return svmp::CellFamily::Line;
476 return svmp::CellFamily::Triangle;
481 return svmp::CellFamily::Quad;
485 return svmp::CellFamily::Tetra;
490 return svmp::CellFamily::Hex;
495 return svmp::CellFamily::Wedge;
500 return svmp::CellFamily::Pyramid;
503 return svmp::CellFamily::Point;
506 return svmp::CellFamily::Point;
The Vector template class is used for storing int and double data.
Definition Vector.h:26
DOF-specific index type.
Definition Types.h:409
constexpr bool is_valid() const noexcept
Check whether this index refers to a valid DOF.
Definition Types.h:420
constexpr StrongType() noexcept(std::is_nothrow_default_constructible_v< T >)
Value-initialize the wrapped value.
Definition Types.h:331
constexpr DofIndex() noexcept
Construct an invalid DOF index (the negative sentinel).
Definition Types.h:414
Strong type wrapper template for type-safe programming.
Definition Types.h:325
constexpr bool operator!=(const StrongType &other) const noexcept
Compare wrapped values for inequality.
Definition Types.h:371
constexpr bool operator<(const StrongType &other) const noexcept
Order by wrapped value.
Definition Types.h:379
constexpr T & get() noexcept
Access the wrapped value.
Definition Types.h:345
constexpr const T & get() const noexcept
Access the wrapped value.
Definition Types.h:350
constexpr StrongType() noexcept(std::is_nothrow_default_constructible_v< T >)
Value-initialize the wrapped value.
Definition Types.h:331
T ValueType
Underlying value type.
Definition Types.h:328
constexpr bool operator==(const StrongType &other) const noexcept
Compare wrapped values for equality.
Definition Types.h:363
constexpr StrongType(T value) noexcept(std::is_nothrow_move_constructible_v< T >)
Wrap an explicit value.
Definition Types.h:338
std::array< std::array< double, static_cast< std::size_t >(ReferenceDim)>, static_cast< std::size_t >(SpatialDim)> Jacobian
Jacobian matrix type.
Definition Types.h:309
constexpr bool is_field_type_v
Definition Types.h:457
constexpr GlobalIndex INVALID_GLOBAL_INDEX
Definition Types.h:147
std::array< double, 3 > PhysicalPoint
Point in physical coordinates.
Definition Types.h:301
BasisType
Basis function families.
Definition Types.h:247
std::int64_t GlobalIndex
Global index type for distributed DOF numbering.
Definition Types.h:115
std::uint16_t BlockId
Block identifier for block-structured systems.
Definition Types.h:127
constexpr FieldId CURRENT_SOLUTION_FIELD_ID
Sentinel FieldId representing "the current solution state" in tangent forms.
Definition Types.h:172
FieldType
Field types for function spaces.
Definition Types.h:257
constexpr LocalIndex INVALID_LOCAL_INDEX
Definition Types.h:145
Continuity
Continuity requirements for function spaces.
Definition Types.h:268
constexpr svmp::CellFamily to_mesh_family(ElementType elem) noexcept
Convert FE ElementType to Mesh CellFamily.
Definition Types.h:468
constexpr int element_dimension(ElementType elem) noexcept
Get spatial dimension of element type.
Definition Types.h:515
StrongType< LocalIndex, QuadraturePointTag > QuadraturePointIndex
Definition Types.h:395
constexpr std::size_t kFEPreferredAlignmentBytes
Definition Types.h:175
std::int64_t MeshOffset
Offset type for mesh connectivity arrays.
Definition Types.h:136
constexpr bool is_index_type_v
Definition Types.h:444
std::uint32_t LocalIndex
Local index type for element-level operations.
Definition Types.h:102
AssemblyStrategy
Assembly strategies.
Definition Types.h:280
constexpr FieldId GEOMETRY_FIELD_ID
Definition Types.h:155
constexpr int MAX_FIELD_VALUE_COMPONENTS
Definition Types.h:185
ElementType
Reference element types supported by the FE library.
Definition Types.h:215
CellFamily
Minimal fallback for svmp::CellFamily when the Mesh library is unavailable.
Definition Types.h:44
constexpr BlockId INVALID_BLOCK_ID
Definition Types.h:157
StrongType< double, QuadratureWeightTag > QuadratureWeight
Definition Types.h:397
constexpr std::size_t kFEFixedObjectAlignmentBytes
Definition Types.h:178
constexpr FieldId INVALID_FIELD_ID
Definition Types.h:149
std::int64_t MeshGlobalId
Global mesh entity identifier.
Definition Types.h:137
std::int32_t MeshIndex
Local mesh entity index, shared with the Mesh library.
Definition Types.h:135
std::array< double, static_cast< std::size_t >(Dim)> ReferencePoint
Point in reference element coordinates.
Definition Types.h:296
std::uint16_t FieldId
Field identifier type.
Definition Types.h:122
@ Lagrange
Standard nodal Lagrange basis.
Definition Types.h:248
@ Custom
User-defined basis.
Definition Types.h:251
@ Serendipity
Serendipity elements.
Definition Types.h:250
@ NURBS
Non-uniform rational B-splines (reserved; not yet implemented).
Definition Types.h:249
@ Mixed
Mixed/composite field.
Definition Types.h:262
@ Tensor
Tensor field (stress, strain).
Definition Types.h:260
@ Scalar
Scalar field (temperature, pressure).
Definition Types.h:258
@ SymmetricTensor
Symmetric tensor field.
Definition Types.h:261
@ C1
C1 continuous (for plates/shells).
Definition Types.h:270
@ H_curl
H(curl) conforming.
Definition Types.h:273
@ L2
L2 (discontinuous).
Definition Types.h:271
@ C0
Continuous (standard FEM).
Definition Types.h:269
@ H_div
H(div) conforming.
Definition Types.h:272
@ Vectorized
SIMD vectorized assembly.
Definition Types.h:282
@ ElementByElement
Traditional element loop.
Definition Types.h:281
@ MatrixFree
Matrix-free operators.
Definition Types.h:283
@ Hybrid
Mixed strategy.
Definition Types.h:284
@ Line2
2-node line
Definition Types.h:217
@ Triangle3
3-node triangle
Definition Types.h:218
@ Quad9
9-node quadrilateral (bi-quadratic)
Definition Types.h:228
@ Pyramid14
14-node pyramid
Definition Types.h:236
@ Pyramid5
5-node pyramid
Definition Types.h:223
@ Wedge6
6-node wedge/prism
Definition Types.h:222
@ Wedge15
15-node wedge
Definition Types.h:233
@ Quad4
4-node quadrilateral
Definition Types.h:219
@ Quad8
8-node quadrilateral (serendipity)
Definition Types.h:229
@ Unknown
Unrecognized or uninitialized element type.
Definition Types.h:241
@ Wedge18
18-node wedge (complete quadratic)
Definition Types.h:234
@ Line3
3-node line
Definition Types.h:226
@ Hex27
27-node hexahedron (tri-quadratic)
Definition Types.h:231
@ Point1
1-node point element
Definition Types.h:239
@ Triangle6
6-node triangle
Definition Types.h:227
@ Hex20
20-node hexahedron (serendipity)
Definition Types.h:232
@ Pyramid13
13-node pyramid
Definition Types.h:235
@ Tetra10
10-node tetrahedron
Definition Types.h:230
@ Hex8
8-node hexahedron
Definition Types.h:221
@ Tetra4
4-node tetrahedron
Definition Types.h:220
Tag type for basis-function gradients.
Definition Types.h:391
Tag type for basis-function values.
Definition Types.h:390
Tag type for global DOF indices.
Definition Types.h:392
Field value at an evaluation point — scalar, vector, or tensor.
Definition Types.h:194
double components[MAX_FIELD_VALUE_COMPONENTS]
Component values, row-major for tensors.
Definition Types.h:197
int n_components
Number of valid entries in components.
Definition Types.h:196
FieldId field
Field this value belongs to.
Definition Types.h:195
Tag type for quadrature-point indices.
Definition Types.h:388
Tag type for quadrature weights.
Definition Types.h:389
Check if a type represents a field type.
Definition Types.h:450
Check if a type is a valid index type.
Definition Types.h:431