2D specfem::assembly::mesh_impl::mesh_to_compute_mapping

template<>
struct mesh_to_compute_mapping<specfem::dimension::type::dim2>

Mapping between spectral element indexing within specfem::mesh::mesh and specfem::assembly::mesh.

We reorder the mesh to enable better memory access patterns when computing forces.

To access the mapping, use the following:

// Mapping from compute ordering to mesh ordering
const int compute_index = ...;
int mesh_index = mapping.compute_to_mesh(compute_index);
assert(mapping.mesh_to_compute(mesh_index) == compute_index);

Subclassed by specfem::assembly::mesh< specfem::dimension::type::dim2 >

Public Functions

mesh_to_compute_mapping() = default

Construct a new mesh to compute mapping object.

mesh_to_compute_mapping(const specfem::mesh::tags<dimension_tag> &tags)

Construct a new mesh to compute mapping object.

Parameters:

tags – Tags for every spectral element within the mesh

Public Members

int nspec

Number of spectral elements.

ViewType compute_to_mesh

Mapping from compute ordering to mesh ordering

ViewType mesh_to_compute

Mapping from mesh ordering to compute ordering

Public Static Attributes

static constexpr auto dimension_tag = specfem::dimension::type::dim2

Dimension.