SpECTRE  v2022.10.04
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 ArrayIndex , typename Metavariables >
auto operator() (Parallel::GlobalCache< Metavariables > &, const ArrayIndex &array_index) 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 , typename ArrayIndex >
auto evaluate (const ObservationBox< ComputeTagsList, DataBoxType > &box, Parallel::GlobalCache< Metavariables > &cache, const ArrayIndex &array_index) const
 

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::Domain::Flags::DoNothing. If \(r_d < f L_d / L_{max}\) the refinement flag is set to amr::Domain::Flags::Join. Otherwise the refinement flag is set to amr::Domain::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: