GhInterpolationStrategies.hpp
1 // Distributed under the MIT License.
2 // See LICENSE.txt for details.
3 
4 #pragma once
5 
8 #include "Time/Tags.hpp"
9 
10 
11 namespace Cce {
12 /// Contains utilities for collecting, interpolating, and providing worldtube
13 /// data for CCE that originates from other components in a running simulation.
14 namespace InterfaceManagers{
15 
16 /*!
17  * \brief Enumeration of possibilities for the collection of worldtube data that
18  * will be collected by the interpolator.
19  *
20  * \details The available strategies are:
21  * - `InterpolationStrategy::EveryStep` : interpolation data will be provided on
22  * each full step for the time-stepper, so the worldtube data represents
23  * physical values that can then be interpolated/extrapolated.
24  * - `InterpolationStrategy::EverySubstep` : interpolation data will be provided
25  * on each substep of the time-stepper, so the worldtube data represents
26  * intermediate substep quantities, and typically must be used in the same
27  * time-stepper to obtain physically meaningful quantites. This strategy is
28  * primarily useful if the CCE system takes identical timesteps using an
29  * identical stepper as the step and stepper used for generating the
30  * interpolation data.
31  */
32 enum class InterpolationStrategy { EveryStep, EverySubstep };
33 
34 /*!
35  * \brief Determines whether the element should interpolate for the current
36  * state of its `box`, depending on the
37  * `Cce::InterfaceManagers::InterpolationStrategy` used by the associated
38  * `Cce::InterfaceManagers::GhInterfaceManager`.
39  */
40 template <typename DbTagList>
42  const db::DataBox<DbTagList>& box,
43  const InterpolationStrategy strategy) noexcept {
44  if(strategy == InterpolationStrategy::EverySubstep) {
45  return true;
46  }
47  if(strategy == InterpolationStrategy::EveryStep) {
48  return db::get<::Tags::TimeStepId>(box).substep() == 0;
49  }
50  ERROR("Interpolation strategy not recognized");
51 }
52 } // namespace InterfaceManagers
53 } // namespace Cce
Error.hpp
ERROR
#define ERROR(m)
prints an error message to the standard error stream and aborts the program.
Definition: Error.hpp:36
DataBox.hpp
Cce::InterfaceManagers::should_interpolate_for_strategy
bool should_interpolate_for_strategy(const db::DataBox< DbTagList > &box, const InterpolationStrategy strategy) noexcept
Determines whether the element should interpolate for the current state of its box,...
Definition: GhInterpolationStrategies.hpp:41
Cce
The set of utilities for performing Cauchy characteristic evolution and Cauchy characteristic matchin...
Definition: BoundaryComputeAndSendToEvolution.hpp:28
Cce::InterfaceManagers::InterpolationStrategy
InterpolationStrategy
Enumeration of possibilities for the collection of worldtube data that will be collected by the inter...
Definition: GhInterpolationStrategies.hpp:32