SpECTRE  v2024.03.19
evolution::dg::MortarData< Dim > Class Template Reference

Data on the mortar used to compute the boundary correction for the DG scheme. More...

#include <MortarData.hpp>

Public Member Functions

 MortarData (size_t number_of_buffers=1)
 
void insert_local_geometric_quantities (const Scalar< DataVector > &local_volume_det_inv_jacobian, const Scalar< DataVector > &local_face_det_jacobian, const Scalar< DataVector > &local_face_normal_magnitude)
 Insert the magnitude of the local face normal, the determinant of the volume inverse Jacobian, and the determinant of the face Jacobian. Used for local time stepping with Gauss points. More...
 
void insert_local_face_normal_magnitude (const Scalar< DataVector > &local_face_normal_magnitude)
 Insert the magnitude of the local face normal. Used for local time stepping with Gauss-Lobatto points. More...
 
void get_local_volume_det_inv_jacobian (gsl::not_null< Scalar< DataVector > * > local_volume_det_inv_jacobian) const
 Sets the local_volume_det_inv_jacobian by setting the DataVector to point into the MortarData's internal storage. More...
 
void get_local_face_det_jacobian (gsl::not_null< Scalar< DataVector > * > local_face_det_jacobian) const
 Sets the local_face_det_jacobian by setting the DataVector to point into the MortarData's internal storage. More...
 
void get_local_face_normal_magnitude (gsl::not_null< Scalar< DataVector > * > local_face_normal_magnitude) const
 Sets the local_face_normal_magnitude by setting the DataVector to point into the MortarData's internal storage. More...
 
auto extract () -> std::pair< std::pair< Mesh< Dim - 1 >, DataVector >, std::pair< Mesh< Dim - 1 >, DataVector > >
 Return the inserted data and reset the state to empty. More...
 
void next_buffer ()
 Move to the next internal mortar buffer.
 
size_t current_buffer_index () const
 Return the current internal mortar index.
 
size_t total_number_of_buffers () const
 Return the total number of buffers that this MortarData was constructed with.
 
const TimeStepIdtime_step_id () const
 
TimeStepIdtime_step_id ()
 
auto local_mortar_data () const -> const std::optional< std::pair< Mesh< Dim - 1 >, DataVector > > &
 
auto neighbor_mortar_data () const -> const std::optional< std::pair< Mesh< Dim - 1 >, DataVector > > &
 
auto local_mortar_data () -> std::optional< std::pair< Mesh< Dim - 1 >, DataVector > > &
 
auto neighbor_mortar_data () -> std::optional< std::pair< Mesh< Dim - 1 >, DataVector > > &
 
void pup (PUP::er &p)
 
std::string pretty_print_current_buffer_no_data (size_t padding_size) const
 
void insert_local_mortar_data (TimeStepId time_step_id, Mesh< Dim - 1 > local_interface_mesh, DataVector local_mortar_vars)
 Insert data onto the mortar. More...
 
void insert_neighbor_mortar_data (TimeStepId time_step_id, Mesh< Dim - 1 > neighbor_interface_mesh, DataVector neighbor_mortar_vars)
 Insert data onto the mortar. More...
 

Friends

template<size_t LocalDim>
bool operator== (const MortarData< LocalDim > &lhs, const MortarData< LocalDim > &rhs)
 

Detailed Description

template<size_t Dim>
class evolution::dg::MortarData< Dim >

Data on the mortar used to compute the boundary correction for the DG scheme.

The class holds the local data that has been projected to the mortar as well as the neighbor data that has been projected to the mortar. The local and neighbor data is later used to compute the same unique boundary correction on the mortar for both elements. That is, the final boundary correction computation is done twice: once on each element touching the mortar. However, the computation is done in such a way that the results agree.

In addition to the (type-erased) fields on both sides of the mortar, the face (not mortar!) mesh of the neighbor is stored. The mesh will be necessary when hybridizing DG with finite difference or finite volume schemes (DG-subcell).

If the element and its neighbor have unaligned logical coordinate systems then the data is stored in the local logical coordinate's orientation ( \(\xi\) varies fastest). This means the action sending the data is responsible for reorienting the data on the mortar so it matches the neighbor's orientation.

Template Parameters
Dimthe volume dimension of the mesh

Member Function Documentation

◆ extract()

template<size_t Dim>
auto evolution::dg::MortarData< Dim >::extract ( ) -> std::pair< std::pair< Mesh< Dim - 1 >, DataVector >, std::pair< Mesh< Dim - 1 >, DataVector > >

Return the inserted data and reset the state to empty.

The first element is the local data while the second element is the neighbor data.

◆ get_local_face_det_jacobian()

template<size_t Dim>
void evolution::dg::MortarData< Dim >::get_local_face_det_jacobian ( gsl::not_null< Scalar< DataVector > * >  local_face_det_jacobian) const

Sets the local_face_det_jacobian by setting the DataVector to point into the MortarData's internal storage.

Warning
The result should never be changed.

◆ get_local_face_normal_magnitude()

template<size_t Dim>
void evolution::dg::MortarData< Dim >::get_local_face_normal_magnitude ( gsl::not_null< Scalar< DataVector > * >  local_face_normal_magnitude) const

Sets the local_face_normal_magnitude by setting the DataVector to point into the MortarData's internal storage.

Warning
The result should never be changed.

◆ get_local_volume_det_inv_jacobian()

template<size_t Dim>
void evolution::dg::MortarData< Dim >::get_local_volume_det_inv_jacobian ( gsl::not_null< Scalar< DataVector > * >  local_volume_det_inv_jacobian) const

Sets the local_volume_det_inv_jacobian by setting the DataVector to point into the MortarData's internal storage.

Warning
The result should never be changed.

◆ insert_local_face_normal_magnitude()

template<size_t Dim>
void evolution::dg::MortarData< Dim >::insert_local_face_normal_magnitude ( const Scalar< DataVector > &  local_face_normal_magnitude)

Insert the magnitude of the local face normal. Used for local time stepping with Gauss-Lobatto points.

The magnitude of the face normal is given by:

\begin{align*} \sqrt{ \frac{\partial\xi}{\partial x^i} \gamma^{ij} \frac{\partial\xi}{\partial x^j}} \end{align*}

for a face in the \(\xi\)-direction, with inverse spatial metric \(\gamma^{ij}\).

◆ insert_local_geometric_quantities()

template<size_t Dim>
void evolution::dg::MortarData< Dim >::insert_local_geometric_quantities ( const Scalar< DataVector > &  local_volume_det_inv_jacobian,
const Scalar< DataVector > &  local_face_det_jacobian,
const Scalar< DataVector > &  local_face_normal_magnitude 
)

Insert the magnitude of the local face normal, the determinant of the volume inverse Jacobian, and the determinant of the face Jacobian. Used for local time stepping with Gauss points.

The magnitude of the face normal is given by:

\begin{align*} \sqrt{ \frac{\partial\xi}{\partial x^i} \gamma^{ij} \frac{\partial\xi}{\partial x^j}} \end{align*}

for a face in the \(\xi\)-direction, with inverse spatial metric \(\gamma^{ij}\).

◆ insert_local_mortar_data()

template<size_t Dim>
void evolution::dg::MortarData< Dim >::insert_local_mortar_data ( TimeStepId  time_step_id,
Mesh< Dim - 1 >  local_interface_mesh,
DataVector  local_mortar_vars 
)

Insert data onto the mortar.

Exactly one local and neighbor insert call must be made between calls to extract().

The insert functions require that:

  • the data is inserted only once
  • the TimeStepId of the local and neighbor data are the same (this is only checked if the local/neighbor data was already inserted)
Note
it is not required that the number of grid points between the local and neighbor data be the same since one may be using FD/FV instead of DG and this switch is done locally in space and time in such a way that neighboring elements have no a priori knowledge about what well be received.

◆ insert_neighbor_mortar_data()

template<size_t Dim>
void evolution::dg::MortarData< Dim >::insert_neighbor_mortar_data ( TimeStepId  time_step_id,
Mesh< Dim - 1 >  neighbor_interface_mesh,
DataVector  neighbor_mortar_vars 
)

Insert data onto the mortar.

Exactly one local and neighbor insert call must be made between calls to extract().

The insert functions require that:

  • the data is inserted only once
  • the TimeStepId of the local and neighbor data are the same (this is only checked if the local/neighbor data was already inserted)
Note
it is not required that the number of grid points between the local and neighbor data be the same since one may be using FD/FV instead of DG and this switch is done locally in space and time in such a way that neighboring elements have no a priori knowledge about what well be received.

The documentation for this class was generated from the following file: