specfem::mesh::materials< specfem::element::dimension_tag::dim2 >::material_specification

template<>
struct material_specification

Public Functions

material_specification() = default

Default constructor.

inline material_specification(specfem::element::medium_tag type, specfem::element::property_tag property, specfem::element::attenuation_tag attenuation, int index, int database_index)

Constructor used to assign values.

Parameters:
  • type – Type of element

  • property – Property of element

  • index – Index of material property

Public Members

specfem::element::medium_tag type

Type of element.

specfem::element::property_tag property

Property of element.

specfem::element::attenuation_tag attenuation

Attenuation type.

int index

Index of material property.

int database_index

Index of material property in the database.

specfem::mesh::materials< specfem::element::dimension_tag::dim2 >::material

template<>
struct material

Public Members

int n_materials = 0

Number of different materials.

std::vector<specfem::medium_container::material<dimension_tag, type, property, attenuation>> element_materials

Material properties.

specfem::mesh::materials< specfem::element::dimension_tag::dim3 >::material_specification

template<>
struct material_specification

Material specification linking elements to material database entries.

Associates spectral elements with their corresponding material types and database indices from MESHFEM3D material files. This structure provides the mapping between mesh topology and material properties.

Used internally to maintain the association between:

  • Element indices in the mesh

  • Material types (medium + property combinations)

  • Original database indices from MESHFEM3D input files

  • Local indices within type-specific material containers

Public Functions

material_specification() = default

Default constructor initializing with default values.

inline material_specification(specfem::element::medium_tag type, specfem::element::property_tag property, specfem::element::attenuation_tag attenuation, int index, int database_index)

Construct material specification from components.

Parameters:
  • type – Physical medium type for wave equation selection

  • property – Material property type for constitutive relations

  • index – Local material index within container

  • database_index – Original MESHFEM3D database index

Public Members

specfem::element::medium_tag type

Physical medium type (acoustic, elastic, etc.)

specfem::element::property_tag property

Material property type (isotropic, anisotropic)

specfem::element::attenuation_tag attenuation

Attenuation type (none, constant_isotropic, etc.)

int index

Local index within the type-specific material container.

int database_index

Original database index from MESHFEM3D material files.

specfem::mesh::materials< specfem::element::dimension_tag::dim3 >::material

template<>
struct material

Template container for materials of specific type and property.

Stores material objects of a specific medium/property combination with count tracking for efficient memory management. Each container holds materials of exactly one type (e.g., all elastic isotropic materials).

This design enables:

  • Type-safe material storage and retrieval

  • Efficient memory layout for materials of the same type

  • Compile-time optimization based on material properties

  • Integration with SPECFEM++ template metaprogramming system

Template Parameters:
  • type – Medium type (acoustic, elastic)

  • property – Property type (isotropic, anisotropic)

Public Functions

inline material()

Default constructor creating empty container.

material(const int n_materials, const std::vector<specfem::medium_container::material<dimension_tag, type, property, attenuation>> &l_material)

Construct container from existing material vector.

Parameters:
  • n_materials – Number of materials to store

  • l_material – Vector of materials to initialize container with

Public Members

int n_materials = 0

Number of materials stored in this container.

std::vector<specfem::medium_container::material<dimension_tag, type, property, attenuation>> element_materials

Storage for material objects of this type/property combination.