SpECTRE  v2024.04.12
Limiters::Minmod< VolumeDim, tmpl::list< Tags... > > Class Template Reference

Classes

struct  DisableForDebugging
 Turn the limiter off. More...
 
struct  PackagedData
 Data to send to neighbor elements. More...
 
struct  TvbConstant
 The TVB constant. More...
 
struct  Type
 The MinmodType. More...
 

Public Types

using options = tmpl::list< Type, TvbConstant, DisableForDebugging >
 
using package_argument_tags = tmpl::list< Tags..., domain::Tags::Mesh< VolumeDim >, domain::Tags::SizeOfElement< VolumeDim > >
 
using limit_tags = tmpl::list< Tags... >
 
using limit_argument_tags = tmpl::list< domain::Tags::Mesh< VolumeDim >, domain::Tags::Element< VolumeDim >, domain::Tags::Coordinates< VolumeDim, Frame::ElementLogical >, domain::Tags::SizeOfElement< VolumeDim > >
 

Public Member Functions

 Minmod (MinmodType minmod_type, double tvb_constant, bool disable_for_debugging=false)
 Constuct a Minmod slope limiter. More...
 
 Minmod (const Minmod &)=default
 
Minmodoperator= (const Minmod &)=default
 
 Minmod (Minmod &&)=default
 
Minmodoperator= (Minmod &&)=default
 
void pup (PUP::er &p)
 
void package_data (gsl::not_null< PackagedData * > packaged_data, const typename Tags::type &... tensors, const Mesh< VolumeDim > &mesh, const std::array< double, VolumeDim > &element_size, const OrientationMap< VolumeDim > &orientation_map) const
 Package data for sending to neighbor elements. More...
 
bool operator() (const gsl::not_null< std::add_pointer_t< typename Tags::type > >... tensors, const Mesh< VolumeDim > &mesh, const Element< VolumeDim > &element, const tnsr::I< DataVector, VolumeDim, Frame::ElementLogical > &logical_coords, const std::array< double, VolumeDim > &element_size, const std::unordered_map< DirectionalId< VolumeDim >, PackagedData, boost::hash< DirectionalId< VolumeDim > > > &neighbor_data) const
 Limits the solution on the element. More...
 

Static Public Attributes

static constexpr Options::String help
 

Friends

template<size_t LocalDim, typename LocalTagList >
bool operator== (const Minmod< LocalDim, LocalTagList > &lhs, const Minmod< LocalDim, LocalTagList > &rhs)
 

Constructor & Destructor Documentation

◆ Minmod()

template<size_t VolumeDim, typename... Tags>
Limiters::Minmod< VolumeDim, tmpl::list< Tags... > >::Minmod ( MinmodType  minmod_type,
double  tvb_constant,
bool  disable_for_debugging = false 
)
explicit

Constuct a Minmod slope limiter.

Parameters
minmod_typeThe type of Minmod slope limiter.
tvb_constantThe value of the TVB constant.
disable_for_debuggingSwitch to turn the limiter off.

Member Function Documentation

◆ operator()()

template<size_t VolumeDim, typename... Tags>
bool Limiters::Minmod< VolumeDim, tmpl::list< Tags... > >::operator() ( const gsl::not_null< std::add_pointer_t< typename Tags::type > >...  tensors,
const Mesh< VolumeDim > &  mesh,
const Element< VolumeDim > &  element,
const tnsr::I< DataVector, VolumeDim, Frame::ElementLogical > &  logical_coords,
const std::array< double, VolumeDim > &  element_size,
const std::unordered_map< DirectionalId< VolumeDim >, PackagedData, boost::hash< DirectionalId< VolumeDim > > > &  neighbor_data 
) const

Limits the solution on the element.

For each component of each tensor, the limiter will (in general) linearize the data, then possibly reduce its slope, dimension-by-dimension, until it no longer looks oscillatory.

Parameters
tensorsThe tensors to be limited.
meshThe mesh on which the tensor values are measured.
elementThe element on which the tensors to limit live.
logical_coordsThe element logical coordinates of the mesh gridpoints.
element_sizeThe size of the element, in the inertial coordinates.
neighbor_dataThe data from each neighbor.

Returns: whether the limiter modified the solution or not.

Note
The return value is false if the limiter knows it has not modified the solution. True return values can indicate:
  • The solution was limited to reduce the slope, whether by a large factor or by a factor only roundoff away from unity.
  • The solution was linearized but not limited.
  • The solution is identical to the input, if the input was a linear function on a higher-order mesh, so that the limiter cannot know that the linearization step did not actually modify the data. This is somewhat contrived and is unlikely to occur outside of code tests or test cases with very clean initial data.

◆ package_data()

template<size_t VolumeDim, typename... Tags>
void Limiters::Minmod< VolumeDim, tmpl::list< Tags... > >::package_data ( gsl::not_null< PackagedData * >  packaged_data,
const typename Tags::type &...  tensors,
const Mesh< VolumeDim > &  mesh,
const std::array< double, VolumeDim > &  element_size,
const OrientationMap< VolumeDim > &  orientation_map 
) const

Package data for sending to neighbor elements.

The following quantities are stored in PackagedData and communicated between neighboring elements:

  • the cell-averaged mean of each tensor component, and
  • the size of the cell along each logical coordinate direction.
Parameters
packaged_dataThe data package to fill with this element's values.
tensorsThe tensors to be averaged and packaged.
meshThe mesh on which the tensor values are measured.
element_sizeThe size of the element in inertial coordinates, along each dimension of logical coordinates.
orientation_mapThe orientation of the neighbor

Member Data Documentation

◆ help

template<size_t VolumeDim, typename... Tags>
constexpr Options::String Limiters::Minmod< VolumeDim, tmpl::list< Tags... > >::help
staticconstexpr
Initial value:
= {
"A minmod-based generalized slope limiter.\n"
"The different types of minmod are more or less aggressive in trying\n"
"to reduce slopes. The TVB correction allows the limiter to ignore\n"
"'small' slopes, and helps to avoid limiting of smooth extrema in the\n"
"solution.\n"}

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