SpECTRE  v2025.03.17
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Modules Pages
amr::Criteria::Random Class Reference

Randomly refine (or coarsen) an Element in each dimension. More...

#include <Random.hpp>

Classes

struct  ProbabilityWeights
 

Public Types

using options = implementation defined
 
using compute_tags_for_observation_box = implementation defined
 
using argument_tags = implementation defined
 

Public Member Functions

 Random (std::unordered_map< amr::Flag, size_t > probability_weights)
 
std::string observation_name () override
 
template<size_t Dim, typename Metavariables >
auto operator() (Parallel::GlobalCache< Metavariables > &, 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)
 
virtual std::string observation_name ()=0
 
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. More...
 

Static Public Attributes

static constexpr Options::String help
 

Detailed Description

Randomly refine (or coarsen) an Element in each dimension.

You can specify a probability for each possible amr::Flag. It is evaluated in each dimension separately. Details:

  • Probabilities are specified as integer weights. The probability for an amr::Flag is its weight over the sum of all weights.
  • Flags with weight zero do not need to be specified.
  • If all weights are zero, amr::Flag::DoNothing is always chosen.

Member Function Documentation

◆ observation_name()

std::string amr::Criteria::Random::observation_name ( )
inlineoverridevirtual

Implements amr::Criterion.

Member Data Documentation

◆ help

constexpr Options::String amr::Criteria::Random::help
staticconstexpr
Initial value:
= {
"Randomly refine (or coarsen) the grid"}

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