SpECTRE  v2025.08.19
evolution::dg Namespace Reference

Functionality for evolving hyperbolic partial differential equations using the discontinuous Galerkin method. More...

Namespaces

namespace  Actions
 Actions for using the discontinuous Galerkin to evolve hyperbolic partial differential equations.
 
namespace  Initialization
 Functionality for initializing the discontinuous Galerkin to evolve hyperbolic partial differential equations.
 
namespace  subcell
 Combine the volume subcell variables and the ghost variables contained as DataVector into a single combined DataVector.
 
namespace  Tags
 Tags used for DG evolution scheme.
 

Classes

struct  ApplyBoundaryCorrections
 Apply corrections from boundary communication. More...
 
struct  AtomicInboxBoundaryData
 Holds the data in the different directions for the nodegroup DgElementArray implementation. More...
 
struct  BackgroundGrVars
 Allocate or assign background general relativity quantities needed for evolution systems run on a curved spacetime without solving Einstein equations (e.g. ValenciaDivclean, ForceFree). More...
 
struct  BoundaryData
 The data communicated between neighber elements. More...
 
struct  BoundaryMessage
 [Charm++ Message] (https://charm.readthedocs.io/en/latest/charm%2B%2B/manual.html#messages) intended to be used in receive_data calls on the elements to send boundary data from one element on one node, to a different element on a (potentially) different node. More...
 
struct  CleanMortarHistory
 Mutator to remove old entries from the mortar histories in a local-time-stepping DG evolution. More...
 
struct  InboxBoundaryData
 Class wrapping a map and mirroring the AtomicInboxBoundaryData interface so that code accessing the inbox doesn't need to care which implementation is in use. More...
 
class  InterpolatedBoundaryData
 Information sent by a non-conforming Element that interpolates its boundary data to a subset of the points of the Element receiving this. More...
 
struct  is_atomic_inbox_boundary_data
 std::true if T is a AtomicInboxBoundaryData More...
 
struct  MortarData
 Data on the mortar used to compute the boundary correction for the DG scheme. More...
 
class  MortarDataHolder
 Data on each side of the mortar used to compute the boundary correction for the DG scheme using global time stepping. More...
 
class  MortarInfo
 Information about the mortar between two Elements. More...
 
struct  TimeDerivativeDecisions
 Runtime control over time derivative work done. More...
 
struct  using_subcell
 If Metavars has a SubcellOptions member struct and SubcellOptions::subcell_enabled is true then inherits from std::true_type, otherwise inherits from std::false_type. More...
 

Enumerations

enum class  InterfaceDataPolicy : uint8_t {
  Uninitialized = 0 , CopyProject = 1 , OrientCopyProject = 2 , NonconformingBothInterpolate = 3 ,
  NonconformingSelfInterpolates = 4 , NonconformingNeighborInterpolates = 5
}
 Label for a neighboring Element (or Block) that determines how information is exchanged between neighboring Elements. More...
 

Functions

template<bool UseNodegroupDgElements, typename Metavariables , typename DbTagsList , typename... InboxTags>
bool receive_boundary_data_global_time_stepping (const gsl::not_null< db::DataBox< DbTagsList > * > box, const gsl::not_null< tuples::TaggedTuple< InboxTags... > * > inboxes)
 Receive boundary data for global time-stepping. Returns true if all necessary data has been received.
 
template<bool UseNodegroupDgElements, typename System , size_t Dim, bool DenseOutput, typename DbTagsList , typename... InboxTags>
bool receive_boundary_data_local_time_stepping (const gsl::not_null< db::DataBox< DbTagsList > * > box, const gsl::not_null< tuples::TaggedTuple< InboxTags... > * > inboxes)
 Receive boundary data for local time-stepping. Returns true if all necessary data has been received. More...
 
template<size_t Dim>
bool operator== (const BoundaryData< Dim > &lhs, const BoundaryData< Dim > &rhs)
 
template<size_t Dim>
bool operator!= (const BoundaryData< Dim > &lhs, const BoundaryData< Dim > &rhs)
 
template<size_t Dim>
std::ostreamoperator<< (std::ostream &os, const BoundaryData< Dim > &value)
 
template<size_t Dim>
void merge_boundary_data (gsl::not_null< BoundaryData< Dim > * > destination, BoundaryData< Dim > source)
 Merge DG boundary correction data into an existing BoundaryData object. More...
 
std::ostreamoperator<< (std::ostream &os, InterfaceDataPolicy value)
 Output operator for a InterfaceDataPolicy.
 
template<size_t VolumeDim>
bool operator== (const InterpolatedBoundaryData< VolumeDim > &lhs, const InterpolatedBoundaryData< VolumeDim > &rhs)
 
template<size_t VolumeDim>
bool operator!= (const InterpolatedBoundaryData< VolumeDim > &lhs, const InterpolatedBoundaryData< VolumeDim > &rhs)
 
template<size_t VolumeDim>
std::ostreamoperator<< (std::ostream &os, const InterpolatedBoundaryData< VolumeDim > &value)
 
template<size_t Dim>
bool operator== (const BoundaryMessage< Dim > &lhs, const BoundaryMessage< Dim > &rhs)
 
template<size_t Dim>
bool operator!= (const BoundaryMessage< Dim > &lhs, const BoundaryMessage< Dim > &rhs)
 
template<size_t Dim>
std::ostreamoperator<< (std::ostream &os, const BoundaryMessage< Dim > &message)
 
template<size_t Dim>
bool p_project_geometric_data (gsl::not_null<::evolution::dg::MortarData< Dim > * > mortar_data, const Mesh< Dim - 1 > &new_face_mesh, const Mesh< Dim > &new_volume_mesh)
 Projects the geometric data (but not the data on the mortar grid) when p-refined. More...
 
template<size_t Dim>
bool p_project_mortar_data (gsl::not_null<::evolution::dg::MortarData< Dim > * > mortar_data, const Mesh< Dim - 1 > &new_mortar_mesh)
 Projects the mortar data (but not the geometric data) when p-refined. More...
 
template<size_t Dim>
bool operator== (const MortarData< Dim > &lhs, const MortarData< Dim > &rhs)
 
template<size_t Dim>
bool operator!= (const MortarData< Dim > &lhs, const MortarData< Dim > &rhs)
 
template<size_t Dim>
std::ostreamoperator<< (std::ostream &os, const MortarData< Dim > &mortar_data)
 
template<size_t Dim>
bool operator== (const MortarDataHolder< Dim > &lhs, const MortarDataHolder< Dim > &rhs)
 
template<size_t Dim>
bool operator!= (const MortarDataHolder< Dim > &lhs, const MortarDataHolder< Dim > &rhs)
 
template<size_t Dim>
std::ostreamoperator<< (std::ostream &os, const MortarDataHolder< Dim > &mortar_data_holder)
 
template<size_t VolumeDim>
bool operator== (const MortarInfo< VolumeDim > &lhs, const MortarInfo< VolumeDim > &rhs)
 
template<size_t VolumeDim>
bool operator!= (const MortarInfo< VolumeDim > &lhs, const MortarInfo< VolumeDim > &rhs)
 
template<size_t VolumeDim>
std::ostreamoperator<< (std::ostream &os, const MortarInfo< VolumeDim > &mortar_info)
 

Variables

template<typename T >
constexpr size_t is_atomic_inbox_boundary_data_v
 true if T is a AtomicInboxBoundaryData More...
 
template<typename Metavars >
constexpr bool using_subcell_v = using_subcell<Metavars>::value
 If Metavars has a SubcellOptions member struct and SubcellOptions::subcell_enabled is true then is true, otherwise false. More...
 

Detailed Description

Functionality for evolving hyperbolic partial differential equations using the discontinuous Galerkin method.

Enumeration Type Documentation

◆ InterfaceDataPolicy

enum class evolution::dg::InterfaceDataPolicy : uint8_t
strong

Label for a neighboring Element (or Block) that determines how information is exchanged between neighboring Elements.

Details

The specific label is determined by the relationship between the block logical coordinates of the neighboring Elements (Blocks) for the points on the interface between them. In two cases there is a simple relationship between the coordinates:

  • CopyProject: in this case the block logical coordinates are identical. Therefore a DataVector can be either copied (if the Mesh on each side of the interface are at the same points) or projected to the Mesh of the neighbor.
  • OrientCopyProject: in this case the block logical coordinates are related by a discrete rotation (represented by an OrientationMap). Therefore a DataVector can be reoriented (with the OrientationMap), and then either copied or projected to the Mesh of the neighbor.

In the following cases, there is no simple relationship between the block logical coordinates. Therefore a DataVector must be interpolated to the points of the neighboring Mesh. The cases differ in which Element does the interpolation:

  • NonconformingBothInterpolate: in this case both the Element and its neighbor interpolate data to the grid points of each others Mesh.
  • NonconformingSelfInterpolates: in this case the Element will receive the neighbor's boundary data and will interpolate it to the Mesh of the Element. The Element will then need to send boundary correction data to the neighbor.
  • NonconformingNeighborInterpolates: in this case the Element send its boundary data to the neighbor who will then interpolate it to its own Mesh. The neighbor will need to send boundary correction data back to the Element.

The Element and its neighbor will need to use consistent values of this enum:

  • In the cases CopyProject, OrientCopyProject, and NonconformingBothInterpolate, neighboring elements should agree on the values.
  • For NonconformingSelfInterpolates and NonconformingNeighborInterpolates neighboring elements should have different values. These cases should be used when one Element has many neighboring Elements (e.g. when a single spherical shell abuts a cubes sphere). In this case it should be more efficient for the single element to send its boundary data to its neighbors which then do the interpolation to their meshes.
Enumerator
Uninitialized 

default value is uninitialized

CopyProject 

Boundary data can be copied or projected to Mesh of neighbor.

OrientCopyProject 

Boundary data should be reoriented, and then copied or projected to Mesh of neighbor.

NonconformingBothInterpolate 

Boundary data should be interpolated to Mesh of neighbor.

NonconformingSelfInterpolates 

Neighbor will send boundary data to be interpolated onto the Mesh of this Element. Boundary correction data will then need to be sent to the neighbor.

NonconformingNeighborInterpolates 

Boundary data should be sent to the neighbor, who will interpolate the data to its own Mesh. The neighbor will send boundary correction data back.

Function Documentation

◆ merge_boundary_data()

template<size_t Dim>
void evolution::dg::merge_boundary_data ( gsl::not_null< BoundaryData< Dim > * >  destination,
BoundaryData< Dim >  source 
)

Merge DG boundary correction data into an existing BoundaryData object.

In a 2-send implementation, we can receive DG boundary correction data at a time for which we have already received ghost cell data. This function sanity checks that the data we already have is the ghost cells and then copes in the DG data.

Note
We do not currently use a 2-send implementation. We generally find that the number of communications is more important than the size of each communication, and so a single communication per time/sub step is preferred.

◆ p_project_geometric_data()

template<size_t Dim>
bool evolution::dg::p_project_geometric_data ( gsl::not_null<::evolution::dg::MortarData< Dim > * >  mortar_data,
const Mesh< Dim - 1 > &  new_face_mesh,
const Mesh< Dim > &  new_volume_mesh 
)

Projects the geometric data (but not the data on the mortar grid) when p-refined.

Details

only updates the stored mesh if the corresponding data exists

Note
The DG-subcell code stores the face mesh in the MortarData even when the geometric data are not used. Currently projection of MortarData is only needed for local time-stepping which is not yet supported for DG-subcell.

Returns: If the data was modified

◆ p_project_mortar_data()

template<size_t Dim>
bool evolution::dg::p_project_mortar_data ( gsl::not_null<::evolution::dg::MortarData< Dim > * >  mortar_data,
const Mesh< Dim - 1 > &  new_mortar_mesh 
)

Projects the mortar data (but not the geometric data) when p-refined.

Details

Used to re-project mortar data when the mortar mesh changes reactively after the neighbor face mesh is received. In this case, the geometric data does not need to be updated as it already used the correct face/volume mesh.

Returns: If the data was modified

◆ receive_boundary_data_local_time_stepping()

template<bool UseNodegroupDgElements, typename System , size_t Dim, bool DenseOutput, typename DbTagsList , typename... InboxTags>
bool evolution::dg::receive_boundary_data_local_time_stepping ( const gsl::not_null< db::DataBox< DbTagsList > * >  box,
const gsl::not_null< tuples::TaggedTuple< InboxTags... > * >  inboxes 
)

Receive boundary data for local time-stepping. Returns true if all necessary data has been received.

Setting DenseOutput to true receives data required for output at Tags::Time instead of Tags::Next<::Tags::TimeStepId>.

Variable Documentation

◆ is_atomic_inbox_boundary_data_v

template<typename T >
constexpr size_t evolution::dg::is_atomic_inbox_boundary_data_v
constexpr
Initial value:
=
std::true if T is a AtomicInboxBoundaryData
Definition: AtomicInboxBoundaryData.hpp:125

true if T is a AtomicInboxBoundaryData

◆ using_subcell_v

template<typename Metavars >
constexpr bool evolution::dg::using_subcell_v = using_subcell<Metavars>::value
constexpr

If Metavars has a SubcellOptions member struct and SubcellOptions::subcell_enabled is true then is true, otherwise false.

Note
This check is intentionally not inside the DgSubcell library so that executables that do not use subcell do not need to link against it.