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