SpECTRE  v2023.10.11
amr::Criteria::Random Class Reference

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

#include <Random.hpp>

Classes

struct  ChangeRefinementFraction
 The fraction of the time random refinement does changes the grid. More...
 
struct  MaximumRefinementLevel
 The maximum allowed refinement level. More...
 

Public Types

using options = tmpl::list< ChangeRefinementFraction, MaximumRefinementLevel >
 
using compute_tags_for_observation_box = tmpl::list<>
 
using argument_tags = tmpl::list<>
 

Public Member Functions

 Random (const double do_something_fraction, const size_t maximum_refinement_level)
 
template<typename Metavariables >
auto operator() (Parallel::GlobalCache< Metavariables > &, const ElementId< Metavariables::volume_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. More...
 

Static Public Attributes

static constexpr Options::String help
 

Detailed Description

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

Details

Let \(f\) be ChangeRefinementFraction, \(L_{max}\) be MaximumRefinementLevel, and \(L_d\) be the current refinement level of an Element in a particular dimension. In each dimension, a random number \(r_d \in [0, 1]\) is generated. If \(r_d > f\) the refinement flag is set to amr::Flags::DoNothing. If \(r_d < f L_d / L_{max}\) the refinement flag is set to amr::Flags::Join. Otherwise the refinement flag is set to amr::Flag::Split.

Note
This criterion is primarily useful for testing the mechanics of h-refinement

Member Data Documentation

◆ help

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

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