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/BoundaryConditions/ProductOfConditions.hpp"
48 : #include "Evolution/Systems/ScalarTensor/BoundaryCorrections/Factory.hpp"
49 : #include "Evolution/Systems/ScalarTensor/BoundaryCorrections/ProductOfCorrections.hpp"
50 : #include "Evolution/Systems/ScalarTensor/Constraints.hpp"
51 : #include "Evolution/Systems/ScalarTensor/Initialize.hpp"
52 : #include "Evolution/Systems/ScalarTensor/Sources/ScalarSource.hpp"
53 : #include "Evolution/Systems/ScalarTensor/StressEnergy.hpp"
54 : #include "Evolution/Systems/ScalarTensor/System.hpp"
55 : #include "Evolution/Systems/ScalarTensor/Tags.hpp"
56 : #include "Evolution/Tags/Filter.hpp"
57 : #include "Evolution/TypeTraits.hpp"
58 : #include "IO/Importers/Actions/RegisterWithElementDataReader.hpp"
59 : #include "IO/Importers/ElementDataReader.hpp"
60 : #include "IO/Observer/Actions/ObserverRegistration.hpp"
61 : #include "IO/Observer/Actions/RegisterEvents.hpp"
62 : #include "IO/Observer/Helpers.hpp"
63 : #include "IO/Observer/ObserverComponent.hpp"
64 : #include "IO/Observer/Tags.hpp"
65 : #include "NumericalAlgorithms/DiscontinuousGalerkin/Tags.hpp"
66 : #include "NumericalAlgorithms/LinearOperators/ExponentialFilter.hpp"
67 : #include "Options/Protocols/FactoryCreation.hpp"
68 : #include "Options/String.hpp"
69 : #include "Parallel/Algorithms/AlgorithmSingleton.hpp"
70 : #include "Parallel/Local.hpp"
71 : #include "Parallel/Phase.hpp"
72 : #include "Parallel/PhaseControl/CheckpointAndExitAfterWallclock.hpp"
73 : #include "Parallel/PhaseControl/ExecutePhaseChange.hpp"
74 : #include "Parallel/PhaseControl/Factory.hpp"
75 : #include "Parallel/PhaseControl/VisitAndReturn.hpp"
76 : #include "Parallel/PhaseDependentActionList.hpp"
77 : #include "Parallel/Reduction.hpp"
78 : #include "ParallelAlgorithms/Actions/AddComputeTags.hpp"
79 : #include "ParallelAlgorithms/Actions/AddSimpleTags.hpp"
80 : #include "ParallelAlgorithms/Actions/FilterAction.hpp"
81 : #include "ParallelAlgorithms/Actions/FunctionsOfTimeAreReady.hpp"
82 : #include "ParallelAlgorithms/Actions/InitializeItems.hpp"
83 : #include "ParallelAlgorithms/Actions/MemoryMonitor/ContributeMemoryData.hpp"
84 : #include "ParallelAlgorithms/Actions/MutateApply.hpp"
85 : #include "ParallelAlgorithms/Actions/RandomizeVariables.hpp"
86 : #include "ParallelAlgorithms/Actions/TerminatePhase.hpp"
87 : #include "ParallelAlgorithms/ApparentHorizonFinder/Callbacks/FindApparentHorizon.hpp"
88 : #include "ParallelAlgorithms/ApparentHorizonFinder/InterpolationTarget.hpp"
89 : #include "ParallelAlgorithms/Events/Factory.hpp"
90 : #include "ParallelAlgorithms/Events/MonitorMemory.hpp"
91 : #include "ParallelAlgorithms/Events/ObserveTimeStep.hpp"
92 : #include "ParallelAlgorithms/Events/ObserveTimeStepVolume.hpp"
93 : #include "ParallelAlgorithms/Events/Tags.hpp"
94 : #include "ParallelAlgorithms/EventsAndDenseTriggers/DenseTrigger.hpp"
95 : #include "ParallelAlgorithms/EventsAndDenseTriggers/DenseTriggers/Factory.hpp"
96 : #include "ParallelAlgorithms/EventsAndTriggers/Completion.hpp"
97 : #include "ParallelAlgorithms/EventsAndTriggers/Event.hpp"
98 : #include "ParallelAlgorithms/EventsAndTriggers/EventsAndTriggers.hpp"
99 : #include "ParallelAlgorithms/EventsAndTriggers/LogicalTriggers.hpp"
100 : #include "ParallelAlgorithms/EventsAndTriggers/Trigger.hpp"
101 : #include "ParallelAlgorithms/Interpolation/Actions/CleanUpInterpolator.hpp"
102 : #include "ParallelAlgorithms/Interpolation/Actions/InitializeInterpolationTarget.hpp"
103 : #include "ParallelAlgorithms/Interpolation/Actions/InterpolationTargetReceiveVars.hpp"
104 : #include "ParallelAlgorithms/Interpolation/Actions/InterpolatorReceivePoints.hpp"
105 : #include "ParallelAlgorithms/Interpolation/Actions/InterpolatorReceiveVolumeData.hpp"
106 : #include "ParallelAlgorithms/Interpolation/Actions/InterpolatorRegisterElement.hpp"
107 : #include "ParallelAlgorithms/Interpolation/Actions/TryToInterpolate.hpp"
108 : #include "ParallelAlgorithms/Interpolation/Callbacks/ObserveTimeSeriesOnSurface.hpp"
109 : #include "ParallelAlgorithms/Interpolation/Events/Interpolate.hpp"
110 : #include "ParallelAlgorithms/Interpolation/InterpolationTarget.hpp"
111 : #include "ParallelAlgorithms/Interpolation/Interpolator.hpp"
112 : #include "ParallelAlgorithms/Interpolation/Tags.hpp"
113 : #include "PointwiseFunctions/AnalyticData/GhScalarTensor/Factory.hpp"
114 : #include "PointwiseFunctions/AnalyticSolutions/GeneralRelativity/Factory.hpp"
115 : #include "PointwiseFunctions/AnalyticSolutions/GeneralRelativity/KerrSchild.hpp"
116 : #include "PointwiseFunctions/AnalyticSolutions/GeneralRelativity/SphericalKerrSchild.hpp"
117 : #include "PointwiseFunctions/AnalyticSolutions/GeneralRelativity/WrappedGr.hpp"
118 : #include "PointwiseFunctions/AnalyticSolutions/Tags.hpp"
119 : #include "PointwiseFunctions/GeneralRelativity/Christoffel.hpp"
120 : #include "PointwiseFunctions/GeneralRelativity/DetAndInverseSpatialMetric.hpp"
121 : #include "PointwiseFunctions/GeneralRelativity/GeneralizedHarmonic/ConstraintGammas.hpp"
122 : #include "PointwiseFunctions/GeneralRelativity/Psi4Real.hpp"
123 : #include "PointwiseFunctions/GeneralRelativity/Ricci.hpp"
124 : #include "PointwiseFunctions/GeneralRelativity/Surfaces/Tags.hpp"
125 : #include "PointwiseFunctions/GeneralRelativity/Tags.hpp"
126 : #include "PointwiseFunctions/GeneralRelativity/WeylElectric.hpp"
127 : #include "PointwiseFunctions/InitialDataUtilities/InitialData.hpp"
128 : #include "PointwiseFunctions/InitialDataUtilities/Tags/InitialData.hpp"
129 : #include "PointwiseFunctions/ScalarTensor/ScalarCharge.hpp"
130 : #include "Time/Actions/AdvanceTime.hpp"
131 : #include "Time/Actions/CleanHistory.hpp"
132 : #include "Time/Actions/RecordTimeStepperData.hpp"
133 : #include "Time/Actions/SelfStartActions.hpp"
134 : #include "Time/Actions/UpdateU.hpp"
135 : #include "Time/StepChoosers/Factory.hpp"
136 : #include "Time/StepChoosers/StepChooser.hpp"
137 : #include "Time/Tags/Time.hpp"
138 : #include "Time/TimeSequence.hpp"
139 : #include "Time/TimeSteppers/Factory.hpp"
140 : #include "Time/TimeSteppers/LtsTimeStepper.hpp"
141 : #include "Time/TimeSteppers/TimeStepper.hpp"
142 : #include "Time/Triggers/TimeTriggers.hpp"
143 : #include "Utilities/ErrorHandling/Error.hpp"
144 : #include "Utilities/Functional.hpp"
145 : #include "Utilities/ProtocolHelpers.hpp"
146 : #include "Utilities/TMPL.hpp"
147 :
148 : /// \cond
149 : namespace Frame {
150 : struct Inertial;
151 : } // namespace Frame
152 : namespace PUP {
153 : class er;
154 : } // namespace PUP
155 : namespace Parallel {
156 : template <typename Metavariables>
157 : class CProxy_GlobalCache;
158 : } // namespace Parallel
159 : /// \endcond
160 :
161 : template <typename EvolutionMetavarsDerived>
162 : struct ScalarTensorTemplateBase;
163 :
164 : namespace detail {
165 : constexpr auto make_default_phase_order() {
166 : return std::array{Parallel::Phase::Initialization,
167 : Parallel::Phase::InitializeInitialDataDependentQuantities,
168 : Parallel::Phase::Register,
169 : Parallel::Phase::InitializeTimeStepperHistory,
170 : Parallel::Phase::Evolve,
171 : Parallel::Phase::Exit};
172 : }
173 :
174 : struct ObserverTags {
175 : static constexpr size_t volume_dim = 3_st;
176 :
177 : using system = ScalarTensor::System;
178 :
179 : using variables_tag = typename system::variables_tag;
180 :
181 : using initial_data_list = gh::ScalarTensor::AnalyticData::all_analytic_data;
182 :
183 : using deriv_compute = ::Tags::DerivCompute<
184 : variables_tag, domain::Tags::Mesh<volume_dim>,
185 : domain::Tags::InverseJacobian<volume_dim, Frame::ElementLogical,
186 : Frame::Inertial>,
187 : typename system::gradient_variables>;
188 :
189 : using observe_fields = tmpl::append<
190 : tmpl::push_back<
191 : system::gh_system::variables_tag::tags_list,
192 : ScalarTensor::Tags::CswCompute<CurvedScalarWave::Tags::Psi>,
193 : ScalarTensor::Tags::CswCompute<CurvedScalarWave::Tags::Pi>,
194 : ScalarTensor::Tags::CswCompute<
195 : CurvedScalarWave::Tags::Phi<volume_dim>>,
196 : gh::Tags::GaugeH<DataVector, volume_dim, Frame::Inertial>,
197 : gh::Tags::SpacetimeDerivGaugeH<DataVector, volume_dim,
198 : Frame::Inertial>,
199 : // 3 plus 1 Tags and derivatives
200 : gr::Tags::SpatialMetric<DataVector, volume_dim, Frame::Inertial>,
201 : gr::Tags::DetSpatialMetric<DataVector>,
202 : gr::Tags::InverseSpatialMetric<DataVector, volume_dim,
203 : Frame::Inertial>,
204 : gr::Tags::Shift<DataVector, volume_dim, Frame::Inertial>,
205 : gr::Tags::Lapse<DataVector>,
206 : gr::Tags::SqrtDetSpatialMetricCompute<DataVector, volume_dim,
207 : Frame::Inertial>,
208 : gr::Tags::SpacetimeNormalOneFormCompute<DataVector, volume_dim,
209 : Frame::Inertial>,
210 : gr::Tags::SpacetimeNormalVector<DataVector, volume_dim,
211 : Frame::Inertial>,
212 : gr::Tags::InverseSpacetimeMetric<DataVector, volume_dim,
213 : Frame::Inertial>,
214 : ::Tags::deriv<
215 : gr::Tags::SpatialMetric<DataVector, volume_dim, Frame::Inertial>,
216 : tmpl::size_t<volume_dim>, Frame::Inertial>,
217 : gr::Tags::SpatialChristoffelFirstKind<DataVector, volume_dim,
218 : Frame::Inertial>,
219 : gr::Tags::SpatialChristoffelSecondKind<DataVector, volume_dim,
220 : Frame::Inertial>,
221 : // 3 plus 1 variables used by CSW
222 : gr::Tags::TraceSpatialChristoffelSecondKind<DataVector, volume_dim,
223 : Frame::Inertial>,
224 : gr::Tags::ExtrinsicCurvature<DataVector, volume_dim, Frame::Inertial>,
225 : gr::Tags::TraceExtrinsicCurvature<DataVector>,
226 : // Compute the constraints of GH
227 : gh::Tags::GaugeConstraintCompute<volume_dim, Frame::Inertial>,
228 : gh::Tags::TwoIndexConstraintCompute<volume_dim, Frame::Inertial>,
229 : gh::Tags::ThreeIndexConstraintCompute<volume_dim, Frame::Inertial>,
230 : ::Tags::DerivTensorCompute<
231 : gr::Tags::SpatialChristoffelSecondKind<DataVector, volume_dim>,
232 : ::domain::Tags::InverseJacobian<volume_dim, Frame::ElementLogical,
233 : Frame::Inertial>,
234 : ::domain::Tags::Mesh<volume_dim>>,
235 : gr::Tags::SpatialRicciCompute<DataVector, volume_dim,
236 : ::Frame::Inertial>,
237 : gr::Tags::SpatialRicciScalarCompute<DataVector, volume_dim,
238 : ::Frame::Inertial>,
239 : // Compute the constraints of CSW
240 : ScalarTensor::Tags::CswOneIndexConstraintCompute<volume_dim>,
241 : ScalarTensor::Tags::CswTwoIndexConstraintCompute<volume_dim>,
242 : // GH constraint norms
243 : ::Tags::PointwiseL2NormCompute<gh::Tags::GaugeConstraint<
244 : DataVector, volume_dim, Frame::Inertial>>,
245 : ::Tags::PointwiseL2NormCompute<gh::Tags::TwoIndexConstraint<
246 : DataVector, volume_dim, Frame::Inertial>>,
247 : ::Tags::PointwiseL2NormCompute<gh::Tags::ThreeIndexConstraint<
248 : DataVector, volume_dim, Frame::Inertial>>,
249 : // CSW constraint norms
250 : ::Tags::PointwiseL2NormCompute<ScalarTensor::Tags::Csw<
251 : CurvedScalarWave::Tags::OneIndexConstraint<volume_dim>>>,
252 : ::Tags::PointwiseL2NormCompute<ScalarTensor::Tags::Csw<
253 : CurvedScalarWave::Tags::TwoIndexConstraint<volume_dim>>>,
254 : // Damping parameters
255 : gh::ConstraintDamping::Tags::ConstraintGamma0,
256 : gh::ConstraintDamping::Tags::ConstraintGamma1,
257 : gh::ConstraintDamping::Tags::ConstraintGamma2,
258 : // Sources
259 : ScalarTensor::Tags::TraceReversedStressEnergyCompute,
260 : ScalarTensor::Tags::ScalarSource,
261 :
262 : ::domain::Tags::Coordinates<volume_dim, Frame::Grid>,
263 : ::domain::Tags::Coordinates<volume_dim, Frame::Inertial>>,
264 : // The 4-index constraint is only implemented in 3d
265 : tmpl::list<
266 : gh::Tags::FourIndexConstraintCompute<volume_dim, Frame::Inertial>,
267 : ScalarTensor::Tags::FConstraintCompute<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::DerivTensorCompute<
274 : gr::Tags::ExtrinsicCurvature<DataVector, volume_dim>,
275 : ::domain::Tags::InverseJacobian<volume_dim, Frame::ElementLogical,
276 : Frame::Inertial>,
277 : ::domain::Tags::Mesh<volume_dim>>,
278 : gr::Tags::WeylElectricCompute<DataVector, volume_dim,
279 : Frame::Inertial>,
280 : gr::Tags::Psi4RealCompute<Frame::Inertial>>>;
281 : using non_tensor_compute_tags = tmpl::list<
282 : ::Events::Tags::ObserverMeshCompute<volume_dim>,
283 : ::Events::Tags::ObserverCoordinatesCompute<volume_dim, Frame::Inertial>,
284 : ::Events::Tags::ObserverInverseJacobianCompute<
285 : volume_dim, Frame::ElementLogical, Frame::Inertial>,
286 : ::Events::Tags::ObserverJacobianCompute<volume_dim, Frame::ElementLogical,
287 : Frame::Inertial>,
288 : ::Events::Tags::ObserverDetInvJacobianCompute<Frame::ElementLogical,
289 : Frame::Inertial>,
290 : ::Events::Tags::ObserverMeshVelocityCompute<volume_dim, Frame::Inertial>,
291 : gh::gauges::Tags::GaugeAndDerivativeCompute<volume_dim>>;
292 :
293 : using field_observations =
294 : dg::Events::field_observations<volume_dim, observe_fields,
295 : non_tensor_compute_tags>;
296 :
297 : // We collect here all the tags needed for interpolation in all surfaces
298 : using scalar_charge_vars_to_interpolate_to_target = tmpl::list<
299 : gr::Tags::SpatialMetric<DataVector, volume_dim, Frame::Inertial>,
300 : gr::Tags::InverseSpatialMetric<DataVector, volume_dim, Frame::Inertial>,
301 : CurvedScalarWave::Tags::Phi<volume_dim>, CurvedScalarWave::Tags::Psi>;
302 :
303 : using scalar_charge_compute_items_on_target = tmpl::list<
304 : ylm::Tags::ThetaPhiCompute<::Frame::Inertial>,
305 : ylm::Tags::RadiusCompute<::Frame::Inertial>,
306 : ylm::Tags::RhatCompute<::Frame::Inertial>,
307 : ylm::Tags::InvJacobianCompute<::Frame::Inertial>,
308 : ylm::Tags::JacobianCompute<::Frame::Inertial>,
309 : ylm::Tags::DxRadiusCompute<::Frame::Inertial>,
310 : ylm::Tags::NormalOneFormCompute<::Frame::Inertial>,
311 : ylm::Tags::OneOverOneFormMagnitudeCompute<DataVector, volume_dim,
312 : ::Frame::Inertial>,
313 : ylm::Tags::UnitNormalOneFormCompute<::Frame::Inertial>,
314 : ylm::Tags::UnitNormalVectorCompute<::Frame::Inertial>,
315 : gr::surfaces::Tags::AreaElementCompute<::Frame::Inertial>,
316 : ScalarTensor::StrahlkorperScalar::Tags::ScalarChargeIntegrandCompute,
317 : gr::surfaces::Tags::SurfaceIntegralCompute<
318 : ScalarTensor::StrahlkorperScalar::Tags::ScalarChargeIntegrand,
319 : ::Frame::Inertial>,
320 : gr::surfaces::Tags::SurfaceIntegralCompute<CurvedScalarWave::Tags::Psi,
321 : ::Frame::Inertial>,
322 : CurvedScalarWave::Tags::PsiSquaredCompute,
323 : gr::surfaces::Tags::SurfaceIntegralCompute<
324 : CurvedScalarWave::Tags::PsiSquared, ::Frame::Inertial>>;
325 :
326 : using scalar_charge_surface_obs_tags = tmpl::list<
327 : gr::surfaces::Tags::SurfaceIntegralCompute<
328 : ScalarTensor::StrahlkorperScalar::Tags::ScalarChargeIntegrand,
329 : ::Frame::Inertial>,
330 : gr::surfaces::Tags::SurfaceIntegralCompute<CurvedScalarWave::Tags::Psi,
331 : ::Frame::Inertial>,
332 : gr::surfaces::Tags::SurfaceIntegralCompute<
333 : CurvedScalarWave::Tags::PsiSquared, ::Frame::Inertial>>;
334 : };
335 :
336 : template <bool LocalTimeStepping>
337 : struct FactoryCreation : tt::ConformsTo<Options::protocols::FactoryCreation> {
338 : static constexpr size_t volume_dim = 3_st;
339 :
340 : using system = ScalarTensor::System;
341 :
342 : using initial_data_list = gh::ScalarTensor::AnalyticData::all_analytic_data;
343 : using factory_classes = tmpl::map<
344 : tmpl::pair<DenseTrigger, DenseTriggers::standard_dense_triggers>,
345 : tmpl::pair<DomainCreator<volume_dim>, domain_creators<volume_dim>>,
346 : tmpl::pair<Event,
347 : tmpl::flatten<tmpl::list<
348 : Events::Completion, Events::MonitorMemory<volume_dim>,
349 : typename detail::ObserverTags::field_observations,
350 : Events::time_events<system>,
351 : dg::Events::ObserveTimeStepVolume<volume_dim>>>>,
352 : tmpl::pair<
353 : ScalarTensor::BoundaryConditions::BoundaryCondition,
354 : ScalarTensor::BoundaryConditions::standard_boundary_conditions>,
355 : tmpl::pair<gh::gauges::GaugeCondition, gh::gauges::all_gauges>,
356 : tmpl::pair<evolution::initial_data::InitialData, initial_data_list>,
357 : tmpl::pair<LtsTimeStepper, TimeSteppers::lts_time_steppers>,
358 : tmpl::pair<PhaseChange, PhaseControl::factory_creatable_classes>,
359 : tmpl::pair<StepChooser<StepChooserUse::LtsStep>,
360 : StepChoosers::standard_step_choosers<system>>,
361 : tmpl::pair<
362 : StepChooser<StepChooserUse::Slab>,
363 : StepChoosers::standard_slab_choosers<system, LocalTimeStepping>>,
364 : tmpl::pair<TimeSequence<double>,
365 : TimeSequences::all_time_sequences<double>>,
366 : tmpl::pair<TimeSequence<std::uint64_t>,
367 : TimeSequences::all_time_sequences<std::uint64_t>>,
368 : tmpl::pair<TimeStepper, TimeSteppers::time_steppers>,
369 : tmpl::pair<Trigger, tmpl::append<Triggers::logical_triggers,
370 : Triggers::time_triggers>>>;
371 : };
372 : } // namespace detail
373 :
374 : template <class EvolutionMetavarsDerived>
375 0 : struct ScalarTensorTemplateBase {
376 0 : using derived_metavars = EvolutionMetavarsDerived;
377 :
378 0 : static constexpr size_t volume_dim = 3_st;
379 0 : using system = ScalarTensor::System;
380 0 : using TimeStepperBase = LtsTimeStepper;
381 :
382 0 : static constexpr bool local_time_stepping =
383 : TimeStepperBase::local_time_stepping;
384 0 : static constexpr bool use_dg_element_collection = false;
385 :
386 : // NOLINTNEXTLINE(google-runtime-references)
387 0 : void pup(PUP::er& /*p*/) {}
388 :
389 0 : using factory_creation = detail::FactoryCreation<local_time_stepping>;
390 :
391 0 : using observed_reduction_data_tags =
392 : observers::collect_reduction_data_tags<tmpl::push_back<
393 : tmpl::at<typename factory_creation::factory_classes, Event>>>;
394 :
395 0 : using initialize_initial_data_dependent_quantities_actions = tmpl::list<
396 : Initialization::Actions::AddComputeTags<
397 : ScalarTensor::Initialization::scalar_tensor_3plus1_compute_tags<
398 : volume_dim>>,
399 : Actions::MutateApply<gh::gauges::SetPiAndPhiFromConstraints<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 : };
|