EvolveGeneralizedHarmonicWithHorizon.hpp
1 // Distributed under the MIT License.
2 // See LICENSE.txt for details.
3 
4 #pragma once
5 
6 #include <cstdint>
7 #include <vector>
8 
9 #include "ApparentHorizons/ComputeItems.hpp"
10 #include "ApparentHorizons/Tags.hpp"
11 #include "Domain/Creators/RegisterDerivedWithCharm.hpp"
12 #include "Domain/Creators/TimeDependence/RegisterDerivedWithCharm.hpp"
13 #include "Domain/FunctionsOfTime/RegisterDerivedWithCharm.hpp"
14 #include "Evolution/Executables/GeneralizedHarmonic/GeneralizedHarmonicBase.hpp"
15 #include "Evolution/Systems/GeneralizedHarmonic/BoundaryConditions/RegisterDerivedWithCharm.hpp"
16 #include "Evolution/Systems/GeneralizedHarmonic/BoundaryCorrections/RegisterDerived.hpp"
17 #include "Evolution/Systems/GeneralizedHarmonic/ConstraintDamping/RegisterDerivedWithCharm.hpp"
18 #include "NumericalAlgorithms/Interpolation/AddTemporalIdsToInterpolationTarget.hpp"
19 #include "NumericalAlgorithms/Interpolation/Callbacks/ErrorOnFailedApparentHorizon.hpp"
20 #include "NumericalAlgorithms/Interpolation/Callbacks/FindApparentHorizon.hpp"
21 #include "NumericalAlgorithms/Interpolation/Callbacks/ObserveTimeSeriesOnSurface.hpp"
22 #include "NumericalAlgorithms/Interpolation/CleanUpInterpolator.hpp"
23 #include "NumericalAlgorithms/Interpolation/InitializeInterpolationTarget.hpp"
24 #include "NumericalAlgorithms/Interpolation/Interpolate.hpp"
25 #include "NumericalAlgorithms/Interpolation/InterpolationTarget.hpp"
26 #include "NumericalAlgorithms/Interpolation/InterpolationTargetApparentHorizon.hpp"
27 #include "NumericalAlgorithms/Interpolation/InterpolationTargetReceiveVars.hpp"
28 #include "NumericalAlgorithms/Interpolation/Interpolator.hpp"
29 #include "NumericalAlgorithms/Interpolation/InterpolatorReceivePoints.hpp"
30 #include "NumericalAlgorithms/Interpolation/InterpolatorReceiveVolumeData.hpp"
31 #include "NumericalAlgorithms/Interpolation/InterpolatorRegisterElement.hpp"
32 #include "NumericalAlgorithms/Interpolation/Tags.hpp"
33 #include "NumericalAlgorithms/Interpolation/TryToInterpolate.hpp"
34 #include "Options/FactoryHelpers.hpp"
35 #include "Options/Options.hpp"
36 #include "Options/Protocols/FactoryCreation.hpp"
37 #include "Parallel/PhaseControl/PhaseControlTags.hpp"
40 #include "Time/StepChoosers/Factory.hpp"
41 #include "Time/StepControllers/Factory.hpp"
42 #include "Utilities/Blas.hpp"
45 
46 // First template parameter specifies the source of the initial data, which
47 // could be an analytic solution, analytic data, or imported numerical data.
48 // Second template parameter specifies the analytic solution used when imposing
49 // dirichlet boundary conditions or against which to compute error norms.
50 template <typename InitialData, typename BoundaryConditions>
51 struct EvolutionMetavars
52  : public virtual GeneralizedHarmonicDefaults,
54  EvolutionMetavars<InitialData, BoundaryConditions>> {
55  static constexpr Options::String help{
56  "Evolve the Einstein field equations using the Generalized Harmonic "
57  "formulation,\n"
58  "on a domain with a single horizon and corresponding excised region"};
59 
60  struct AhA {
61  using tags_to_observe =
62  tmpl::list<StrahlkorperGr::Tags::AreaCompute<frame>>;
63  using compute_items_on_source = tmpl::list<
68  using vars_to_interpolate_to_target =
69  tmpl::list<gr::Tags::SpatialMetric<volume_dim, frame, DataVector>,
73  using compute_items_on_target = tmpl::append<
74  tmpl::list<StrahlkorperGr::Tags::AreaElementCompute<frame>>,
75  tags_to_observe>;
76  using compute_target_points =
84  };
85 
86  using interpolation_target_tags = tmpl::list<AhA>;
87  using interpolator_source_vars =
88  tmpl::list<gr::Tags::SpacetimeMetric<volume_dim, frame>,
91 
92  struct factory_creation
93  : tt::ConformsTo<Options::protocols::FactoryCreation> {
94  using factory_classes = Options::add_factory_classes<
96  EvolutionMetavars>::factory_creation::factory_classes,
97  tmpl::pair<Event, tmpl::list<intrp::Events::Interpolate<
98  3, AhA, interpolator_source_vars>>>>;
99  };
100 
101  using phase_changes = typename GeneralizedHarmonicTemplateBase<
102  EvolutionMetavars>::phase_changes;
103 
104  using const_global_cache_tags = tmpl::list<
106  EvolutionMetavars>::analytic_solution_tag,
107  time_stepper_tag, Tags::EventsAndTriggers,
109  volume_dim, frame>,
111  volume_dim, frame>,
113  volume_dim, frame>,
115 
116  using observed_reduction_data_tags =
117  observers::collect_reduction_data_tags<tmpl::push_back<
118  tmpl::at<typename factory_creation::factory_classes, Event>,
119  typename AhA::post_horizon_find_callback>>;
120 
121  using dg_registration_list =
123  EvolutionMetavars>::dg_registration_list,
125 
126  template <typename ParallelComponent>
127  struct registration_list {
128  using type = std::conditional_t<
129  std::is_same_v<ParallelComponent,
131  EvolutionMetavars>::gh_dg_element_array>,
132  dg_registration_list, tmpl::list<>>;
133  };
134 
135  using component_list =
137  EvolutionMetavars>::component_list,
140 };
141 
142 static const std::vector<void (*)()> charm_init_node_funcs{
143  &setup_error_handling,
145  &domain::creators::time_dependence::register_derived_with_charm,
146  &domain::FunctionsOfTime::register_derived_with_charm,
147  &GeneralizedHarmonic::BoundaryConditions::register_derived_with_charm,
148  &GeneralizedHarmonic::BoundaryCorrections::register_derived_with_charm,
149  &domain::creators::register_derived_with_charm,
150  &GeneralizedHarmonic::ConstraintDamping::register_derived_with_charm,
151  &Parallel::register_derived_classes_with_charm<TimeStepper>,
154  &Parallel::register_factory_classes_with_charm<metavariables>};
155 
156 static const std::vector<void (*)()> charm_init_proc_funcs{
FloatingPointExceptions.hpp
intrp::callbacks::ErrorOnFailedApparentHorizon
Callback for a failed apparent horizon find that simply errors.
Definition: ErrorOnFailedApparentHorizon.hpp:24
RegisterDerivedClassesWithCharm.hpp
gr::Tags::SpatialChristoffelSecondKind
Definition: Tags.hpp:79
GeneralizedHarmonic::ConstraintDamping::Tags::DampingFunctionGamma2
A DampingFunction to compute the constraint damping parameter .
Definition: Tags.hpp:117
Tags.hpp
Options.hpp
vector
Error.hpp
ah::Tags::SpatialChristoffelSecondKindCompute
Definition: ComputeItems.hpp:76
EvolutionMetavars::factory_creation
Definition: EvolveBurgers.hpp:131
GeneralizedHarmonicTemplateBase
Definition: GeneralizedHarmonicBase.hpp:203
PhaseControl::Tags::PhaseChangeAndTriggers
Tag for the collection of triggers that indicate synchronization points at which phase changes should...
Definition: PhaseControlTags.hpp:66
disable_openblas_multithreading
void disable_openblas_multithreading() noexcept
Disable OpenBLAS multithreading since it conflicts with Charm++ parallelism.
EvolutionMetavars
Definition: EvolveBurgers.hpp:104
intrp::Interpolator
ParallelComponent responsible for collecting data from Elements and interpolating it onto Interpolati...
Definition: Interpolator.hpp:23
domain::push_back
CoordinateMap< SourceFrame, TargetFrame, Maps..., NewMap > push_back(CoordinateMap< SourceFrame, TargetFrame, Maps... > old_map, NewMap new_map) noexcept
Creates a CoordinateMap by appending the new map to the end of the old maps.
enable_floating_point_exceptions
void enable_floating_point_exceptions()
ah::Tags::ExtrinsicCurvatureCompute
Definition: ComputeItems.hpp:54
Event
Definition: Event.hpp:19
intrp::Actions::RegisterElementWithInterpolator
Invoked on DgElementArray to register all its elements with the Interpolator.
Definition: InterpolatorRegisterElement.hpp:109
intrp::TargetPoints::ApparentHorizon
Computes points on a trial apparent horizon`.
Definition: InterpolationTargetApparentHorizon.hpp:141
GeneralizedHarmonic::Tags::Pi
Conjugate momentum to the spacetime metric.
Definition: Tags.hpp:29
gr::Tags::SpatialMetricCompute
Compute item for spatial metric from the spacetime metric .
Definition: SpatialMetric.hpp:50
cstdint
ah::Tags::InverseSpatialMetricCompute
These ComputeItems are different from those used in GeneralizedHarmonic evolution because these live ...
Definition: ComputeItems.hpp:41
GeneralizedHarmonic::ConstraintDamping::Tags::DampingFunctionGamma0
A DampingFunction to compute the constraint damping parameter .
Definition: Tags.hpp:79
intrp::callbacks::ObserveTimeSeriesOnSurface
post_interpolation_callback that outputs a time series on a surface.
Definition: ObserveTimeSeriesOnSurface.hpp:91
GeneralizedHarmonic::Tags::Phi
Auxiliary variable which is analytically the spatial derivative of the spacetime metric.
Definition: Tags.hpp:40
Tags::EventsAndTriggers
Definition: Tags.hpp:51
PhaseChange
PhaseChange objects determine the storage types and logic for moving between phases based on runtime ...
Definition: PhaseChange.hpp:141
GeneralizedHarmonicDefaults
Definition: GeneralizedHarmonicBase.hpp:145
Options::String
const char *const String
The string used in option structs.
Definition: Options.hpp:32
EvolutionMetavars::AhA
Definition: EvolveGeneralizedHarmonicWithHorizon.hpp:60
GeneralizedHarmonic::ConstraintDamping::Tags::DampingFunctionGamma1
A DampingFunction to compute the constraint damping parameter .
Definition: Tags.hpp:98
gr::Tags::ExtrinsicCurvature
Definition: Tags.hpp:116
std::conditional_t
Parallel::register_derived_classes_with_charm
void register_derived_classes_with_charm() noexcept
Register derived classes of the Base class.
Definition: RegisterDerivedClassesWithCharm.hpp:35
Blas.hpp
Options::add_factory_classes
typename detail::add_factory_classes< FactoryClasses, NewClasses... >::type add_factory_classes
Add new factory-creatable classes to the list in a factory_creation struct.
Definition: FactoryHelpers.hpp:51
intrp::callbacks::FindApparentHorizon
post interpolation callback (see InterpolationTarget) that does a FastFlow iteration and triggers ano...
Definition: FindApparentHorizon.hpp:125
tt::ConformsTo
Indicate a class conforms to the Protocol.
Definition: ProtocolHelpers.hpp:22
intrp::Events::Interpolate
Does an interpolation onto InterpolationTargetTag by calling Actions on the Interpolator and Interpol...
Definition: Interpolate.hpp:53
gr::Tags::InverseSpatialMetric
Inverse of the spatial metric.
Definition: Tags.hpp:33
intrp::InterpolationTarget
ParallelComponent representing a set of points to be interpolated to and a function to call upon inte...
Definition: InterpolationTarget.hpp:347