specfem::point::local_coordinates

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

Struct to store local coordinates associated with a quadrature point.

Template Parameters:

DimensionTag – Dimension of the element where the quadrature point is located

Dimension-specific Specializations

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

2D local coordinates for spectral elements

Stores the element index and local coordinates ( \(\xi, \gamma\)) for a point within a 2D spectral element.

Public Functions

local_coordinates() = default

Default constructor.

inline local_coordinates(const int &ispec, const type_real &xi, const type_real &gamma)

Construct a new local coordinates object.

Parameters:
  • ispec – Index of the spectral element

  • xi – Local coordinate \( \xi \)

  • gamma – Local coordinate \( \gamma \)

template<typename ViewType>
inline local_coordinates(const int &ispec, const ViewType &coords)

Construct a new local coordinates object from element index and Kokkos array.

Parameters:
  • ispec – Index of the spectral element

  • coords – Kokkos 1D array containing [xi, gamma] coordinates

Public Members

int ispec

Index of the spectral element.

type_real xi

Local coordinate \( \xi \).

type_real gamma

Local coordinate \( \gamma \).

template<>
struct local_coordinates<specfem::element::dimension_tag::dim3>

3D local coordinates for spectral elements

Stores the element index and local coordinates ( \(\xi, \eta, \gamma\)) for a point within a 3D spectral element.

Public Functions

local_coordinates() = default

Default constructor.

inline local_coordinates(const int &ispec, const type_real &xi, const type_real &eta, const type_real &gamma)

Construct a new local coordinates object.

Parameters:
  • ispec – Index of the spectral element

  • xi – Local coordinate \( \xi \)

  • eta – Local coordinate \( \eta \)

  • gamma – Local coordinate \( \gamma \)

template<typename ViewType>
inline local_coordinates(const int &ispec, const ViewType &coords)

Construct a new local coordinates object from element index and Kokkos array.

Parameters:
  • ispec – Index of the spectral element

  • coords – Kokkos 1D array containing [xi, eta, gamma] coordinates

Public Members

int ispec

Index of the spectral element.

type_real xi

Local coordinate \( \xi \).

type_real eta

Local coordinate \( \eta \).

type_real gamma

Local coordinate \( \gamma \).

specfem::point::global_coordinates

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

Struct to store global coordinates associated with a quadrature point.

Template Parameters:

DimensionTag – Dimension of the element where the quadrature point is located

Dimension-specific Specializations

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

2D global coordinates

Stores the physical coordinates ( \(x, z\)) for a point in 2D space.

Public Functions

global_coordinates() = default

Default constructor.

inline global_coordinates(const type_real &x, const type_real &z)

Construct a new global coordinates object.

Parameters:
  • x – Global coordinate \( x \)

  • z – Global coordinate \( z \)

template<typename ViewType>
inline global_coordinates(const ViewType &coords)

Construct a new global coordinates object from Kokkos array.

Parameters:

coords – Kokkos 1D array containing [x, z] coordinates

inline Kokkos::Array<type_real, 2> coordinates() const

Get coordinates as a Kokkos::Array.

Returns:

Kokkos::Array<type_real, 2> containing [x, z] coordinates

Public Members

type_real x

Global coordinate \( x \).

type_real z

Global coordinate \( z \).

template<>
struct global_coordinates<specfem::element::dimension_tag::dim3>

3D global coordinates

Stores the physical coordinates ( \(x, y, z\)) for a point in 3D space.

Public Functions

global_coordinates() = default

Default constructor.

inline global_coordinates(const type_real &x, const type_real &y, const type_real &z)

Construct a new global coordinates object.

Parameters:
  • x – Global coordinate \( x \)

  • y – Global coordinate \( y \)

  • z – Global coordinate \( z \)

template<typename ViewType>
inline global_coordinates(const ViewType &coords)

Construct a new global coordinates object from Kokkos array.

Parameters:

coords – Kokkos 1D array containing [x, y, z] coordinates

inline Kokkos::Array<type_real, 3> coordinates() const

Get coordinates as a Kokkos::Array.

Returns:

Kokkos::Array<type_real, 3> containing [x, y, z] coordinates

Public Members

type_real x

Global coordinate \( x \).

type_real y

Global coordinate \( y \).

type_real z

Global coordinate \( z \).