Line data Source code
1 0 : // Distributed under the MIT License.
2 : // See LICENSE.txt for details.
3 :
4 : #pragma once
5 :
6 : #include <cstddef>
7 : #include <vector>
8 :
9 : #include "ControlSystem/Actions/LimitTimeStep.hpp"
10 : #include "DataStructures/DataBox/PrefixHelpers.hpp"
11 : #include "DataStructures/DataBox/Tag.hpp"
12 : #include "DataStructures/Tensor/EagerMath/RaiseOrLowerIndex.hpp"
13 : #include "Domain/Creators/Factory1D.hpp"
14 : #include "Domain/Creators/Factory2D.hpp"
15 : #include "Domain/Creators/Factory3D.hpp"
16 : #include "Domain/Tags.hpp"
17 : #include "Domain/TagsCharacteristicSpeeds.hpp"
18 : #include "Evolution/Actions/RunEventsAndDenseTriggers.hpp"
19 : #include "Evolution/BoundaryCorrection.hpp"
20 : #include "Evolution/ComputeTags.hpp"
21 : #include "Evolution/DiscontinuousGalerkin/Actions/ApplyBoundaryCorrections.hpp"
22 : #include "Evolution/DiscontinuousGalerkin/Actions/ComputeTimeDerivative.hpp"
23 : #include "Evolution/DiscontinuousGalerkin/CleanMortarHistory.hpp"
24 : #include "Evolution/DiscontinuousGalerkin/DgElementArray.hpp"
25 : #include "Evolution/DiscontinuousGalerkin/Initialization/Mortars.hpp"
26 : #include "Evolution/Initialization/DgDomain.hpp"
27 : #include "Evolution/Initialization/Evolution.hpp"
28 : #include "Evolution/Initialization/NonconservativeSystem.hpp"
29 : #include "Evolution/Initialization/SetVariables.hpp"
30 : #include "Evolution/Systems/CurvedScalarWave/BoundaryConditions/Factory.hpp"
31 : #include "Evolution/Systems/CurvedScalarWave/Initialize.hpp"
32 : #include "Evolution/Systems/CurvedScalarWave/PsiSquared.hpp"
33 : #include "Evolution/Systems/CurvedScalarWave/System.hpp"
34 : #include "Evolution/Systems/CurvedScalarWave/Tags.hpp"
35 : #include "Evolution/Systems/GeneralizedHarmonic/Actions/SetInitialData.hpp"
36 : #include "Evolution/Systems/GeneralizedHarmonic/BoundaryConditions/Factory.hpp"
37 : #include "Evolution/Systems/GeneralizedHarmonic/Equations.hpp"
38 : #include "Evolution/Systems/GeneralizedHarmonic/GaugeSourceFunctions/Factory.hpp"
39 : #include "Evolution/Systems/GeneralizedHarmonic/GaugeSourceFunctions/Gauges.hpp"
40 : #include "Evolution/Systems/GeneralizedHarmonic/GaugeSourceFunctions/SetPiAndPhiFromConstraints.hpp"
41 : #include "Evolution/Systems/GeneralizedHarmonic/GaugeSourceFunctions/Tags/GaugeCondition.hpp"
42 : #include "Evolution/Systems/GeneralizedHarmonic/Initialize.hpp"
43 : #include "Evolution/Systems/GeneralizedHarmonic/System.hpp"
44 : #include "Evolution/Systems/GeneralizedHarmonic/Tags.hpp"
45 : #include "Evolution/Systems/ScalarTensor/Actions/SetInitialData.hpp"
46 : #include "Evolution/Systems/ScalarTensor/BoundaryConditions/Factory.hpp"
47 : #include "Evolution/Systems/ScalarTensor/BoundaryCorrections/Factory.hpp"
48 : #include "Evolution/Systems/ScalarTensor/Constraints.hpp"
49 : #include "Evolution/Systems/ScalarTensor/Initialize.hpp"
50 : #include "Evolution/Systems/ScalarTensor/System.hpp"
51 : #include "Evolution/Systems/ScalarTensor/Tags.hpp"
52 : #include "Evolution/Tags/Filter.hpp"
53 : #include "Evolution/TypeTraits.hpp"
54 : #include "IO/Importers/Actions/RegisterWithElementDataReader.hpp"
55 : #include "IO/Importers/ElementDataReader.hpp"
56 : #include "IO/Observer/Actions/ObserverRegistration.hpp"
57 : #include "IO/Observer/Actions/RegisterEvents.hpp"
58 : #include "IO/Observer/Helpers.hpp"
59 : #include "IO/Observer/ObserverComponent.hpp"
60 : #include "IO/Observer/Tags.hpp"
61 : #include "NumericalAlgorithms/DiscontinuousGalerkin/Tags.hpp"
62 : #include "NumericalAlgorithms/LinearOperators/ExponentialFilter.hpp"
63 : #include "Options/Protocols/FactoryCreation.hpp"
64 : #include "Options/String.hpp"
65 : #include "Parallel/Algorithms/AlgorithmSingleton.hpp"
66 : #include "Parallel/Local.hpp"
67 : #include "Parallel/Phase.hpp"
68 : #include "Parallel/PhaseControl/CheckpointAndExitAfterWallclock.hpp"
69 : #include "Parallel/PhaseControl/ExecutePhaseChange.hpp"
70 : #include "Parallel/PhaseControl/Factory.hpp"
71 : #include "Parallel/PhaseControl/VisitAndReturn.hpp"
72 : #include "Parallel/PhaseDependentActionList.hpp"
73 : #include "Parallel/Reduction.hpp"
74 : #include "ParallelAlgorithms/Actions/AddComputeTags.hpp"
75 : #include "ParallelAlgorithms/Actions/AddSimpleTags.hpp"
76 : #include "ParallelAlgorithms/Actions/FilterAction.hpp"
77 : #include "ParallelAlgorithms/Actions/FunctionsOfTimeAreReady.hpp"
78 : #include "ParallelAlgorithms/Actions/InitializeItems.hpp"
79 : #include "ParallelAlgorithms/Actions/MemoryMonitor/ContributeMemoryData.hpp"
80 : #include "ParallelAlgorithms/Actions/MutateApply.hpp"
81 : #include "ParallelAlgorithms/Actions/RandomizeVariables.hpp"
82 : #include "ParallelAlgorithms/Actions/TerminatePhase.hpp"
83 : #include "ParallelAlgorithms/ApparentHorizonFinder/Callbacks/FindApparentHorizon.hpp"
84 : #include "ParallelAlgorithms/ApparentHorizonFinder/InterpolationTarget.hpp"
85 : #include "ParallelAlgorithms/Events/Factory.hpp"
86 : #include "ParallelAlgorithms/Events/MonitorMemory.hpp"
87 : #include "ParallelAlgorithms/Events/ObserveTimeStep.hpp"
88 : #include "ParallelAlgorithms/Events/ObserveTimeStepVolume.hpp"
89 : #include "ParallelAlgorithms/Events/Tags.hpp"
90 : #include "ParallelAlgorithms/EventsAndDenseTriggers/DenseTrigger.hpp"
91 : #include "ParallelAlgorithms/EventsAndDenseTriggers/DenseTriggers/Factory.hpp"
92 : #include "ParallelAlgorithms/EventsAndTriggers/Completion.hpp"
93 : #include "ParallelAlgorithms/EventsAndTriggers/Event.hpp"
94 : #include "ParallelAlgorithms/EventsAndTriggers/EventsAndTriggers.hpp"
95 : #include "ParallelAlgorithms/EventsAndTriggers/LogicalTriggers.hpp"
96 : #include "ParallelAlgorithms/EventsAndTriggers/Trigger.hpp"
97 : #include "ParallelAlgorithms/Interpolation/Actions/CleanUpInterpolator.hpp"
98 : #include "ParallelAlgorithms/Interpolation/Actions/InitializeInterpolationTarget.hpp"
99 : #include "ParallelAlgorithms/Interpolation/Actions/InterpolationTargetReceiveVars.hpp"
100 : #include "ParallelAlgorithms/Interpolation/Actions/InterpolatorReceivePoints.hpp"
101 : #include "ParallelAlgorithms/Interpolation/Actions/InterpolatorReceiveVolumeData.hpp"
102 : #include "ParallelAlgorithms/Interpolation/Actions/InterpolatorRegisterElement.hpp"
103 : #include "ParallelAlgorithms/Interpolation/Actions/TryToInterpolate.hpp"
104 : #include "ParallelAlgorithms/Interpolation/Callbacks/ObserveTimeSeriesOnSurface.hpp"
105 : #include "ParallelAlgorithms/Interpolation/Events/Interpolate.hpp"
106 : #include "ParallelAlgorithms/Interpolation/InterpolationTarget.hpp"
107 : #include "ParallelAlgorithms/Interpolation/Interpolator.hpp"
108 : #include "ParallelAlgorithms/Interpolation/Tags.hpp"
109 : #include "PointwiseFunctions/AnalyticData/GhScalarTensor/Factory.hpp"
110 : #include "PointwiseFunctions/AnalyticSolutions/GeneralRelativity/Factory.hpp"
111 : #include "PointwiseFunctions/AnalyticSolutions/GeneralRelativity/KerrSchild.hpp"
112 : #include "PointwiseFunctions/AnalyticSolutions/GeneralRelativity/SphericalKerrSchild.hpp"
113 : #include "PointwiseFunctions/AnalyticSolutions/GeneralRelativity/WrappedGr.hpp"
114 : #include "PointwiseFunctions/AnalyticSolutions/Tags.hpp"
115 : #include "PointwiseFunctions/GeneralRelativity/Christoffel.hpp"
116 : #include "PointwiseFunctions/GeneralRelativity/DetAndInverseSpatialMetric.hpp"
117 : #include "PointwiseFunctions/GeneralRelativity/GeneralizedHarmonic/ConstraintDampingTags.hpp"
118 : #include "PointwiseFunctions/GeneralRelativity/GeneralizedHarmonic/ConstraintGammas.hpp"
119 : #include "PointwiseFunctions/GeneralRelativity/Psi4Real.hpp"
120 : #include "PointwiseFunctions/GeneralRelativity/Ricci.hpp"
121 : #include "PointwiseFunctions/GeneralRelativity/Surfaces/Tags.hpp"
122 : #include "PointwiseFunctions/GeneralRelativity/Tags.hpp"
123 : #include "PointwiseFunctions/GeneralRelativity/WeylElectric.hpp"
124 : #include "PointwiseFunctions/InitialDataUtilities/InitialData.hpp"
125 : #include "PointwiseFunctions/InitialDataUtilities/Tags/InitialData.hpp"
126 : #include "PointwiseFunctions/ScalarTensor/ConstraintDampingTags.hpp"
127 : #include "PointwiseFunctions/ScalarTensor/ConstraintGammas.hpp"
128 : #include "PointwiseFunctions/ScalarTensor/ScalarCharge.hpp"
129 : #include "PointwiseFunctions/ScalarTensor/ScalarGaussBonnet/Tags.hpp"
130 : #include "PointwiseFunctions/ScalarTensor/SourceTags.hpp"
131 : #include "PointwiseFunctions/ScalarTensor/ScalarSource.hpp"
132 : #include "PointwiseFunctions/ScalarTensor/StressEnergy.hpp"
133 : #include "Time/Actions/SelfStartActions.hpp"
134 : #include "Time/ChangeTimeStepperOrder.hpp"
135 : #include "Time/CleanHistory.hpp"
136 : #include "Time/RecordTimeStepperData.hpp"
137 : #include "Time/StepChoosers/Factory.hpp"
138 : #include "Time/StepChoosers/StepChooser.hpp"
139 : #include "Time/Tags/Time.hpp"
140 : #include "Time/TimeSequence.hpp"
141 : #include "Time/TimeSteppers/Factory.hpp"
142 : #include "Time/TimeSteppers/LtsTimeStepper.hpp"
143 : #include "Time/TimeSteppers/TimeStepper.hpp"
144 : #include "Time/Triggers/TimeTriggers.hpp"
145 : #include "Time/UpdateU.hpp"
146 : #include "Utilities/ErrorHandling/Error.hpp"
147 : #include "Utilities/Functional.hpp"
148 : #include "Utilities/ProtocolHelpers.hpp"
149 : #include "Utilities/TMPL.hpp"
150 :
151 : /// \cond
152 : namespace Frame {
153 : struct Inertial;
154 : } // namespace Frame
155 : namespace PUP {
156 : class er;
157 : } // namespace PUP
158 : namespace Parallel {
159 : template <typename Metavariables>
160 : class CProxy_GlobalCache;
161 : } // namespace Parallel
162 : /// \endcond
163 :
164 : template <typename EvolutionMetavarsDerived>
165 : struct ScalarTensorTemplateBase;
166 :
167 : namespace detail {
168 : constexpr auto make_default_phase_order() {
169 : return std::array{Parallel::Phase::Initialization,
170 : Parallel::Phase::RegisterWithElementDataReader,
171 : Parallel::Phase::ImportInitialData,
172 : Parallel::Phase::InitializeInitialDataDependentQuantities,
173 : Parallel::Phase::Register,
174 : Parallel::Phase::InitializeTimeStepperHistory,
175 : Parallel::Phase::Evolve,
176 : Parallel::Phase::Exit};
177 : }
178 :
179 : struct ObserverTags {
180 : static constexpr size_t volume_dim = 3_st;
181 : static constexpr bool backreaction_is_enabled = false;
182 :
183 : using system = ScalarTensor::System;
184 :
185 : using variables_tag = typename system::variables_tag;
186 :
187 : using initial_data_list = gh::ScalarTensor::AnalyticData::all_analytic_data;
188 :
189 : using deriv_compute = ::Tags::DerivCompute<
190 : variables_tag, domain::Tags::Mesh<volume_dim>,
191 : domain::Tags::InverseJacobian<volume_dim, Frame::ElementLogical,
192 : Frame::Inertial>,
193 : typename system::gradient_variables>;
194 :
195 : using observe_fields = tmpl::append<
196 : tmpl::push_back<
197 : system::gh_system::variables_tag::tags_list,
198 : ScalarTensor::Tags::CswCompute<CurvedScalarWave::Tags::Psi>,
199 : ScalarTensor::Tags::CswCompute<CurvedScalarWave::Tags::Pi>,
200 : ScalarTensor::Tags::CswCompute<
201 : CurvedScalarWave::Tags::Phi<volume_dim>>,
202 : gh::Tags::GaugeH<DataVector, volume_dim, Frame::Inertial>,
203 : gh::Tags::SpacetimeDerivGaugeH<DataVector, volume_dim,
204 : Frame::Inertial>,
205 : // 3 plus 1 Tags and derivatives
206 : gr::Tags::SpatialMetric<DataVector, volume_dim, Frame::Inertial>,
207 : gr::Tags::DetSpatialMetric<DataVector>,
208 : gr::Tags::InverseSpatialMetric<DataVector, volume_dim,
209 : Frame::Inertial>,
210 : gr::Tags::Shift<DataVector, volume_dim, Frame::Inertial>,
211 : gr::Tags::Lapse<DataVector>,
212 : gr::Tags::SqrtDetSpatialMetric<DataVector>,
213 : gr::Tags::SpacetimeNormalOneFormCompute<DataVector, volume_dim,
214 : Frame::Inertial>,
215 : gr::Tags::SpacetimeNormalVector<DataVector, volume_dim,
216 : Frame::Inertial>,
217 : gr::Tags::InverseSpacetimeMetric<DataVector, volume_dim,
218 : Frame::Inertial>,
219 : ::Tags::deriv<
220 : gr::Tags::SpatialMetric<DataVector, volume_dim, Frame::Inertial>,
221 : tmpl::size_t<volume_dim>, Frame::Inertial>,
222 : gr::Tags::SpatialChristoffelFirstKind<DataVector, volume_dim,
223 : Frame::Inertial>,
224 : gr::Tags::SpatialChristoffelSecondKind<DataVector, volume_dim,
225 : Frame::Inertial>,
226 : // 3 plus 1 variables used by CSW
227 : gr::Tags::TraceSpatialChristoffelSecondKind<DataVector, volume_dim,
228 : Frame::Inertial>,
229 : gr::Tags::ExtrinsicCurvature<DataVector, volume_dim, Frame::Inertial>,
230 : gr::Tags::TraceExtrinsicCurvature<DataVector>,
231 : // More 3 plus 1 variables
232 : ::Tags::deriv<gr::Tags::SpatialChristoffelSecondKind<
233 : DataVector, volume_dim, Frame::Inertial>,
234 : tmpl::size_t<volume_dim>, Frame::Inertial>,
235 : gr::Tags::SpatialRicci<DataVector, volume_dim, Frame::Inertial>,
236 : gr::Tags::SpatialRicciScalar<DataVector>,
237 : // Compute the constraints of GH
238 : gh::Tags::GaugeConstraintCompute<volume_dim, Frame::Inertial>,
239 : gh::Tags::TwoIndexConstraintCompute<volume_dim, Frame::Inertial>,
240 : gh::Tags::ThreeIndexConstraintCompute<volume_dim, Frame::Inertial>,
241 : // Compute the constraints of CSW
242 : ScalarTensor::Tags::CswOneIndexConstraintCompute<volume_dim>,
243 : ScalarTensor::Tags::CswTwoIndexConstraintCompute<volume_dim>,
244 : // GH constraint norms
245 : ::Tags::PointwiseL2NormCompute<gh::Tags::GaugeConstraint<
246 : DataVector, volume_dim, Frame::Inertial>>,
247 : ::Tags::PointwiseL2NormCompute<gh::Tags::TwoIndexConstraint<
248 : DataVector, volume_dim, Frame::Inertial>>,
249 : ::Tags::PointwiseL2NormCompute<gh::Tags::ThreeIndexConstraint<
250 : DataVector, volume_dim, Frame::Inertial>>,
251 : // CSW constraint norms
252 : ::Tags::PointwiseL2NormCompute<ScalarTensor::Tags::Csw<
253 : CurvedScalarWave::Tags::OneIndexConstraint<volume_dim>>>,
254 : ::Tags::PointwiseL2NormCompute<ScalarTensor::Tags::Csw<
255 : CurvedScalarWave::Tags::TwoIndexConstraint<volume_dim>>>,
256 : // Damping parameters
257 : gh::Tags::ConstraintGamma0, gh::Tags::ConstraintGamma1,
258 : gh::Tags::ConstraintGamma2,
259 : ScalarTensor::Tags::CswCompute<
260 : CurvedScalarWave::Tags::ConstraintGamma1>,
261 : ScalarTensor::Tags::CswCompute<
262 : CurvedScalarWave::Tags::ConstraintGamma2>,
263 : // Sources
264 : ScalarTensor::Tags::TraceReversedStressEnergyCompute,
265 : ScalarTensor::Tags::ScalarSource,
266 :
267 : ::domain::Tags::Coordinates<volume_dim, Frame::Grid>,
268 : ::domain::Tags::Coordinates<volume_dim, Frame::Inertial>>,
269 : // The 4-index constraint is only implemented in 3d
270 : tmpl::list<
271 : tmpl::conditional_t<
272 : backreaction_is_enabled,
273 : ScalarTensor::Tags::FConstraintCompute<
274 : volume_dim, Frame::Inertial>,
275 : gh::Tags::FConstraintCompute<volume_dim, Frame::Inertial>>,
276 : gh::Tags::FourIndexConstraintCompute<volume_dim, Frame::Inertial>,
277 : ::Tags::PointwiseL2NormCompute<
278 : gh::Tags::FConstraint<DataVector, volume_dim>>,
279 : ::Tags::PointwiseL2NormCompute<
280 : gh::Tags::FourIndexConstraint<DataVector, volume_dim>>,
281 : gh::Tags::ConstraintEnergyCompute<volume_dim, Frame::Inertial>,
282 : ::Tags::deriv<gr::Tags::ExtrinsicCurvature<DataVector, volume_dim,
283 : Frame::Inertial>,
284 : tmpl::size_t<volume_dim>, Frame::Inertial>,
285 : gr::Tags::CovariantDerivativeOfExtrinsicCurvature<
286 : DataVector, volume_dim, Frame::Inertial>,
287 : gr::Tags::WeylElectric<DataVector, volume_dim, Frame::Inertial>,
288 : gr::Tags::WeylElectricScalar<DataVector>,
289 : gr::Tags::WeylMagneticScalar<DataVector>,
290 : gr::Tags::Psi4RealCompute<Frame::Inertial>>>;
291 : using non_tensor_compute_tags = tmpl::list<
292 : ::Events::Tags::ObserverMeshCompute<volume_dim>,
293 : ::Events::Tags::ObserverCoordinatesCompute<volume_dim, Frame::Inertial>,
294 : ::Events::Tags::ObserverInverseJacobianCompute<
295 : volume_dim, Frame::ElementLogical, Frame::Inertial>,
296 : ::Events::Tags::ObserverJacobianCompute<volume_dim, Frame::ElementLogical,
297 : Frame::Inertial>,
298 : ::Events::Tags::ObserverDetInvJacobianCompute<Frame::ElementLogical,
299 : Frame::Inertial>,
300 : ::Events::Tags::ObserverMeshVelocityCompute<volume_dim, Frame::Inertial>,
301 : gh::gauges::Tags::GaugeAndDerivativeCompute<
302 : volume_dim, gh::ScalarTensor::AnalyticData::all_analytic_data>>;
303 :
304 : using field_observations =
305 : dg::Events::field_observations<volume_dim, observe_fields,
306 : non_tensor_compute_tags>;
307 :
308 : // We collect here all the tags needed for interpolation in all surfaces
309 : using scalar_charge_vars_to_interpolate_to_target = tmpl::list<
310 : gr::Tags::SpatialMetric<DataVector, volume_dim, Frame::Inertial>,
311 : gr::Tags::InverseSpatialMetric<DataVector, volume_dim, Frame::Inertial>,
312 : CurvedScalarWave::Tags::Phi<volume_dim>, CurvedScalarWave::Tags::Psi>;
313 :
314 : using scalar_charge_compute_items_on_target = tmpl::list<
315 : ylm::Tags::ThetaPhiCompute<::Frame::Inertial>,
316 : ylm::Tags::RadiusCompute<::Frame::Inertial>,
317 : ylm::Tags::RhatCompute<::Frame::Inertial>,
318 : ylm::Tags::InvJacobianCompute<::Frame::Inertial>,
319 : ylm::Tags::JacobianCompute<::Frame::Inertial>,
320 : ylm::Tags::DxRadiusCompute<::Frame::Inertial>,
321 : ylm::Tags::NormalOneFormCompute<::Frame::Inertial>,
322 : ylm::Tags::OneOverOneFormMagnitudeCompute<DataVector, volume_dim,
323 : ::Frame::Inertial>,
324 : ylm::Tags::UnitNormalOneFormCompute<::Frame::Inertial>,
325 : ylm::Tags::UnitNormalVectorCompute<::Frame::Inertial>,
326 : gr::surfaces::Tags::AreaElementCompute<::Frame::Inertial>,
327 : ScalarTensor::StrahlkorperScalar::Tags::ScalarChargeIntegrandCompute,
328 : gr::surfaces::Tags::SurfaceIntegralCompute<
329 : ScalarTensor::StrahlkorperScalar::Tags::ScalarChargeIntegrand,
330 : ::Frame::Inertial>,
331 : gr::surfaces::Tags::SurfaceIntegralCompute<CurvedScalarWave::Tags::Psi,
332 : ::Frame::Inertial>,
333 : CurvedScalarWave::Tags::PsiSquaredCompute,
334 : gr::surfaces::Tags::SurfaceIntegralCompute<
335 : CurvedScalarWave::Tags::PsiSquared, ::Frame::Inertial>>;
336 :
337 : using scalar_charge_surface_obs_tags = tmpl::list<
338 : gr::surfaces::Tags::SurfaceIntegral<
339 : ScalarTensor::StrahlkorperScalar::Tags::ScalarChargeIntegrand,
340 : ::Frame::Inertial>,
341 : gr::surfaces::Tags::SurfaceIntegral<CurvedScalarWave::Tags::Psi,
342 : ::Frame::Inertial>,
343 : gr::surfaces::Tags::SurfaceIntegral<CurvedScalarWave::Tags::PsiSquared,
344 : ::Frame::Inertial>>;
345 : };
346 :
347 : template <bool LocalTimeStepping>
348 : struct FactoryCreation : tt::ConformsTo<Options::protocols::FactoryCreation> {
349 : static constexpr size_t volume_dim = 3_st;
350 :
351 : using system = ScalarTensor::System;
352 :
353 : using initial_data_list = gh::ScalarTensor::AnalyticData::all_analytic_data;
354 : using factory_classes = tmpl::map<
355 : tmpl::pair<DenseTrigger, DenseTriggers::standard_dense_triggers>,
356 : tmpl::pair<DomainCreator<volume_dim>, domain_creators<volume_dim>>,
357 : tmpl::pair<Event,
358 : tmpl::flatten<tmpl::list<
359 : Events::Completion, Events::MonitorMemory<volume_dim>,
360 : typename detail::ObserverTags::field_observations,
361 : Events::time_events<system>,
362 : dg::Events::ObserveTimeStepVolume<system>>>>,
363 : tmpl::pair<
364 : evolution::BoundaryCorrection,
365 : ScalarTensor::BoundaryCorrections::standard_boundary_corrections>,
366 : tmpl::pair<
367 : ScalarTensor::BoundaryConditions::BoundaryCondition,
368 : ScalarTensor::BoundaryConditions::standard_boundary_conditions>,
369 : tmpl::pair<gh::gauges::GaugeCondition, gh::gauges::all_gauges>,
370 : tmpl::pair<
371 : evolution::initial_data::InitialData,
372 : tmpl::push_back<initial_data_list, ScalarTensor::NumericInitialData>>,
373 : tmpl::pair<LtsTimeStepper, TimeSteppers::lts_time_steppers>,
374 : tmpl::pair<PhaseChange, PhaseControl::factory_creatable_classes>,
375 : tmpl::pair<StepChooser<StepChooserUse::LtsStep>,
376 : StepChoosers::standard_step_choosers<system>>,
377 : tmpl::pair<
378 : StepChooser<StepChooserUse::Slab>,
379 : StepChoosers::standard_slab_choosers<system, LocalTimeStepping>>,
380 : tmpl::pair<TimeSequence<double>,
381 : TimeSequences::all_time_sequences<double>>,
382 : tmpl::pair<TimeSequence<std::uint64_t>,
383 : TimeSequences::all_time_sequences<std::uint64_t>>,
384 : tmpl::pair<TimeStepper, TimeSteppers::time_steppers>,
385 : tmpl::pair<Trigger, tmpl::append<Triggers::logical_triggers,
386 : Triggers::time_triggers>>>;
387 : };
388 : } // namespace detail
389 :
390 : template <class EvolutionMetavarsDerived>
391 0 : struct ScalarTensorTemplateBase {
392 0 : using derived_metavars = EvolutionMetavarsDerived;
393 :
394 0 : static constexpr size_t volume_dim = 3_st;
395 0 : using system = ScalarTensor::System;
396 0 : using TimeStepperBase = LtsTimeStepper;
397 :
398 0 : static constexpr bool local_time_stepping =
399 : TimeStepperBase::local_time_stepping;
400 0 : static constexpr bool use_dg_element_collection = false;
401 :
402 : // NOLINTNEXTLINE(google-runtime-references)
403 0 : void pup(PUP::er& /*p*/) {}
404 :
405 0 : using factory_creation = detail::FactoryCreation<local_time_stepping>;
406 :
407 0 : using observed_reduction_data_tags =
408 : observers::collect_reduction_data_tags<tmpl::push_back<
409 : tmpl::at<typename factory_creation::factory_classes, Event>>>;
410 :
411 0 : using initialize_initial_data_dependent_quantities_actions = tmpl::list<
412 : ScalarTensor::Actions::InitializeGhAnd3Plus1Variables,
413 : gh::gauges::SetPiAndPhiFromConstraints<
414 : gh::ScalarTensor::AnalyticData::all_analytic_data, volume_dim>,
415 : Parallel::Actions::TerminatePhase>;
416 :
417 : // A tmpl::list of tags to be added to the GlobalCache by the
418 : // metavariables
419 0 : using const_global_cache_tags = tmpl::list<
420 : gh::gauges::Tags::GaugeCondition,
421 : evolution::initial_data::Tags::InitialData,
422 : gh::Tags::DampingFunctionGamma0<volume_dim, Frame::Grid>,
423 : gh::Tags::DampingFunctionGamma1<volume_dim, Frame::Grid>,
424 : gh::Tags::DampingFunctionGamma2<volume_dim, Frame::Grid>,
425 : ScalarTensor::Tags::DampingFunctionGamma1<volume_dim, Frame::Grid>,
426 : ScalarTensor::Tags::DampingFunctionGamma2<volume_dim, Frame::Grid>,
427 : // Source parameters
428 : ScalarTensor::Tags::RampUpParameters,
429 : ScalarTensor::Tags::CouplingParameters, ScalarTensor::Tags::ScalarMass>;
430 :
431 0 : using dg_registration_list =
432 : tmpl::list<observers::Actions::RegisterEventsWithObservers>;
433 :
434 0 : static constexpr auto default_phase_order =
435 : detail::make_default_phase_order();
436 :
437 : template <typename ControlSystems>
438 0 : using step_actions = tmpl::list<
439 : evolution::dg::Actions::ComputeTimeDerivative<
440 : volume_dim, system, AllStepChoosers, local_time_stepping,
441 : use_dg_element_collection>,
442 : tmpl::conditional_t<
443 : local_time_stepping,
444 : tmpl::list<Actions::MutateApply<RecordTimeStepperData<system>>,
445 : evolution::Actions::RunEventsAndDenseTriggers<tmpl::list<
446 : ::domain::CheckFunctionsOfTimeAreReadyPostprocessor<
447 : volume_dim>,
448 : evolution::dg::ApplyBoundaryCorrections<
449 : local_time_stepping, derived_metavars, volume_dim,
450 : true>>>,
451 : Actions::MutateApply<UpdateU<system, local_time_stepping>>,
452 : evolution::dg::Actions::ApplyLtsBoundaryCorrections<
453 : volume_dim, false, use_dg_element_collection>,
454 : Actions::MutateApply<ChangeTimeStepperOrder<system>>>,
455 : tmpl::list<
456 : evolution::dg::Actions::ApplyBoundaryCorrectionsToTimeDerivative<
457 : volume_dim, false, use_dg_element_collection>,
458 : Actions::MutateApply<RecordTimeStepperData<system>>,
459 : evolution::Actions::RunEventsAndDenseTriggers<tmpl::list<>>,
460 : control_system::Actions::LimitTimeStep<ControlSystems>,
461 : Actions::MutateApply<UpdateU<system, local_time_stepping>>>>,
462 : Actions::MutateApply<CleanHistory<system>>,
463 : tmpl::conditional_t<
464 : local_time_stepping,
465 : Actions::MutateApply<evolution::dg::CleanMortarHistory<system>>,
466 : tmpl::list<>>,
467 : // We allow for separate filtering of the system variables
468 : dg::Actions::Filter<Filters::Exponential<0>,
469 : system::gh_system::variables_tag::tags_list>,
470 : dg::Actions::Filter<Filters::Exponential<1>,
471 : system::scalar_system::variables_tag::tags_list>>;
472 :
473 : template <bool UseControlSystems>
474 0 : using initialization_actions = tmpl::list<
475 : Initialization::Actions::InitializeItems<
476 : Initialization::TimeStepping<derived_metavars, TimeStepperBase>,
477 : evolution::dg::Initialization::Domain<derived_metavars,
478 : UseControlSystems>,
479 : Initialization::TimeStepperHistory<derived_metavars>>,
480 : Initialization::Actions::NonconservativeSystem<system>,
481 : Initialization::Actions::AddComputeTags<::Tags::DerivCompute<
482 : typename system::variables_tag, domain::Tags::Mesh<volume_dim>,
483 : domain::Tags::InverseJacobian<volume_dim, Frame::ElementLogical,
484 : Frame::Inertial>,
485 : typename system::gradient_variables>>,
486 : Initialization::Actions::AddComputeTags<
487 : tmpl::push_back<StepChoosers::step_chooser_compute_tags<
488 : ScalarTensorTemplateBase, local_time_stepping>>>,
489 : ::evolution::dg::Initialization::Mortars<volume_dim, system>,
490 : evolution::Actions::InitializeRunEventsAndDenseTriggers,
491 : Parallel::Actions::TerminatePhase>;
492 : };
|