SpECTRE  v2026.04.01
Loading...
Searching...
No Matches
amr::Criteria::Constraints< Dim, TensorTags > Class Template Reference

Refine the grid towards the target constraint violation. More...

#include <Constraints.hpp>

Classes

struct  AbsoluteTarget
struct  CoarseningFactor
struct  ConstraintsToMonitor

Public Types

using options
using compute_tags_for_observation_box
using argument_tags = tmpl::list<::Tags::ObservationBox>

Public Member Functions

 Constraints (std::vector< std::string > vars_to_monitor, double abs_target, double coarsening_factor, const Options::Context &context={})
Type type () override
std::string observation_name () override
template<typename ComputeTagsList, typename DataBoxType, typename Metavariables>
std::array< Flag, Dim > operator() (const ObservationBox< ComputeTagsList, DataBoxType > &box, Parallel::GlobalCache< Metavariables > &cache, const ElementId< Dim > &element_id) const
void pup (PUP::er &p) override
Public Member Functions inherited from amr::Criterion
 Criterion (CkMigrateMessage *msg)
 WRAPPED_PUPable_abstract (Criterion)
template<typename ComputeTagsList, typename DataBoxType, typename Metavariables>
auto evaluate (const ObservationBox< ComputeTagsList, DataBoxType > &box, Parallel::GlobalCache< Metavariables > &cache, const ElementId< Metavariables::volume_dim > &element_id) const
 Evaluates the AMR criteria by selecting the appropriate derived class and forwarding its argument_tags from the ObservationBox (along with the GlobalCache and ArrayIndex) to the call operator of the derived class.

Static Public Attributes

static constexpr Options::String help

Detailed Description

template<size_t Dim, typename TensorTags>
class amr::Criteria::Constraints< Dim, TensorTags >

Refine the grid towards the target constraint violation.

  • If any constraint is above the target value, the element will be p-refined.
  • If all constraints are below the target times the "coarsening factor" the element will be p-coarsened.

This criterion is based on Sec. 6.1.4 in [198] .

If the coarsening factor turns out to be hard to choose, then we can try to eliminate it by projecting the variables to a lower polynomial order before computing constraints, or something like that.

Template Parameters
DimSpatial dimension of the grid
TensorTagsList of tags of the constraints to be monitored. These must be tensors of rank 2 or higher. The first index must be a lower spatial index that originates from a derivative.

Member Typedef Documentation

◆ compute_tags_for_observation_box

template<size_t Dim, typename TensorTags>
using amr::Criteria::Constraints< Dim, TensorTags >::compute_tags_for_observation_box
Initial value:
tmpl::append<
TensorTags, tmpl::list<domain::Tags::JacobianCompute<
Sets the ObserverJacobian to domain::Tags::Jacobian
Definition Tags.hpp:135
Definition IndexType.hpp:43
Definition IndexType.hpp:46
Computes the Jacobian of the map from the InverseJacobian<Dim, SourceFrame, TargetFrame> tag.
Definition Tags.hpp:171

◆ options

template<size_t Dim, typename TensorTags>
using amr::Criteria::Constraints< Dim, TensorTags >::options
Initial value:
tmpl::list<ConstraintsToMonitor, AbsoluteTarget, CoarseningFactor>

Member Function Documentation

◆ observation_name()

template<size_t Dim, typename TensorTags>
std::string amr::Criteria::Constraints< Dim, TensorTags >::observation_name ( )
inlineoverridevirtual

Implements amr::Criterion.

◆ type()

template<size_t Dim, typename TensorTags>
Type amr::Criteria::Constraints< Dim, TensorTags >::type ( )
inlineoverridevirtual

Implements amr::Criterion.

Member Data Documentation

◆ help

template<size_t Dim, typename TensorTags>
Options::String amr::Criteria::Constraints< Dim, TensorTags >::help
staticconstexpr
Initial value:
= {
"Refine the grid towards the target constraint violation"}

The documentation for this class was generated from the following file:
  • src/ParallelAlgorithms/Amr/Criteria/Constraints.hpp