specfem::assembly::properties¶
-
template<specfem::element::dimension_tag DimensionTag>
struct properties : public specfem::assembly::impl::value_containers_base<DimensionTag, impl::domain_properties>¶ Spectral element material properties data container.
This class provides storage and data access functions for the material properties associated with spectral elements in spectral element mesh.
- Template Parameters:
DimensionTag – Spatial dimension (2D or 3D)
Public Functions
-
template<specfem::element::medium_tag MediumTag, specfem::element::property_tag PropertyTag>
inline int property_index_mapping(int ispec) const¶ Typed arithmetic index mapping replacing the old View-based lookup.
Returns the container-local index for a global element index
ispec. Valid for device and host code.
-
template<specfem::element::medium_tag MediumTag, specfem::element::property_tag PropertyTag>
inline constexpr containers_type<dimension_tag, MediumTag, PropertyTag> const &get_container() const¶ Returns the container for a given medium and property.
-
inline void copy_to_host()¶
Copy data to host.
Public Members
-
int nspec¶
Total number of spectral elements.
-
specfem::mesh_entity::element_grid<DimensionTag> element_grid¶
GLL grid layout
-
specfem::tag_dispatch::Storage<specfem::datatype::ElementIndexRange, decltype(combinations)> element_ranges¶
Per-(medium,property) element index range; enables arithmetic index mapping without a device View.
Dimension-Specific Implementations¶
Warning
doxygenstruct: Cannot find class “specfem::assembly::properties< specfem::element::dimension_tag::dim2 >” in doxygen xml output for project “specfem++” from directory: _build/doxygen/xml
Warning
doxygenstruct: Cannot find class “specfem::assembly::properties< specfem::element::dimension_tag::dim3 >” in doxygen xml output for project “specfem++” from directory: _build/doxygen/xml
Data Access Functions¶
-
template<typename PointPropertiesType, typename IndexType, typename std::enable_if_t<IndexType::using_simd == PointPropertiesType::simd::using_simd, int> = 0>
void load_on_device(const IndexType &lcoord, const specfem::assembly::properties<PointPropertiesType::dimension_tag> &properties, PointPropertiesType &point_properties)¶ Load material properties at a quadrature point on device memory.
This function retrieves material properties from the assembly properties container and loads them into a point properties structure for use in device-side computations.
The function is optimized for GPU execution with KOKKOS_FORCEINLINE_FUNCTION and supports both regular and SIMD operations depending on the template parameters. SIMD compatibility is enforced through SFINAE.
// Load elastic isotropic properties at a quadrature point specfem::point::index<...> coord(ispec, iz, ix); specfem::point::properties<specfem::tags::Tags<...>> props; load_on_device(coord, assembly.properties, props);
- Template Parameters:
PointPropertiesType – Material properties type (e.g., specfem::point::properties) Must specify medium_tag, property_tag, and dimension_tag
IndexType – Index type for quadrature point location (e.g., specfem::point::index) Must have compatible SIMD settings with PointPropertiesType
- Parameters:
lcoord – Local coordinate index specifying element and quadrature point location
properties – Assembly properties container holding all material data
point_properties – Output structure to receive the loaded material properties
-
template<typename PointPropertiesType, typename IndexType, typename std::enable_if_t<IndexType::using_simd == PointPropertiesType::simd::using_simd, int> = 0>
void load_on_host(const IndexType &lcoord, const specfem::assembly::properties<PointPropertiesType::dimension_tag> &properties, PointPropertiesType &point_properties)¶ Load material properties at a quadrature point on host memory.
This function retrieves material properties from the assembly properties container and loads them into a point properties structure for use in host-side computations.
The function is optimized for host execution and supports both regular and SIMD operations depending on the template parameters. SIMD compatibility is enforced through SFINAE.
// Load elastic isotropic properties at a quadrature point specfem::point::index<...> coord(ispec, iz, ix); specfem::point::properties<specfem::tags::Tags<...>> props; load_on_host(coord, assembly.properties, props);
- Template Parameters:
PointPropertiesType – Material properties type (e.g., specfem::point::properties) Must specify medium_tag, property_tag, and dimension_tag
IndexType – Index type for quadrature point location (e.g., specfem::point::index) Must have compatible SIMD settings with PointPropertiesType
- Parameters:
lcoord – Local coordinate index specifying element and quadrature point location
properties – Assembly properties container holding all material data
point_properties – Output structure to receive the loaded material properties
-
template<typename PointPropertiesType, typename IndexType, typename std::enable_if_t<IndexType::using_simd == PointPropertiesType::simd::using_simd, int> = 0>
void store_on_host(const IndexType &lcoord, const PointPropertiesType &point_properties, const specfem::assembly::properties<PointPropertiesType::dimension_tag> &properties)¶ Store material properties at a quadrature point in host memory.
This function writes material properties from a point properties structure into the assembly properties container’s host memory storage.
The function is designed for host-side operations such as initialization, post-processing, debugging, or I/O operations. It supports both regular and SIMD operations with SIMD compatibility enforced through SFINAE. This is the counterpart to load_on_host for bidirectional data access.
// Store modified elastic properties back to host memory specfem::point::index<...> coord(ispec, iz, ix); specfem::point::properties<specfem::tags::Tags<...>> props; // Modify properties (e.g., after inversion or processing) props.rho = updated_density; props.lambda = updated_lambda; props.mu = updated_mu; store_on_host(coord, props, assembly.properties);
- Template Parameters:
PointPropertiesType – Material properties type (e.g., specfem::point::properties) Must specify medium_tag, property_tag, and dimension_tag
IndexType – Index type for quadrature point location (e.g., specfem::point::index) Must have compatible SIMD settings with PointPropertiesType
- Parameters:
lcoord – Local coordinate index specifying element and quadrature point location
point_properties – Input structure containing material properties to store
properties – Assembly properties container to receive the material data