specfem::chunk_element::displacement¶
-
template<int ChunkSize, int NGLL, specfem::dimension::type DimensionTag, specfem::element::medium_tag MediumTag, bool UseSIMD>
class displacement : public specfem::chunk_element::impl::field<ChunkSize, NGLL, DimensionTag, MediumTag, specfem::data_access::DataClassType::displacement, UseSIMD>¶ Chunk element displacement field accessor for high-performance spectral element computations.
This class provides a specialized interface for accessing and manipulating displacement field data across chunks of spectral elements. It inherits all functionality from the base chunk element field implementation while being specifically typed for displacement data.
The displacement class is optimized for processing multiple elements simultaneously (chunk-based processing), which improves cache locality and enables vectorization.
See also
specfem::chunk_element::velocity for velocity field accessor
See also
specfem::chunk_element::acceleration for acceleration field accessor
- Template Parameters:
ChunkSize – Number of elements processed together in a chunk for optimal performance
NGLL – Number of Gauss-Lobatto-Legendre points per spatial dimension
DimensionTag – Spatial dimension (dim2 or dim3) of the displacement field
MediumTag – Medium type (acoustic, elastic, poroelastic, etc.)
UseSIMD – Whether to enable SIMD vectorization for performance optimization
Public Types
-
using simd = typename base_type::simd¶
SIMD type for vectorized displacement operations across chunks.
-
using value_type = typename base_type::value_type¶
Vector type for storing displacement data with chunk-optimized layout.
-
template<typename T, int nelements, int ngll>
using scalar_type = specfem::datatype::ScalarChunkElementViewType<T, DimensionTag, nelements, ngll, UseSIMD>¶ Scalar field storage for chunked elements.
- Template Parameters:
T – Base data type
nelements – Number of elements in the chunk
ngll – Number of GLL points per element dimension
-
template<typename T, int nelements, int ngll, int components>
using vector_type = specfem::datatype::VectorChunkElementViewType<T, DimensionTag, nelements, ngll, components, UseSIMD>¶ Vector field storage for chunked elements.
- Template Parameters:
T – Base data type
nelements – Number of elements in the chunk
ngll – Number of GLL points per element dimension
components – Number of vector components
-
template<typename T, int nelements, int ngll, int components, int dimension>
using tensor_type = specfem::datatype::TensorChunkElementViewType<T, DimensionTag, nelements, ngll, components, dimension, UseSIMD>¶ Tensor field storage for chunked elements.
- Template Parameters:
T – Base data type
nelements – Number of elements in the chunk
ngll – Number of GLL points per element dimension
components – Number of tensor components
dimension – Spatial dimension
Public Functions
-
template<typename ...Indices>
inline value_type::value_type &operator()(Indices... indices) const¶ Multi-dimensional index operator for accessing field components.
Provides access to individual field values using multi-dimensional indexing. For chunk element fields, the indexing typically follows the pattern: (element_id, gll_indices…, component_id).
// For 2D fields: (element, i_gll, j_gll, component) auto disp_x = field(ielem, i, j, 0); // x-component auto disp_z = field(ielem, i, j, 1); // z-component field(ielem, i, j, 0) = new_value; // For 3D fields: (element, i_gll, j_gll, k_gll, component) auto value = field(ielem, i, j, k, icomp);
- Template Parameters:
Indices – Parameter pack for multi-dimensional indices
- Parameters:
indices – The indices specifying the location and component to access
- Returns:
Reference to the field value at the specified location
-
inline const value_type &get_data() const¶
Access internal field data storage.
- Returns:
const reference to the internal value_type storing field components
Public Static Functions
-
static inline constexpr std::size_t shmem_size()¶
Get the shared memory size required for this field type.
Returns the amount of shared memory (in bytes) required to allocate storage for this field type. This is used for Kokkos team scratch memory allocation.
// Example: Allocating team scratch memory auto policy = Kokkos::TeamPolicy<>(num_teams, team_size) .set_scratch_size(0, Kokkos::PerTeam(DisplacementField::shmem_size()));
- Returns:
Size in bytes required for field storage
Public Static Attributes
-
static constexpr int components = specfem::element::attributes<DimensionTag, MediumTag>::components¶
Number of field components based on dimension and medium type.
-
static constexpr auto dimension_tag = DimensionTag¶
Dimension tag identifying the physical medium type.
-
static constexpr auto accessor_type = specfem::data_access::AccessorType::chunk_element¶
Accessor pattern identifier.
-
static constexpr auto data_class = DataClass¶
Data classification type.
Private Types
-
using base_type = impl::field<ChunkSize, NGLL, DimensionTag, MediumTag, specfem::data_access::DataClassType::displacement, UseSIMD>¶
Type alias for the base chunk element field implementation.
Private Members
-
value_type m_data¶
Internal storage for chunk field data.
specfem::chunk_element::velocity¶
-
template<int ChunkSize, int NGLL, specfem::dimension::type DimensionTag, specfem::element::medium_tag MediumTag, bool UseSIMD>
class velocity : public specfem::chunk_element::impl::field<ChunkSize, NGLL, DimensionTag, MediumTag, specfem::data_access::DataClassType::velocity, UseSIMD>¶ Chunk element velocity field accessor for high-performance spectral element computations.
This class provides a specialized interface for accessing and manipulating velocity field data across chunks of spectral elements. It inherits all functionality from the base chunk element field implementation while being specifically typed for velocity data.
The velocity class is optimized for processing multiple elements simultaneously (chunk-based processing), which improves cache locality and enables vectorization.
See also
specfem::chunk_element::displacement for displacement field accessor
See also
specfem::chunk_element::acceleration for acceleration field accessor
- Template Parameters:
ChunkSize – Number of elements processed together in a chunk for optimal performance
NGLL – Number of Gauss-Lobatto-Legendre points per spatial dimension
DimensionTag – Spatial dimension (dim2 or dim3) of the velocity field
MediumTag – Medium type (acoustic, elastic, poroelastic, etc.)
UseSIMD – Whether to enable SIMD vectorization for performance optimization
Public Types
-
using value_type = typename base_type::value_type¶
Vector type for storing velocity data with chunk-optimized layout.
-
template<typename T, int nelements, int ngll>
using scalar_type = specfem::datatype::ScalarChunkElementViewType<T, DimensionTag, nelements, ngll, UseSIMD>¶ Scalar field storage for chunked elements.
- Template Parameters:
T – Base data type
nelements – Number of elements in the chunk
ngll – Number of GLL points per element dimension
-
template<typename T, int nelements, int ngll, int components>
using vector_type = specfem::datatype::VectorChunkElementViewType<T, DimensionTag, nelements, ngll, components, UseSIMD>¶ Vector field storage for chunked elements.
- Template Parameters:
T – Base data type
nelements – Number of elements in the chunk
ngll – Number of GLL points per element dimension
components – Number of vector components
-
template<typename T, int nelements, int ngll, int components, int dimension>
using tensor_type = specfem::datatype::TensorChunkElementViewType<T, DimensionTag, nelements, ngll, components, dimension, UseSIMD>¶ Tensor field storage for chunked elements.
- Template Parameters:
T – Base data type
nelements – Number of elements in the chunk
ngll – Number of GLL points per element dimension
components – Number of tensor components
dimension – Spatial dimension
Public Functions
-
template<typename ...Indices>
inline value_type::value_type &operator()(Indices... indices) const¶ Multi-dimensional index operator for accessing field components.
Provides access to individual field values using multi-dimensional indexing. For chunk element fields, the indexing typically follows the pattern: (element_id, gll_indices…, component_id).
// For 2D fields: (element, i_gll, j_gll, component) auto disp_x = field(ielem, i, j, 0); // x-component auto disp_z = field(ielem, i, j, 1); // z-component field(ielem, i, j, 0) = new_value; // For 3D fields: (element, i_gll, j_gll, k_gll, component) auto value = field(ielem, i, j, k, icomp);
- Template Parameters:
Indices – Parameter pack for multi-dimensional indices
- Parameters:
indices – The indices specifying the location and component to access
- Returns:
Reference to the field value at the specified location
-
inline const value_type &get_data() const¶
Access internal field data storage.
- Returns:
const reference to the internal value_type storing field components
Public Static Functions
-
static inline constexpr std::size_t shmem_size()¶
Get the shared memory size required for this field type.
Returns the amount of shared memory (in bytes) required to allocate storage for this field type. This is used for Kokkos team scratch memory allocation.
// Example: Allocating team scratch memory auto policy = Kokkos::TeamPolicy<>(num_teams, team_size) .set_scratch_size(0, Kokkos::PerTeam(DisplacementField::shmem_size()));
- Returns:
Size in bytes required for field storage
Public Static Attributes
-
static constexpr int components = specfem::element::attributes<DimensionTag, MediumTag>::components¶
Number of field components based on dimension and medium type.
-
static constexpr auto dimension_tag = DimensionTag¶
Dimension tag identifying the physical medium type.
-
static constexpr auto accessor_type = specfem::data_access::AccessorType::chunk_element¶
Accessor pattern identifier.
-
static constexpr auto data_class = DataClass¶
Data classification type.
Private Types
-
using base_type = impl::field<ChunkSize, NGLL, DimensionTag, MediumTag, specfem::data_access::DataClassType::velocity, UseSIMD>¶
Type alias for the base chunk element field implementation.
Private Members
-
value_type m_data¶
Internal storage for chunk field data.
specfem::chunk_element::acceleration¶
-
template<int ChunkSize, int NGLL, specfem::dimension::type DimensionTag, specfem::element::medium_tag MediumTag, bool UseSIMD>
class acceleration : public specfem::chunk_element::impl::field<ChunkSize, NGLL, DimensionTag, MediumTag, specfem::data_access::DataClassType::acceleration, UseSIMD>¶ Chunk element acceleration field accessor for high-performance spectral element computations.
This class provides a specialized interface for accessing and manipulating acceleration field data across chunks of spectral elements. It inherits all functionality from the base chunk element field implementation while being specifically typed for acceleration data.
The acceleration class is optimized for processing multiple elements simultaneously (chunk-based processing), which improves cache locality and enables vectorization.
See also
specfem::chunk_element::velocity for velocity field accessor
See also
specfem::chunk_element::displacement for displacement field accessor
- Template Parameters:
ChunkSize – Number of elements processed together in a chunk for optimal performance
NGLL – Number of Gauss-Lobatto-Legendre points per spatial dimension
DimensionTag – Spatial dimension (dim2 or dim3) of the acceleration field
MediumTag – Medium type (acoustic, elastic, poroelastic, etc.)
UseSIMD – Whether to enable SIMD vectorization for performance optimization
Public Types
-
using simd = typename base_type::simd¶
SIMD type for vectorized acceleration operations across chunks.
-
using value_type = typename base_type::value_type¶
Vector type for storing acceleration data with chunk-optimized layout.
-
template<typename T, int nelements, int ngll>
using scalar_type = specfem::datatype::ScalarChunkElementViewType<T, DimensionTag, nelements, ngll, UseSIMD>¶ Scalar field storage for chunked elements.
- Template Parameters:
T – Base data type
nelements – Number of elements in the chunk
ngll – Number of GLL points per element dimension
-
template<typename T, int nelements, int ngll, int components>
using vector_type = specfem::datatype::VectorChunkElementViewType<T, DimensionTag, nelements, ngll, components, UseSIMD>¶ Vector field storage for chunked elements.
- Template Parameters:
T – Base data type
nelements – Number of elements in the chunk
ngll – Number of GLL points per element dimension
components – Number of vector components
-
template<typename T, int nelements, int ngll, int components, int dimension>
using tensor_type = specfem::datatype::TensorChunkElementViewType<T, DimensionTag, nelements, ngll, components, dimension, UseSIMD>¶ Tensor field storage for chunked elements.
- Template Parameters:
T – Base data type
nelements – Number of elements in the chunk
ngll – Number of GLL points per element dimension
components – Number of tensor components
dimension – Spatial dimension
Public Functions
-
template<typename ...Indices>
inline value_type::value_type &operator()(Indices... indices) const¶ Multi-dimensional index operator for accessing field components.
Provides access to individual field values using multi-dimensional indexing. For chunk element fields, the indexing typically follows the pattern: (element_id, gll_indices…, component_id).
// For 2D fields: (element, i_gll, j_gll, component) auto disp_x = field(ielem, i, j, 0); // x-component auto disp_z = field(ielem, i, j, 1); // z-component field(ielem, i, j, 0) = new_value; // For 3D fields: (element, i_gll, j_gll, k_gll, component) auto value = field(ielem, i, j, k, icomp);
- Template Parameters:
Indices – Parameter pack for multi-dimensional indices
- Parameters:
indices – The indices specifying the location and component to access
- Returns:
Reference to the field value at the specified location
-
inline const value_type &get_data() const¶
Access internal field data storage.
- Returns:
const reference to the internal value_type storing field components
Public Static Functions
-
static inline constexpr std::size_t shmem_size()¶
Get the shared memory size required for this field type.
Returns the amount of shared memory (in bytes) required to allocate storage for this field type. This is used for Kokkos team scratch memory allocation.
// Example: Allocating team scratch memory auto policy = Kokkos::TeamPolicy<>(num_teams, team_size) .set_scratch_size(0, Kokkos::PerTeam(DisplacementField::shmem_size()));
- Returns:
Size in bytes required for field storage
Public Static Attributes
-
static constexpr int components = specfem::element::attributes<DimensionTag, MediumTag>::components¶
Number of field components based on dimension and medium type.
-
static constexpr auto dimension_tag = DimensionTag¶
Dimension tag identifying the physical medium type.
-
static constexpr auto accessor_type = specfem::data_access::AccessorType::chunk_element¶
Accessor pattern identifier.
-
static constexpr auto data_class = DataClass¶
Data classification type.
Private Types
-
using base_type = impl::field<ChunkSize, NGLL, DimensionTag, MediumTag, specfem::data_access::DataClassType::acceleration, UseSIMD>¶
Type alias for the base chunk element field implementation.
Private Members
-
value_type m_data¶
Internal storage for chunk field data.