specfem::mesh_entity::edge

template<specfem::element::dimension_tag DimensionTag>
struct edge

Edge entities for spectral element connectivity.

Template Parameters:

DimensionTag – Spatial dimension (2D or 3D)

Dimension-Specific Implementations

template<>
struct edge<specfem::element::dimension_tag::dim2>

2D edge entity for quadrilateral elements.

Public Functions

edge() = default

Default constructor.

Public Members

specfem::mesh_entity::dim2::type edge_type

Edge type.

int ispec

Element index.

int iedge

Local edge index.

bool reverse_orientation

Orientation flag.

specfem::mesh_entity::element

template<specfem::element::dimension_tag Dimension>
struct element

Element structure with coordinate mapping capabilities.

Template Parameters:

DimensionTag – Spatial dimension (2D or 3D)

Dimension-Specific Implementations

template<>
struct element<specfem::element::dimension_tag::dim2> : public specfem::mesh_entity::element_grid<specfem::element::dimension_tag::dim2, Grid<>>

2D element with coordinate mapping capabilities.

Public Functions

element() = default

Default constructor.

element(const int ngll)

Construct with uniform GLL points.

Parameters:

ngll – Number of GLL points in both directions

element(const int ngllz, const int ngllx)

Construct with different GLL points per direction.

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

  • ngllx – Number of GLL points in x-direction

Throws:

std::invalid_argument – if ngllz != ngllx

int number_of_points_on_orientation(const specfem::mesh_entity::dim2::type &entity) const

Get number of GLL points on a mesh entity.

Parameters:

entity – Mesh entity type (edge or corner)

Returns:

Number of GLL points on the specified entity

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

Map point index to element coordinates.

Parameters:
  • entity – Mesh entity type

  • point – Point index on the entity

Returns:

Tuple of (iz, ix) coordinates

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

Get corner coordinates.

Parameters:

corner – Corner entity type

Returns:

Tuple of (iz, ix) coordinates for the corner

inline void get_edge_coordinates(const specfem::mesh_entity::dim2::type edge, const int point, int &iz, int &ix) const

Get edge coordinates by 1D index.

Parameters:
  • edge – Edge entity type

  • point – Point index along the edge

  • iz[out] Z-coordinate in element

  • ix[out] X-coordinate in element

inline void get_corner_coordinates(const specfem::mesh_entity::dim2::type corner, int &iz, int &ix) const

Get corner coordinates.

Parameters:
  • corner – Corner entity type

  • iz[out] Z-coordinate in element

  • ix[out] X-coordinate in element

inline bool operator==(const int ngll_in) const

Check if element matches specified GLL point count.

Parameters:

ngll_in – Number of GLL points to compare against

Returns:

True if all dimensions match the specified count

inline bool operator!=(const int ngll_in) const

Check if element does not match specified GLL point count.

Parameters:

ngll_in – Number of GLL points to compare against

Returns:

True if any dimension does not match the specified count

Public Members

int ngllz

Number of GLL points in z-direction.

int ngllx

Number of GLL points in x-direction.

int ngll

Number of GLL points (ngllz == ngllx)

int orderz

Polynomial order in z.

int orderx

Polynomial order in x.

int size

Total number of GLL points.

template<>
struct element<specfem::element::dimension_tag::dim3> : public specfem::mesh_entity::element_grid<specfem::element::dimension_tag::dim3, Grid<>>

3D element with coordinate mapping capabilities.

Public Functions

element() = default

Default constructor.

element(const int ngll)

Construct with uniform GLL points.

Parameters:

ngll – Number of GLL points in all directions

element(const int ngllz, const int nglly, const int ngllx)

Construct with different GLL points per direction.

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

Throws:

std::runtime_error – if dimensions differ or < 2

int number_of_points_on_orientation(const specfem::mesh_entity::dim3::type &entity) const

Get number of GLL points on a mesh entity.

Parameters:

entity – Mesh entity type (face, edge, corner)

Returns:

Number of GLL points on the specified entity

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

Map point index to element coordinates.

Parameters:
  • entity – Mesh entity type

  • point – Point index on the entity

Returns:

Tuple of (iz, iy, ix) coordinates

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

Get corner coordinates.

Parameters:

corner – Corner entity type

Returns:

Tuple of (iz, iy, ix) coordinates for the corner

inline void get_face_coordinates(const specfem::mesh_entity::dim3::type face, const int ipoint, const int jpoint, int &iz, int &iy, int &ix) const

Get face coordinates by 2D indices.

Parameters:
  • face – Face entity type

  • ipoint – First face coordinate index

  • jpoint – Second face coordinate index

  • iz[out] Z-coordinate in element

  • iy[out] Y-coordinate in element

  • ix[out] X-coordinate in element

inline void get_edge_coordinates(const specfem::mesh_entity::dim3::type edge, const int point, int &iz, int &iy, int &ix) const

Get edge coordinates by 1D index.

Parameters:
  • edge – Edge entity type

  • point – Point index along the edge

  • iz[out] Z-coordinate in element

  • iy[out] Y-coordinate in element

  • ix[out] X-coordinate in element

inline void get_corner_coordinates(const specfem::mesh_entity::dim3::type corner, int &iz, int &iy, int &ix) const

Get corner coordinates.

Parameters:
  • corner – Corner entity type

  • iz[out] Z-coordinate in element

  • iy[out] Y-coordinate in element

  • ix[out] X-coordinate in element

inline bool operator==(const int ngll) const

Check if element matches specified GLL point count.

Parameters:

ngll – Number of GLL points to compare against

Returns:

True if all dimensions match the specified count

inline bool operator!=(const int ngll) const

Check if element does not match specified GLL point count.

Parameters:

ngll – Number of GLL points to compare against

Returns:

True if any dimension does not match the specified count

Public Members

int ngll2d

Points per 2D face.

int ngll

Points per direction.

int ngllz

Number of GLL points in z-direction.

int nglly

Number of GLL points in y-direction.

int ngllx

Number of GLL points in x-direction.

int orderz

Polynomial order in z.

int ordery

Polynomial order in y.

int orderx

Polynomial order in x.

int size

Total number of GLL points.

specfem::mesh_entity::element_grid

template<specfem::element::dimension_tag Dimension, typename G>
struct element_grid

Element grid structure with GLL point configuration.

Template Parameters:
  • DimensionTag – Spatial dimension (2D or 3D)

  • G – Grid extent tag; defaults to Grid<> (runtime variant).

Dimension-Specific Implementations

Warning

doxygenstruct: Cannot find class “specfem::mesh_entity::element_grid< specfem::element::dimension_tag::dim2 >” in doxygen xml output for project “specfem++” from directory: _build/doxygen/xml

Warning

doxygenstruct: Cannot find class “specfem::mesh_entity::element_grid< specfem::element::dimension_tag::dim3 >” in doxygen xml output for project “specfem++” from directory: _build/doxygen/xml

specfem::mesh_entity::dim2::type

enum class specfem::mesh_entity::dim2::type : int

Mesh entity types for 2D quadrilateral elements.

Numbering: edges (1-4), corners (5-8)

8 --- 3 --- 7
|           |
4           2
|           |
5 --- 1 --- 6

Values:

enumerator bottom

Bottom edge.

enumerator right

Right edge.

enumerator top

Top edge.

enumerator left

Left edge.

enumerator bottom_left

Bottom-left corner.

enumerator bottom_right

Bottom-right corner.

enumerator top_right

Top-right corner.

enumerator top_left

Top-left corner.

specfem::mesh_entity::dim3::type

enum class specfem::mesh_entity::dim3::type : int

Mesh entity types for 3D hexahedral elements.

6 faces (1-6), 12 edges (7-18), 8 corners (19-26)

   8 -------- 7
  /|         /|
 / |        / |
5 -------- 6  |
|  |       |  |
|  4 ------|--3
| /        | /
|/         |/
1 -------- 2

Values:

enumerator bottom

Bottom face of the element.

enumerator right

Right face of the element.

enumerator top

Top face of the element.

enumerator left

Left face of the element.

enumerator front

Front face of the element.

enumerator back

Back face of the element.

enumerator bottom_left

Bottom-left edge of the element.

enumerator bottom_right

Bottom-right edge of the element.

enumerator top_right

Top-right edge of the element.

enumerator top_left

Top-left edge of the element.

enumerator front_bottom

Front-bottom edge of the element.

enumerator front_top

Front-top edge of the element.

enumerator front_left

Front-left edge of the element.

enumerator front_right

Front-right edge of the element.

enumerator back_bottom

Back-bottom edge of the element.

enumerator back_top

Back-top edge of the element.

enumerator back_left

Back-left edge of the element.

enumerator back_right

Back-right edge of the element.

enumerator bottom_front_left

Bottom-front-left corner of the element.

enumerator bottom_front_right

Bottom-front-right corner of the element.

enumerator bottom_back_left

Bottom-back-left corner of the element.

enumerator bottom_back_right

Bottom-back-right corner of the element.

enumerator top_front_left

Top-front-left corner of the element.

enumerator top_front_right

Top-front-right corner of the element.

enumerator top_back_left

Top-back-left corner of the element.

enumerator top_back_right

Top-back-right corner of the element.

specfem::mesh_entity::dim2::to_string

const std::string specfem::mesh_entity::dim2::to_string(const specfem::mesh_entity::dim2::type &entity)

Convert entity type to string.

Parameters:

entity – Mesh entity type

Returns:

String representation

specfem::mesh_entity::dim3::to_string

const std::string specfem::mesh_entity::dim3::to_string(const specfem::mesh_entity::dim3::type &entity)

Convert entity type to string.

Parameters:

entity – Mesh entity type

Returns:

String representation

specfem::mesh_entity::dim2::edges

const std::list<type> specfem::mesh_entity::dim2::edges = {type::top, type::right, type::bottom, type::left}

All edge types in counter-clockwise order.

specfem::mesh_entity::dim2::corners

const std::list<type> specfem::mesh_entity::dim2::corners = {type::top_left, type::top_right, type::bottom_right, type::bottom_left}

All corner types in counter-clockwise order.

specfem::mesh_entity::dim3::edges

const std::list<specfem::mesh_entity::dim3::type> specfem::mesh_entity::dim3::edges = {type::bottom_left, type::bottom_right, type::top_right, type::top_left, type::front_bottom, type::front_top, type::front_left, type::front_right, type::back_bottom, type::back_top, type::back_left, type::back_right}

All edge types (12 connecting edges)

specfem::mesh_entity::dim3::corners

const std::list<specfem::mesh_entity::dim3::type> specfem::mesh_entity::dim3::corners = {type::bottom_front_left, type::bottom_front_right, type::bottom_back_left, type::bottom_back_right, type::top_front_left, type::top_front_right, type::top_back_left, type::top_back_right}

All corner types (8 vertices)

specfem::mesh_entity::dim3::faces

const std::list<specfem::mesh_entity::dim3::type> specfem::mesh_entity::dim3::faces = {type::bottom, type::right, type::top, type::left, type::front, type::back}

All face types (6 boundary surfaces)