SpECTRE  v2024.09.29
amr::Events::ObserveAmrCriteria< Metavariables > Class Template Reference

Observe the desired decisions of AMR criteria. More...

#include <ObserveAmrCriteria.hpp>

Public Types

using compute_tags_for_observation_box = tmpl::remove_duplicates< tmpl::flatten< tmpl::transform< tmpl::at< typename Metavariables::factory_creation::factory_classes, Criterion >, detail::get_compute_tags< tmpl::_1 > > > >
 
using return_tags = tmpl::list<>
 
using argument_tags = tmpl::list<::Tags::ObservationBox >
 
- Public Types inherited from dg::Events::ObserveConstantsPerElement< Metavariables::volume_dim >
using options = tmpl::list< SubfileName, CoordinatesFloatingPointType, FloatingPointType >
 
using observation_registration_tags = tmpl::list<>
 
using is_ready_argument_tags = tmpl::list<>
 

Public Member Functions

 ObserveAmrCriteria (const std::string &subfile_name, ::FloatingPointType coordinates_floating_point_type, ::FloatingPointType floating_point_type)
 
template<typename DataBoxType , typename ComputeTagsList , typename ParallelComponent >
void operator() (const ObservationBox< DataBoxType, ComputeTagsList > &box, Parallel::GlobalCache< Metavariables > &cache, const ElementId< Metavariables::volume_dim > &element_id, const ParallelComponent *const component, const Event::ObservationValue &observation_value) const
 
bool needs_evolved_variables () const override
 Whether the event uses anything depending on the evolved_variables. If this returns false, anything depending on the evolved variables may have an incorrect value when the event is run. More...
 
void pup (PUP::er &p) override
 
- Public Member Functions inherited from dg::Events::ObserveConstantsPerElement< Metavariables::volume_dim >
 ObserveConstantsPerElement (const std::string &subfile_name, ::FloatingPointType coordinates_floating_point_type, ::FloatingPointType floating_point_type)
 
std::optional< std::pair< observers::TypeOfObservation, observers::ObservationKey > > get_observation_type_and_key_for_registration () const
 
bool is_ready (Parallel::GlobalCache< Metavariables > &, const ArrayIndex &, const Component *const) const
 
void pup (PUP::er &p) override
 
- Public Member Functions inherited from Event
 Event (CkMigrateMessage *msg)
 
 WRAPPED_PUPable_abstract (Event)
 
template<typename ComputeTagsList , typename DataBoxType , typename Metavariables , typename ArrayIndex , typename ComponentPointer >
void run (const gsl::not_null< ObservationBox< ComputeTagsList, DataBoxType > * > box, Parallel::GlobalCache< Metavariables > &cache, const ArrayIndex &array_index, const ComponentPointer, const ObservationValue &observation_value) const
 
template<typename DbTags , typename Metavariables , typename ArrayIndex , typename ComponentPointer >
bool is_ready (const db::DataBox< DbTags > &box, Parallel::GlobalCache< Metavariables > &cache, const ArrayIndex &array_index, const ComponentPointer) const
 
virtual bool needs_evolved_variables () const =0
 Whether the event uses anything depending on the evolved_variables. If this returns false, anything depending on the evolved variables may have an incorrect value when the event is run. More...
 

Static Public Attributes

static constexpr size_t volume_dim = Metavariables::volume_dim
 
static constexpr Options::String help
 

Additional Inherited Members

- Protected Member Functions inherited from dg::Events::ObserveConstantsPerElement< Metavariables::volume_dim >
std::vector< TensorComponentallocate_and_insert_coords (size_t number_of_constants, double time, const std::unordered_map< std::string, std::unique_ptr< domain::FunctionsOfTime::FunctionOfTime > > &functions_of_time, const Domain< VolumeDim > &domain, const ElementId< VolumeDim > &element_id) const
 Creates the vector of tensor components that will be observed and starts to fill it with the inertial coordinates. More...
 
void add_constant (gsl::not_null< std::vector< TensorComponent > * > components, std::string name, double value) const
 Adds a TensorComponent to components with the given name and the given value. More...
 
void observe (std::vector< TensorComponent > components, Parallel::GlobalCache< Metavariables > &cache, const ElementId< VolumeDim > &element_id, const ParallelComponent *, const ObservationValue &observation_value) const
 Observes the components as volume data.
 

Detailed Description

template<typename Metavariables>
class amr::Events::ObserveAmrCriteria< Metavariables >

Observe the desired decisions of AMR criteria.

Details

The event will return a vector of decisions (an independent choice in each logical dimension) for each of the AMR criteria. These are the raw choices made by each AMR critera, not taking into account any AMR policies. Each element is output as a single cell with two points per dimension and the observation constant on all those points. The decisions are converted to values as follows (in each logical dimension):

  • -2.0 is for join with sibling (if possible)
  • -1.0 is for decrease number of grid points
  • 0.0 is for no change
  • 1.0 is for increase number of grid points
  • 2.0 is for splitting the element

Member Function Documentation

◆ needs_evolved_variables()

template<typename Metavariables >
bool amr::Events::ObserveAmrCriteria< Metavariables >::needs_evolved_variables ( ) const
inlineoverridevirtual

Whether the event uses anything depending on the evolved_variables. If this returns false, anything depending on the evolved variables may have an incorrect value when the event is run.

Implements Event.

Member Data Documentation

◆ help

template<typename Metavariables >
constexpr Options::String amr::Events::ObserveAmrCriteria< Metavariables >::help
staticconstexpr
Initial value:
=
"Observe the desired decisions of AMR criteria in the volume."

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