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

template<>
struct mesh_to_compute_mapping<specfem::element::dimension_tag::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.h_compute_to_mesh(compute_index);
assert(mapping.h_mesh_to_compute(mesh_index) == compute_index);

Subclassed by specfem::assembly::mesh< specfem::element::dimension_tag::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

ViewType::host_mirror_type h_compute_to_mesh

Host access for compute_to_mesh

ViewType::host_mirror_type h_mesh_to_compute

Host access for mesh_to_compute

Public Static Attributes

static constexpr auto dimension_tag = specfem::element::dimension_tag::dim2

Dimension.