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