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