SpECTRE  v2024.04.12
Events::ErrorIfDataTooBig< Dim, Tensors, NonTensorComputeTags > Class Template Reference

ERROR if tensors get too big. More...

#include <ErrorIfDataTooBig.hpp>

Classes

struct  Threshold
 
struct  VariablesToCheck
 

Public Types

using options = tmpl::list< VariablesToCheck, Threshold >
 
using compute_tags_for_observation_box = tmpl::append< Tensors, NonTensorComputeTags >
 
using return_tags = tmpl::list<>
 
using argument_tags = tmpl::list<::Tags::ObservationBox, ::domain::Tags::Coordinates< Dim, Frame::Inertial > >
 
using is_ready_argument_tags = tmpl::list<>
 

Public Member Functions

 ErrorIfDataTooBig (const std::vector< std::string > &variables_to_check, const double threshold, const Options::Context &context)
 
template<typename ComputeTagsList , typename DataBoxType , typename Metavariables , typename ArrayIndex , typename ParallelComponent >
void operator() (const ObservationBox< ComputeTagsList, DataBoxType > &box, const tnsr::I< DataVector, Dim > &coordinates, Parallel::GlobalCache< Metavariables > &, const ArrayIndex &, const ParallelComponent *const, const ObservationValue &) const
 
template<typename Metavariables , typename ArrayIndex , typename Component >
bool is_ready (Parallel::GlobalCache< Metavariables > &, const ArrayIndex &, const Component *const) 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 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 Options::String help = "ERROR if tensors get too big"
 

Detailed Description

template<size_t Dim, typename Tensors, typename NonTensorComputeTags>
class Events::ErrorIfDataTooBig< Dim, Tensors, NonTensorComputeTags >

ERROR if tensors get too big.

The magnitudes of the components of the specified tensors are checked, and if any exceed the specified threshold an ERROR is thrown, terminating the evolution.

Any Tensor in the db::DataBox can be checked but must be listed in the Tensors template parameter. Any additional compute tags that hold a Tensor can also be added to the Tensors template parameter. Finally, Variables and other non-tensor compute tags used to calculate tensors can be listed in the NonTensorComputeTags.

Note
The NonTensorComputeTags are intended to be used for Variables compute tags like Tags::DerivCompute

Member Function Documentation

◆ needs_evolved_variables()

template<size_t Dim, typename Tensors , typename NonTensorComputeTags >
bool Events::ErrorIfDataTooBig< Dim, Tensors, NonTensorComputeTags >::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.


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