specfem::connections::type

enum class specfem::connections::type : int

Connection conformity types between mesh elements.

Values:

enumerator strongly_conforming

Nodes match exactly.

enumerator weakly_conforming

Nodes match, shape functions may be discontinuous.

enumerator nonconforming

No matching nodes, geometrically adjacent.

specfem::connections::to_string

const std::string specfem::connections::to_string(const specfem::connections::type &conn)

Convert connection type to string.

Parameters:

conn – Connection type

Returns:

String representation

specfem::connections::connection_mapping

template<specfem::dimension::type DimensionTag>
class connection_mapping

Coordinate mapping between adjacent spectral elements.

Transforms coordinates between mesh entities (faces, edges) of adjacent elements with different orientations.

// 2D example
connection_mapping<dim2> mapping(ngllz, ngllx, elem1_nodes, elem2_nodes);
auto [iz_mapped, ix_mapped] = mapping.map_coordinates(
    mesh_entity::left, mesh_entity::right, iz, ix);

Template Parameters:

DimensionTag – Spatial dimension (2D or 3D)

specfem::connections::to_string

const std::string specfem::connections::to_string(const specfem::connections::type &conn)

Convert connection type to string.

Parameters:

conn – Connection type

Returns:

String representation

Dimension-Specific Implementations

template<>
class connection_mapping<specfem::dimension::type::dim2>

2D coordinate mapping between adjacent spectral elements.

Maps coordinates between mesh entities (edges, corners) of adjacent quadrilateral elements.

Public Functions

inline connection_mapping(const int ngllz, const int ngllx, ElementIndexView element1, ElementIndexView element2)

Construct 2D connection mapping.

Parameters:
  • ngllz – Number of GLL points in z-direction

  • ngllx – Number of GLL points in x-direction

  • element1 – Control node indices for first element

  • element2 – Control node indices for second element

Throws:

std::runtime_error – if elements have different node counts

std::tuple<int, int> map_coordinates(const specfem::mesh_entity::dim2::type &from, const specfem::mesh_entity::dim2::type &to, const int iz, const int ix) const

Map coordinates between mesh entities.

Parameters:
  • from – Source entity on element1

  • to – Target entity on element2

  • iz – Grid index in z-direction

  • ix – Grid index in x-direction

Returns:

Mapped coordinates (iz’, ix’) on target entity

std::tuple<int, int> map_coordinates(const specfem::mesh_entity::dim2::type &from, const specfem::mesh_entity::dim2::type &to) const

Map coordinates for corner entities.

Parameters:
  • from – Source entity on element1

  • to – Target entity on element2

Returns:

Base mapped coordinates for entity transformation

template<>
class connection_mapping<specfem::dimension::type::dim3>

3D coordinate mapping between adjacent hexahedral elements.

Maps coordinates between faces, edges, and corners of adjacent 3D elements using affine transformations and permutation handling.

connection_mapping<dim3> mapping(5, 5, 5, elem1_nodes, elem2_nodes);
auto [iz, iy, ix] = mapping.map_coordinates(
    mesh_entity::left, mesh_entity::right, 2, 1, 0);

Public Functions

inline connection_mapping(const int ngllz, const int nglly, const int ngllx, ElementIndexView element1, ElementIndexView element2)

Construct 3D connection mapping.

Parameters:
  • ngllz – Number of GLL points in z-direction

  • nglly – Number of GLL points in y-direction

  • ngllx – Number of GLL points in x-direction

  • element1 – Control node indices for first element

  • element2 – Control node indices for second element

Throws:

std::runtime_error – if elements have different node counts

std::tuple<int, int, int> map_coordinates(const specfem::mesh_entity::dim3::type &from, const specfem::mesh_entity::dim3::type &to, const int iz, const int iy, const int ix) const

Map coordinates between mesh entities.

Parameters:
  • from – Source entity on element1

  • to – Target entity on element2

  • iz – Grid index in z-direction

  • iy – Grid index in y-direction

  • ix – Grid index in x-direction

Returns:

Mapped coordinates (iz’, iy’, ix’) on target entity

std::tuple<int, int, int> map_coordinates(const specfem::mesh_entity::dim3::type &from, const specfem::mesh_entity::dim3::type &to) const

Map coordinates for corner entities.

Parameters:
  • from – Source entity on element1

  • to – Target entity on element2

Returns:

Base mapped coordinates for entity transformation

Public Static Attributes

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

Dimension tag for 3D spectral elements.