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/GridCenters.hpp"
10 : #include "ControlSystem/Actions/InitializeMeasurements.hpp"
11 : #include "ControlSystem/Actions/LimitTimeStep.hpp"
12 : #include "ControlSystem/CleanFunctionsOfTime.hpp"
13 : #include "ControlSystem/Component.hpp"
14 : #include "ControlSystem/Measurements/BNSCenterOfMass.hpp"
15 : #include "ControlSystem/Metafunctions.hpp"
16 : #include "ControlSystem/Systems/Expansion.hpp"
17 : #include "ControlSystem/Systems/GridCenters.hpp"
18 : #include "ControlSystem/Systems/Rotation.hpp"
19 : #include "ControlSystem/Systems/Translation.hpp"
20 : #include "ControlSystem/Trigger.hpp"
21 : #include "DataStructures/DataBox/PrefixHelpers.hpp"
22 : #include "DataStructures/DataBox/Tag.hpp"
23 : #include "DataStructures/Tensor/EagerMath/RaiseOrLowerIndex.hpp"
24 : #include "DataStructures/Tensor/IndexType.hpp"
25 : #include "Domain/Creators/BinaryCompactObject.hpp"
26 : #include "Domain/Creators/Factory3D.hpp"
27 : #include "Domain/Tags.hpp"
28 : #include "Evolution/Actions/RunEventsAndDenseTriggers.hpp"
29 : #include "Evolution/Actions/RunEventsAndTriggers.hpp"
30 : #include "Evolution/BoundaryCorrection.hpp"
31 : #include "Evolution/ComputeTags.hpp"
32 : #include "Evolution/Conservative/UpdateConservatives.hpp"
33 : #include "Evolution/Conservative/UpdatePrimitives.hpp"
34 : #include "Evolution/DgSubcell/Actions/Initialize.hpp"
35 : #include "Evolution/DgSubcell/Actions/Labels.hpp"
36 : #include "Evolution/DgSubcell/Actions/ReconstructionCommunication.hpp"
37 : #include "Evolution/DgSubcell/Actions/SelectNumericalMethod.hpp"
38 : #include "Evolution/DgSubcell/Actions/TakeTimeStep.hpp"
39 : #include "Evolution/DgSubcell/Actions/TciAndRollback.hpp"
40 : #include "Evolution/DgSubcell/Actions/TciAndSwitchToDg.hpp"
41 : #include "Evolution/DgSubcell/CartesianFluxDivergence.hpp"
42 : #include "Evolution/DgSubcell/CellCenteredFlux.hpp"
43 : #include "Evolution/DgSubcell/ComputeBoundaryTerms.hpp"
44 : #include "Evolution/DgSubcell/CorrectPackagedData.hpp"
45 : #include "Evolution/DgSubcell/GetActiveTag.hpp"
46 : #include "Evolution/DgSubcell/NeighborReconstructedFaceSolution.hpp"
47 : #include "Evolution/DgSubcell/PerssonTci.hpp"
48 : #include "Evolution/DgSubcell/PrepareNeighborData.hpp"
49 : #include "Evolution/DgSubcell/SetInterpolators.hpp"
50 : #include "Evolution/DgSubcell/SubcellEqualRateRegion.hpp"
51 : #include "Evolution/DgSubcell/Tags/ObserverCoordinates.hpp"
52 : #include "Evolution/DgSubcell/Tags/ObserverMesh.hpp"
53 : #include "Evolution/DgSubcell/Tags/ObserverMeshVelocity.hpp"
54 : #include "Evolution/DgSubcell/Tags/TciStatus.hpp"
55 : #include "Evolution/DgSubcell/TwoMeshRdmpTci.hpp"
56 : #include "Evolution/DiscontinuousGalerkin/Actions/ApplyBoundaryCorrections.hpp"
57 : #include "Evolution/DiscontinuousGalerkin/Actions/ComputeTimeDerivative.hpp"
58 : #include "Evolution/DiscontinuousGalerkin/CleanMortarHistory.hpp"
59 : #include "Evolution/DiscontinuousGalerkin/DgElementArray.hpp"
60 : #include "Evolution/DiscontinuousGalerkin/EqualRateLts/ChangeFixedLtsRatio.hpp"
61 : #include "Evolution/DiscontinuousGalerkin/EqualRateLts/FixedLtsRatio.hpp"
62 : #include "Evolution/DiscontinuousGalerkin/EqualRateLts/NonconformingEqualRateRegions.hpp"
63 : #include "Evolution/DiscontinuousGalerkin/Initialization/Mortars.hpp"
64 : #include "Evolution/DiscontinuousGalerkin/Initialization/QuadratureTag.hpp"
65 : #include "Evolution/DiscontinuousGalerkin/Initialization/SetupEqualRateRegions.hpp"
66 : #include "Evolution/DiscontinuousGalerkin/Initialization/SpectralFilters.hpp"
67 : #include "Evolution/DiscontinuousGalerkin/UsingSubcell.hpp"
68 : #include "Evolution/Initialization/ConservativeSystem.hpp"
69 : #include "Evolution/Initialization/DgDomain.hpp"
70 : #include "Evolution/Initialization/Evolution.hpp"
71 : #include "Evolution/Initialization/NonconservativeSystem.hpp"
72 : #include "Evolution/Initialization/SetVariables.hpp"
73 : #include "Evolution/NumericInitialData.hpp"
74 : #include "Evolution/Systems/Cce/Callbacks/DumpBondiSachsOnWorldtube.hpp"
75 : #include "Evolution/Systems/GeneralizedHarmonic/BoundaryConditions/Factory.hpp"
76 : #include "Evolution/Systems/GeneralizedHarmonic/Equations.hpp"
77 : #include "Evolution/Systems/GeneralizedHarmonic/GaugeSourceFunctions/Factory.hpp"
78 : #include "Evolution/Systems/GeneralizedHarmonic/GaugeSourceFunctions/Gauges.hpp"
79 : #include "Evolution/Systems/GeneralizedHarmonic/GaugeSourceFunctions/SetPiAndPhiFromConstraints.hpp"
80 : #include "Evolution/Systems/GeneralizedHarmonic/GaugeSourceFunctions/Tags/GaugeCondition.hpp"
81 : #include "Evolution/Systems/GeneralizedHarmonic/Initialize.hpp"
82 : #include "Evolution/Systems/GeneralizedHarmonic/System.hpp"
83 : #include "Evolution/Systems/GeneralizedHarmonic/Tags.hpp"
84 : #include "Evolution/Systems/GrMhd/GhValenciaDivClean/Actions/SetInitialData.hpp"
85 : #include "Evolution/Systems/GrMhd/GhValenciaDivClean/AllSolutions.hpp"
86 : #include "Evolution/Systems/GrMhd/GhValenciaDivClean/BoundaryConditions/Factory.hpp"
87 : #include "Evolution/Systems/GrMhd/GhValenciaDivClean/BoundaryCorrections/Factory.hpp"
88 : #include "Evolution/Systems/GrMhd/GhValenciaDivClean/FiniteDifference/Tag.hpp"
89 : #include "Evolution/Systems/GrMhd/GhValenciaDivClean/SetPiAndPhiFromConstraints.hpp"
90 : #include "Evolution/Systems/GrMhd/GhValenciaDivClean/Subcell/FixConservativesAndComputePrims.hpp"
91 : #include "Evolution/Systems/GrMhd/GhValenciaDivClean/Subcell/NeighborPackagedData.hpp"
92 : #include "Evolution/Systems/GrMhd/GhValenciaDivClean/Subcell/PrimitiveGhostData.hpp"
93 : #include "Evolution/Systems/GrMhd/GhValenciaDivClean/Subcell/PrimsAfterRollback.hpp"
94 : #include "Evolution/Systems/GrMhd/GhValenciaDivClean/Subcell/ResizeAndComputePrimitives.hpp"
95 : #include "Evolution/Systems/GrMhd/GhValenciaDivClean/Subcell/TciOnDgGrid.hpp"
96 : #include "Evolution/Systems/GrMhd/GhValenciaDivClean/Subcell/TciOnFdGrid.hpp"
97 : #include "Evolution/Systems/GrMhd/GhValenciaDivClean/Subcell/TimeDerivative.hpp"
98 : #include "Evolution/Systems/GrMhd/GhValenciaDivClean/Subcell/ZeroTimeDerivatives.hpp"
99 : #include "Evolution/Systems/GrMhd/GhValenciaDivClean/SystemM1.hpp"
100 : #include "Evolution/Systems/GrMhd/GhValenciaDivClean/TimeDerivativeTerms.hpp"
101 : #include "Evolution/Systems/GrMhd/ValenciaDivClean/AllSolutions.hpp"
102 : #include "Evolution/Systems/GrMhd/ValenciaDivClean/BoundaryConditions/Factory.hpp"
103 : #include "Evolution/Systems/GrMhd/ValenciaDivClean/FixConservatives.hpp"
104 : #include "Evolution/Systems/GrMhd/ValenciaDivClean/KastaunEtAl.hpp"
105 : #include "Evolution/Systems/GrMhd/ValenciaDivClean/NewmanHamlin.hpp"
106 : #include "Evolution/Systems/GrMhd/ValenciaDivClean/PalenzuelaEtAl.hpp"
107 : #include "Evolution/Systems/GrMhd/ValenciaDivClean/QuadrupoleFormula.hpp"
108 : #include "Evolution/Systems/GrMhd/ValenciaDivClean/SetVariablesNeededFixingToFalse.hpp"
109 : #include "Evolution/Systems/GrMhd/ValenciaDivClean/Subcell/SetInitialRdmpData.hpp"
110 : #include "Evolution/Systems/GrMhd/ValenciaDivClean/System.hpp"
111 : #include "Evolution/Systems/GrMhd/ValenciaDivClean/Tags.hpp"
112 : #include "Evolution/Systems/RadiationTransport/NoNeutrinos/System.hpp"
113 : #include "Evolution/Triggers/SeparationLessThan.hpp"
114 : #include "Evolution/TypeTraits.hpp"
115 : #include "Evolution/VariableFixing/Actions.hpp"
116 : #include "Evolution/VariableFixing/FixToAtmosphere.hpp"
117 : #include "Evolution/VariableFixing/LimitLorentzFactor.hpp"
118 : #include "Evolution/VariableFixing/ParameterizedDeleptonization.hpp"
119 : #include "Evolution/VariableFixing/Tags.hpp"
120 : #include "IO/Importers/Actions/ReadVolumeData.hpp"
121 : #include "IO/Importers/Actions/ReceiveVolumeData.hpp"
122 : #include "IO/Importers/Actions/RegisterWithElementDataReader.hpp"
123 : #include "IO/Importers/ElementDataReader.hpp"
124 : #include "IO/Observer/Actions/ObserverRegistration.hpp"
125 : #include "IO/Observer/Actions/RegisterEvents.hpp"
126 : #include "IO/Observer/Helpers.hpp"
127 : #include "IO/Observer/ObserverComponent.hpp"
128 : #include "IO/Observer/Tags.hpp"
129 : #include "NumericalAlgorithms/DiscontinuousGalerkin/Formulation.hpp"
130 : #include "NumericalAlgorithms/DiscontinuousGalerkin/Tags.hpp"
131 : #include "NumericalAlgorithms/LinearOperators/Filters/Factory.hpp"
132 : #include "NumericalAlgorithms/LinearOperators/Filters/SphericalShell.hpp"
133 : #include "NumericalAlgorithms/LinearOperators/Filters/Tag.hpp"
134 : #include "NumericalAlgorithms/LinearOperators/PartialDerivatives.hpp"
135 : #include "Options/Protocols/FactoryCreation.hpp"
136 : #include "Options/String.hpp"
137 : #include "Parallel/Algorithms/AlgorithmSingleton.hpp"
138 : #include "Parallel/Local.hpp"
139 : #include "Parallel/Phase.hpp"
140 : #include "Parallel/PhaseControl/ExecutePhaseChange.hpp"
141 : #include "Parallel/PhaseControl/Factory.hpp"
142 : #include "Parallel/PhaseControl/VisitAndReturn.hpp"
143 : #include "Parallel/PhaseDependentActionList.hpp"
144 : #include "Parallel/Protocols/RegistrationMetavariables.hpp"
145 : #include "Parallel/Reduction.hpp"
146 : #include "ParallelAlgorithms/Actions/AddComputeTags.hpp"
147 : #include "ParallelAlgorithms/Actions/AddSimpleTags.hpp"
148 : #include "ParallelAlgorithms/Actions/FunctionsOfTimeAreReady.hpp"
149 : #include "ParallelAlgorithms/Actions/InitializeItems.hpp"
150 : #include "ParallelAlgorithms/Actions/MutateApply.hpp"
151 : #include "ParallelAlgorithms/Actions/SpectralFilter.hpp"
152 : #include "ParallelAlgorithms/Actions/TerminatePhase.hpp"
153 : #include "ParallelAlgorithms/Events/ChangeFixedLtsRatio.hpp"
154 : #include "ParallelAlgorithms/Events/Completion.hpp"
155 : #include "ParallelAlgorithms/Events/Factory.hpp"
156 : #include "ParallelAlgorithms/Events/ObserveAtExtremum.hpp"
157 : #include "ParallelAlgorithms/Events/ObserveDataBox.hpp"
158 : #include "ParallelAlgorithms/Events/ObserveTimeStepVolume.hpp"
159 : #include "ParallelAlgorithms/EventsAndDenseTriggers/DenseTrigger.hpp"
160 : #include "ParallelAlgorithms/EventsAndDenseTriggers/DenseTriggers/Factory.hpp"
161 : #include "ParallelAlgorithms/EventsAndTriggers/Actions/RunEventsOnFailure.hpp"
162 : #include "ParallelAlgorithms/EventsAndTriggers/Event.hpp"
163 : #include "ParallelAlgorithms/EventsAndTriggers/EventsAndTriggers.hpp"
164 : #include "ParallelAlgorithms/EventsAndTriggers/LogicalTriggers.hpp"
165 : #include "ParallelAlgorithms/EventsAndTriggers/Trigger.hpp"
166 : #include "ParallelAlgorithms/Interpolation/Actions/ElementInitInterpPoints.hpp"
167 : #include "ParallelAlgorithms/Interpolation/Actions/InitializeInterpolationTarget.hpp"
168 : #include "ParallelAlgorithms/Interpolation/Callbacks/ObserveTimeSeriesOnSurface.hpp"
169 : #include "ParallelAlgorithms/Interpolation/Events/InterpolateWithoutInterpComponent.hpp"
170 : #include "ParallelAlgorithms/Interpolation/InterpolationTarget.hpp"
171 : #include "ParallelAlgorithms/Interpolation/Protocols/InterpolationTargetTag.hpp"
172 : #include "ParallelAlgorithms/Interpolation/Tags.hpp"
173 : #include "ParallelAlgorithms/Interpolation/Targets/KerrHorizon.hpp"
174 : #include "ParallelAlgorithms/Interpolation/Targets/Sphere.hpp"
175 : #include "PointwiseFunctions/AnalyticData/AnalyticData.hpp"
176 : #include "PointwiseFunctions/AnalyticData/GhGrMhd/Factory.hpp"
177 : #include "PointwiseFunctions/AnalyticData/GrMhd/BlastWave.hpp"
178 : #include "PointwiseFunctions/AnalyticData/GrMhd/BondiHoyleAccretion.hpp"
179 : #include "PointwiseFunctions/AnalyticData/GrMhd/InitialMagneticFields/Factory.hpp"
180 : #include "PointwiseFunctions/AnalyticData/GrMhd/MagneticFieldLoop.hpp"
181 : #include "PointwiseFunctions/AnalyticData/GrMhd/MagneticRotor.hpp"
182 : #include "PointwiseFunctions/AnalyticData/GrMhd/MagnetizedFmDisk.hpp"
183 : #include "PointwiseFunctions/AnalyticData/GrMhd/OrszagTangVortex.hpp"
184 : #include "PointwiseFunctions/AnalyticData/Tags.hpp"
185 : #include "PointwiseFunctions/AnalyticSolutions/AnalyticSolution.hpp"
186 : #include "PointwiseFunctions/AnalyticSolutions/GeneralRelativity/Factory.hpp"
187 : #include "PointwiseFunctions/AnalyticSolutions/GeneralRelativity/KerrSchild.hpp"
188 : #include "PointwiseFunctions/AnalyticSolutions/GeneralRelativity/WrappedGr.hpp"
189 : #include "PointwiseFunctions/AnalyticSolutions/GhGrMhd/Factory.hpp"
190 : #include "PointwiseFunctions/AnalyticSolutions/GhRelativisticEuler/Factory.hpp"
191 : #include "PointwiseFunctions/AnalyticSolutions/GrMhd/AlfvenWave.hpp"
192 : #include "PointwiseFunctions/AnalyticSolutions/GrMhd/BondiMichel.hpp"
193 : #include "PointwiseFunctions/AnalyticSolutions/GrMhd/KomissarovShock.hpp"
194 : #include "PointwiseFunctions/AnalyticSolutions/GrMhd/SmoothFlow.hpp"
195 : #include "PointwiseFunctions/AnalyticSolutions/RadiationTransport/MonteCarlo/Factory.hpp"
196 : #include "PointwiseFunctions/AnalyticSolutions/RadiationTransport/MonteCarlo/HomogeneousSphere.hpp"
197 : #include "PointwiseFunctions/AnalyticSolutions/RelativisticEuler/FishboneMoncriefDisk.hpp"
198 : #include "PointwiseFunctions/AnalyticSolutions/RelativisticEuler/SmoothFlow.hpp"
199 : #include "PointwiseFunctions/AnalyticSolutions/RelativisticEuler/TovStar.hpp"
200 : #include "PointwiseFunctions/AnalyticSolutions/Tags.hpp"
201 : #include "PointwiseFunctions/GeneralRelativity/Christoffel.hpp"
202 : #include "PointwiseFunctions/GeneralRelativity/DetAndInverseSpatialMetric.hpp"
203 : #include "PointwiseFunctions/GeneralRelativity/GeneralizedHarmonic/ConstraintGammas.hpp"
204 : #include "PointwiseFunctions/GeneralRelativity/GeneralizedHarmonic/ExtrinsicCurvature.hpp"
205 : #include "PointwiseFunctions/GeneralRelativity/GeneralizedHarmonic/SecondTimeDerivOfSpacetimeMetric.hpp"
206 : #include "PointwiseFunctions/GeneralRelativity/Lapse.hpp"
207 : #include "PointwiseFunctions/GeneralRelativity/Psi4Real.hpp"
208 : #include "PointwiseFunctions/GeneralRelativity/Ricci.hpp"
209 : #include "PointwiseFunctions/GeneralRelativity/Shift.hpp"
210 : #include "PointwiseFunctions/GeneralRelativity/SpatialMetric.hpp"
211 : #include "PointwiseFunctions/GeneralRelativity/Surfaces/Tags.hpp"
212 : #include "PointwiseFunctions/GeneralRelativity/Tags.hpp"
213 : #include "PointwiseFunctions/GeneralRelativity/WeylElectric.hpp"
214 : #include "PointwiseFunctions/Hydro/EquationsOfState/Factory.hpp"
215 : #include "PointwiseFunctions/Hydro/LowerSpatialFourVelocity.hpp"
216 : #include "PointwiseFunctions/Hydro/MassFlux.hpp"
217 : #include "PointwiseFunctions/Hydro/MassWeightedFluidItems.hpp"
218 : #include "PointwiseFunctions/Hydro/SpecificEntropy.hpp"
219 : #include "PointwiseFunctions/Hydro/Tags.hpp"
220 : #include "PointwiseFunctions/Hydro/TransportVelocity.hpp"
221 : #include "PointwiseFunctions/InitialDataUtilities/Tags/InitialData.hpp"
222 : #include "PointwiseFunctions/MathFunctions/Factory.hpp"
223 : #include "PointwiseFunctions/MathFunctions/MathFunction.hpp"
224 : #include "Time/Actions/SelfStartActions.hpp"
225 : #include "Time/AdvanceTime.hpp"
226 : #include "Time/ChangeSlabSize/Action.hpp"
227 : #include "Time/ChangeStepSize.hpp"
228 : #include "Time/ChangeTimeStepperOrder.hpp"
229 : #include "Time/CleanHistory.hpp"
230 : #include "Time/RecordTimeStepperData.hpp"
231 : #include "Time/StepChoosers/Factory.hpp"
232 : #include "Time/StepChoosers/StepChooser.hpp"
233 : #include "Time/Tags/Time.hpp"
234 : #include "Time/Tags/TimeStepId.hpp"
235 : #include "Time/TimeSequence.hpp"
236 : #include "Time/TimeSteppers/Factory.hpp"
237 : #include "Time/TimeSteppers/LtsTimeStepper.hpp"
238 : #include "Time/TimeSteppers/TimeStepper.hpp"
239 : #include "Time/Triggers/TimeTriggers.hpp"
240 : #include "Time/UpdateU.hpp"
241 : #include "Utilities/ErrorHandling/Error.hpp"
242 : #include "Utilities/Functional.hpp"
243 : #include "Utilities/NoSuchType.hpp"
244 : #include "Utilities/ProtocolHelpers.hpp"
245 : #include "Utilities/TMPL.hpp"
246 :
247 : /// \cond
248 : namespace Frame {
249 :
250 : struct Inertial;
251 : } // namespace Frame
252 : namespace PUP {
253 : class er;
254 : } // namespace PUP
255 : namespace Parallel {
256 : template <typename Metavariables>
257 : class CProxy_GlobalCache;
258 : } // namespace Parallel
259 : /// \endcond
260 :
261 : template <bool UseDgSubcell>
262 0 : struct GhValenciaDivCleanDefaults {
263 : public:
264 0 : static constexpr size_t volume_dim = 3;
265 0 : using domain_frame = Frame::Inertial;
266 0 : static constexpr bool use_damped_harmonic_rollon = true;
267 0 : using temporal_id = Tags::TimeStepId;
268 0 : using TimeStepperBase = TimeStepper;
269 :
270 0 : static constexpr bool local_time_stepping =
271 : TimeStepperBase::local_time_stepping;
272 0 : static constexpr bool use_dg_element_collection = false;
273 :
274 0 : using neutrino_system = RadiationTransport::NoNeutrinos::System;
275 :
276 0 : using system = grmhd::GhValenciaDivClean::System<neutrino_system>;
277 0 : using analytic_variables_tags =
278 : typename system::primitive_variables_tag::tags_list;
279 0 : using analytic_solution_fields =
280 : tmpl::append<typename system::primitive_variables_tag::tags_list,
281 : typename system::gh_system::variables_tag::tags_list>;
282 0 : using ordered_list_of_primitive_recovery_schemes = tmpl::list<
283 : grmhd::ValenciaDivClean::PrimitiveRecoverySchemes::KastaunEtAl,
284 : grmhd::ValenciaDivClean::PrimitiveRecoverySchemes::NewmanHamlin,
285 : grmhd::ValenciaDivClean::PrimitiveRecoverySchemes::PalenzuelaEtAl>;
286 :
287 0 : using initialize_initial_data_dependent_quantities_actions = tmpl::list<
288 : gh::Actions::InitializeGhAnd3Plus1Variables<volume_dim>,
289 : tmpl::conditional_t<UseDgSubcell,
290 : grmhd::GhValenciaDivClean::SetPiAndPhiFromConstraints,
291 : gh::gauges::SetPiAndPhiFromConstraints<
292 : ghmhd::GhValenciaDivClean::InitialData::
293 : analytic_solutions_and_data_list,
294 : 3>>,
295 : Initialization::Actions::AddComputeTags<
296 : tmpl::list<gr::Tags::SqrtDetSpatialMetricCompute<
297 : DataVector, volume_dim, domain_frame>>>,
298 : VariableFixing::Actions::FixVariables<
299 : VariableFixing::FixToAtmosphere<volume_dim>>,
300 : VariableFixing::Actions::FixVariables<VariableFixing::LimitLorentzFactor>,
301 : Actions::UpdateConservatives,
302 : tmpl::conditional_t<
303 : UseDgSubcell,
304 : tmpl::list<
305 : Initialization::Actions::AddSimpleTags<
306 : grmhd::ValenciaDivClean::SetVariablesNeededFixingToFalse>,
307 :
308 : evolution::dg::subcell::Actions::SetAndCommunicateInitialRdmpData<
309 : volume_dim,
310 : grmhd::ValenciaDivClean::subcell::SetInitialRdmpData>,
311 : evolution::dg::subcell::Actions::ComputeAndSendTciOnInitialGrid<
312 : volume_dim, system,
313 : grmhd::GhValenciaDivClean::subcell::TciOnFdGrid>,
314 : evolution::dg::subcell::Actions::SetInitialGridFromTciData<
315 : volume_dim, system>,
316 : Actions::MutateApply<
317 : grmhd::GhValenciaDivClean::subcell::ResizeAndComputePrims<
318 : ordered_list_of_primitive_recovery_schemes>>,
319 :
320 : VariableFixing::Actions::FixVariables<
321 : VariableFixing::FixToAtmosphere<volume_dim>>,
322 : VariableFixing::Actions::FixVariables<
323 : VariableFixing::LimitLorentzFactor>,
324 : Actions::UpdateConservatives,
325 : grmhd::GhValenciaDivClean::SetPiAndPhiFromConstraints>,
326 : tmpl::list<>>,
327 : Parallel::Actions::TerminatePhase>;
328 :
329 : // NOLINTNEXTLINE(google-runtime-references)
330 0 : void pup(PUP::er& /*p*/) {}
331 : };
332 :
333 : template <typename EvolutionMetavarsDerived, bool UseDgSubcell,
334 : bool UseControlSystems, bool UseParametrizedDeleptonization>
335 0 : struct GhValenciaDivCleanTemplateBase;
336 :
337 : template <bool UseDgSubcell, bool UseControlSystems,
338 : bool UseParametrizedDeleptonization,
339 : template <bool, bool, typename...> class EvolutionMetavarsDerived,
340 : typename... InterpolationTargetTags>
341 0 : struct GhValenciaDivCleanTemplateBase<
342 : EvolutionMetavarsDerived<UseControlSystems, UseParametrizedDeleptonization,
343 : InterpolationTargetTags...>,
344 : UseDgSubcell, UseControlSystems, UseParametrizedDeleptonization>
345 : : public virtual GhValenciaDivCleanDefaults<UseDgSubcell> {
346 0 : using derived_metavars =
347 : EvolutionMetavarsDerived<UseControlSystems,
348 : UseParametrizedDeleptonization,
349 : InterpolationTargetTags...>;
350 0 : using defaults = GhValenciaDivCleanDefaults<UseDgSubcell>;
351 0 : static constexpr size_t volume_dim = defaults::volume_dim;
352 0 : using domain_frame = typename defaults::domain_frame;
353 0 : static constexpr bool use_damped_harmonic_rollon =
354 : defaults::use_damped_harmonic_rollon;
355 0 : using temporal_id = typename defaults::temporal_id;
356 0 : using TimeStepperBase = typename defaults::TimeStepperBase;
357 0 : static constexpr bool local_time_stepping = defaults::local_time_stepping;
358 0 : static constexpr bool use_dg_element_collection =
359 : defaults::use_dg_element_collection;
360 0 : using system = typename defaults::system;
361 :
362 0 : using analytic_variables_tags = typename defaults::analytic_variables_tags;
363 0 : using analytic_solution_fields = typename defaults::analytic_solution_fields;
364 0 : using ordered_list_of_primitive_recovery_schemes =
365 : typename defaults::ordered_list_of_primitive_recovery_schemes;
366 0 : using initialize_initial_data_dependent_quantities_actions =
367 : typename defaults::initialize_initial_data_dependent_quantities_actions;
368 :
369 0 : static constexpr bool use_dg_subcell = UseDgSubcell;
370 0 : static constexpr bool use_control_systems = UseControlSystems;
371 0 : using initial_data_list =
372 : ghmhd::GhValenciaDivClean::InitialData::initial_data_list;
373 :
374 : // Boolean verifying if parameterized deleptonization will be active. This
375 : // will only be active for CCSN evolution.
376 0 : using parameterized_deleptonization =
377 : tmpl::conditional_t<UseParametrizedDeleptonization,
378 : VariableFixing::Actions::FixVariables<
379 : VariableFixing::ParameterizedDeleptonization>,
380 : tmpl::list<>>;
381 :
382 0 : using initial_data_tag = evolution::initial_data::Tags::InitialData;
383 0 : using equation_of_state_tag = hydro::Tags::GrmhdEquationOfState;
384 0 : using measurement = control_system::measurements::BothNSCenters;
385 0 : using control_systems = tmpl::conditional_t<
386 : use_control_systems,
387 : tmpl::list<control_system::Systems::Rotation<3, measurement>,
388 : control_system::Systems::Expansion<2, measurement>,
389 : control_system::Systems::Translation<2, measurement, 2>,
390 : control_system::Systems::GridCenters<2, measurement>>,
391 : tmpl::list<>>;
392 :
393 0 : using interpolator_source_vars =
394 : tmpl::remove_duplicates<tmpl::flatten<tmpl::list<
395 : typename InterpolationTargetTags::vars_to_interpolate_to_target...>>>;
396 :
397 0 : using analytic_compute = evolution::Tags::AnalyticSolutionsCompute<
398 : volume_dim, analytic_solution_fields, use_dg_subcell, initial_data_list>;
399 0 : using error_compute = Tags::ErrorsCompute<analytic_solution_fields>;
400 0 : using error_tags = db::wrap_tags_in<Tags::Error, analytic_solution_fields>;
401 0 : using observe_fields = tmpl::append<
402 : typename system::variables_tag::tags_list,
403 : typename system::primitive_variables_tag::tags_list, error_tags,
404 : tmpl::list<
405 : hydro::Tags::TildeDInHalfPlaneCompute<
406 : DataVector, volume_dim,
407 : ::hydro::HalfPlaneIntegralMask::PositiveXOnly,
408 : Events::Tags::ObserverCoordinates<3, Frame::Grid>>,
409 : hydro::Tags::TildeDInHalfPlaneCompute<
410 : DataVector, volume_dim,
411 : ::hydro::HalfPlaneIntegralMask::NegativeXOnly,
412 : Events::Tags::ObserverCoordinates<3, Frame::Grid>>,
413 : hydro::Tags::MassWeightedCoordsCompute<
414 : DataVector, volume_dim,
415 : ::hydro::HalfPlaneIntegralMask::PositiveXOnly,
416 : Events::Tags::ObserverCoordinates<3, Frame::Grid>,
417 : Events::Tags::ObserverCoordinates<3, Frame::Inertial>,
418 : Frame::Inertial>,
419 : hydro::Tags::MassWeightedCoordsCompute<
420 : DataVector, volume_dim,
421 : ::hydro::HalfPlaneIntegralMask::NegativeXOnly,
422 : Events::Tags::ObserverCoordinates<3, Frame::Grid>,
423 : Events::Tags::ObserverCoordinates<3, Frame::Inertial>,
424 : Frame::Inertial>,
425 :
426 : hydro::Tags::MassWeightedInternalEnergyCompute<DataVector>,
427 : hydro::Tags::MassWeightedKineticEnergyCompute<DataVector>,
428 : hydro::Tags::TildeDUnboundUtCriterionCompute<DataVector, volume_dim,
429 : domain_frame>,
430 : hydro::Tags::LowerSpatialFourVelocityCompute,
431 : hydro::Tags::MassWeightedCoordsCompute<
432 : DataVector, volume_dim, ::hydro::HalfPlaneIntegralMask::None,
433 : Events::Tags::ObserverCoordinates<3, Frame::Grid>,
434 : Events::Tags::ObserverCoordinates<3, Frame::Inertial>,
435 : Frame::Inertial>,
436 : gr::Tags::SpacetimeNormalOneFormCompute<DataVector, volume_dim,
437 : domain_frame>,
438 : gr::Tags::SpacetimeNormalVectorCompute<DataVector, volume_dim,
439 : domain_frame>,
440 : gr::Tags::InverseSpacetimeMetricCompute<DataVector, volume_dim,
441 : domain_frame>,
442 : gr::Tags::Lapse<DataVector>,
443 : gr::Tags::Shift<DataVector, volume_dim, domain_frame>,
444 : gr::Tags::SpatialMetric<DataVector, volume_dim, domain_frame>,
445 : gr::Tags::DetSpatialMetric<DataVector>,
446 : gr::Tags::InverseSpatialMetric<DataVector, volume_dim>,
447 : gh::Tags::ExtrinsicCurvatureCompute<volume_dim, domain_frame>,
448 : gh::Tags::DerivSpatialMetricCompute<volume_dim, ::Frame::Inertial>,
449 : gr::Tags::SpatialChristoffelFirstKindCompute<DataVector, volume_dim,
450 : ::Frame::Inertial>,
451 : gr::Tags::SpatialChristoffelSecondKindCompute<DataVector, volume_dim,
452 : ::Frame::Inertial>,
453 : ::Tags::DerivTensorCompute<
454 : gr::Tags::SpatialChristoffelSecondKind<DataVector, volume_dim>,
455 : ::Events::Tags::ObserverInverseJacobian<
456 : volume_dim, Frame::ElementLogical, Frame::Inertial>,
457 : ::Events::Tags::ObserverMesh<volume_dim>>,
458 : gr::Tags::SpatialRicciCompute<DataVector, volume_dim,
459 : ::Frame::Inertial>,
460 : gr::Tags::SpatialRicciScalarCompute<DataVector, volume_dim,
461 : ::Frame::Inertial>,
462 :
463 : // Constraints
464 : gh::Tags::GaugeConstraintCompute<volume_dim, domain_frame>,
465 : gh::Tags::TwoIndexConstraintCompute<volume_dim, ::Frame::Inertial>,
466 : gh::Tags::ThreeIndexConstraintCompute<volume_dim, ::Frame::Inertial>,
467 : gh::Tags::FourIndexConstraintCompute<3, ::Frame::Inertial>,
468 : gh::Tags::FConstraintCompute<3, ::Frame::Inertial>,
469 :
470 : // L2 norms of constraints
471 : ::Tags::PointwiseL2NormCompute<
472 : gh::Tags::GaugeConstraint<DataVector, volume_dim, domain_frame>>,
473 : ::Tags::PointwiseL2NormCompute<
474 : gh::Tags::TwoIndexConstraint<DataVector, volume_dim>>,
475 : ::Tags::PointwiseL2NormCompute<
476 : gh::Tags::ThreeIndexConstraint<DataVector, volume_dim>>,
477 : ::Tags::PointwiseL2NormCompute<
478 : gh::Tags::FourIndexConstraint<DataVector, 3>>,
479 : gh::Tags::ConstraintEnergyCompute<3, ::Frame::Inertial>,
480 : ::Tags::PointwiseL2NormCompute<gh::Tags::FConstraint<DataVector, 3>>,
481 : ::Tags::PointwiseL2NormCompute<
482 : gh::Tags::GaugeH<DataVector, volume_dim>>,
483 : ::Tags::PointwiseL2NormCompute<
484 : gh::Tags::ConstraintEnergy<DataVector, volume_dim>>,
485 : ::Tags::PointwiseL2NormCompute<gh::Tags::Phi<DataVector, volume_dim>>,
486 : ::Tags::PointwiseL2NormCompute<
487 : ::Tags::deriv<gr::Tags::SpacetimeMetric<DataVector, volume_dim>,
488 : tmpl::size_t<volume_dim>, Frame::Inertial>>,
489 :
490 : // GW Tags
491 : grmhd::ValenciaDivClean::Tags::QuadrupoleMomentCompute<
492 : DataVector, volume_dim,
493 : ::Events::Tags::ObserverCoordinates<volume_dim, Frame::Inertial>>,
494 : grmhd::ValenciaDivClean::Tags::QuadrupoleMomentDerivativeCompute<
495 : DataVector, volume_dim,
496 : ::Events::Tags::ObserverCoordinates<volume_dim, Frame::Inertial>,
497 : hydro::Tags::SpatialVelocity<DataVector, volume_dim,
498 : Frame::Inertial>>,
499 : hydro::Tags::TransportVelocityCompute<DataVector, volume_dim,
500 : Frame::Inertial>,
501 : grmhd::ValenciaDivClean::Tags::QuadrupoleMomentDerivativeCompute<
502 : DataVector, volume_dim,
503 : ::Events::Tags::ObserverCoordinates<volume_dim, Frame::Inertial>,
504 : hydro::Tags::TransportVelocity<DataVector, volume_dim,
505 : Frame::Inertial>>,
506 : hydro::Tags::SpecificEntropyCompute<DataVector>,
507 : gh::Tags::TimeDerivLapseCompute<volume_dim, Frame::Inertial>,
508 : gh::Tags::TimeDerivShiftCompute<volume_dim, Frame::Inertial>,
509 : ::Tags::dt<gh::Tags::Phi<DataVector, volume_dim, Frame::Inertial>>,
510 : ::Tags::dt<gh::Tags::Pi<DataVector, volume_dim, Frame::Inertial>>,
511 : gh::Tags::SecondTimeDerivOfSpacetimeMetricCompute<volume_dim,
512 : Frame::Inertial>,
513 : ::Tags::DerivTensorCompute<
514 : gr::Tags::ExtrinsicCurvature<DataVector, 3>,
515 : ::Events::Tags::ObserverInverseJacobian<
516 : volume_dim, Frame::ElementLogical, Frame::Inertial>,
517 : ::Events::Tags::ObserverMesh<volume_dim>>,
518 : gr::Tags::WeylElectricCompute<DataVector, 3, Frame::Inertial>,
519 : gr::Tags::Psi4RealCompute<Frame::Inertial>,
520 : ::Events::Tags::ObserverMeshVelocity<3>>,
521 : tmpl::conditional_t<
522 : use_dg_subcell,
523 : tmpl::list<evolution::dg::subcell::Tags::TciStatusCompute<volume_dim>,
524 : evolution::dg::subcell::Tags::ObserverCoordinatesCompute<
525 : volume_dim, Frame::ElementLogical>,
526 : evolution::dg::subcell::Tags::ObserverCoordinatesCompute<
527 : volume_dim, Frame::Grid>,
528 : evolution::dg::subcell::Tags::ObserverCoordinatesCompute<
529 : volume_dim, Frame::Inertial>>,
530 : tmpl::list<::Events::Tags::ObserverCoordinatesCompute<
531 : volume_dim, Frame::ElementLogical>,
532 : ::Events::Tags::ObserverCoordinatesCompute<volume_dim,
533 : Frame::Grid>,
534 : ::Events::Tags::ObserverCoordinatesCompute<
535 : volume_dim, Frame::Inertial>>>>;
536 0 : using integrand_fields = tmpl::append<
537 : typename system::variables_tag::tags_list,
538 : tmpl::list<
539 : // Control system tags
540 : hydro::Tags::TildeDInHalfPlaneCompute<
541 : DataVector, volume_dim,
542 : ::hydro::HalfPlaneIntegralMask::PositiveXOnly,
543 : Events::Tags::ObserverCoordinates<3, Frame::Grid>>,
544 : hydro::Tags::TildeDInHalfPlaneCompute<
545 : DataVector, volume_dim,
546 : ::hydro::HalfPlaneIntegralMask::NegativeXOnly,
547 : Events::Tags::ObserverCoordinates<3, Frame::Grid>>,
548 : hydro::Tags::MassWeightedCoordsCompute<
549 : DataVector, volume_dim,
550 : ::hydro::HalfPlaneIntegralMask::PositiveXOnly,
551 : Events::Tags::ObserverCoordinates<3, Frame::Grid>,
552 : Events::Tags::ObserverCoordinates<3, Frame::Inertial>,
553 : Frame::Inertial>,
554 : hydro::Tags::MassWeightedCoordsCompute<
555 : DataVector, volume_dim,
556 : ::hydro::HalfPlaneIntegralMask::NegativeXOnly,
557 : Events::Tags::ObserverCoordinates<3, Frame::Grid>,
558 : Events::Tags::ObserverCoordinates<3, Frame::Inertial>,
559 : Frame::Inertial>,
560 :
561 : // General tags
562 : hydro::Tags::MassWeightedInternalEnergyCompute<DataVector>,
563 : hydro::Tags::MassWeightedKineticEnergyCompute<DataVector>,
564 : hydro::Tags::TildeDUnboundUtCriterionCompute<DataVector, volume_dim,
565 : domain_frame>,
566 : hydro::Tags::MassWeightedCoordsCompute<
567 : DataVector, volume_dim, ::hydro::HalfPlaneIntegralMask::None,
568 : Events::Tags::ObserverCoordinates<3, Frame::Grid>,
569 : Events::Tags::ObserverCoordinates<3, Frame::Inertial>,
570 : Frame::Inertial>>>;
571 :
572 0 : using non_tensor_compute_tags = tmpl::append<
573 : tmpl::conditional_t<
574 : use_dg_subcell,
575 : tmpl::list<
576 : evolution::dg::subcell::Tags::ObserverMeshCompute<volume_dim>,
577 : evolution::dg::subcell::Tags::ObserverInverseJacobianCompute<
578 : volume_dim, Frame::ElementLogical, Frame::Inertial>,
579 : evolution::dg::subcell::Tags::
580 : ObserverJacobianAndDetInvJacobianCompute<
581 : volume_dim, Frame::ElementLogical, Frame::Inertial>,
582 : evolution::dg::subcell::Tags::ObserverMeshVelocityCompute<
583 : volume_dim>>,
584 : tmpl::list<::Events::Tags::ObserverMeshCompute<volume_dim>,
585 : ::Events::Tags::ObserverInverseJacobianCompute<
586 : volume_dim, Frame::ElementLogical, Frame::Inertial>,
587 : ::Events::Tags::ObserverJacobianCompute<
588 : volume_dim, Frame::ElementLogical, Frame::Inertial>,
589 : ::Events::Tags::ObserverDetInvJacobianCompute<
590 : Frame::ElementLogical, Frame::Inertial>,
591 : ::Events::Tags::ObserverMeshVelocityCompute<3>>>,
592 : tmpl::list<analytic_compute, error_compute>,
593 : tmpl::list<::Tags::DerivCompute<
594 : typename system::variables_tag,
595 : ::Events::Tags::ObserverMesh<volume_dim>,
596 : ::Events::Tags::ObserverInverseJacobian<
597 : volume_dim, Frame::ElementLogical, Frame::Inertial>,
598 : typename system::gradient_variables>,
599 : gh::gauges::Tags::GaugeAndDerivativeCompute<
600 : volume_dim, ghmhd::GhValenciaDivClean::InitialData::
601 : analytic_solutions_and_data_list>>>;
602 :
603 0 : struct factory_creation
604 : : tt::ConformsTo<Options::protocols::FactoryCreation> {
605 : private:
606 0 : using boundary_conditions = grmhd::GhValenciaDivClean::BoundaryConditions::
607 : standard_boundary_conditions<system>;
608 :
609 : public:
610 0 : using factory_classes = tmpl::map<
611 : tmpl::pair<DenseTrigger,
612 : tmpl::append<DenseTriggers::standard_dense_triggers,
613 : control_system::control_system_triggers<
614 : control_systems>>>,
615 : tmpl::pair<DomainCreator<volume_dim>,
616 : // Currently control systems can only be used with BCO
617 : // domains
618 : tmpl::conditional_t<
619 : use_control_systems,
620 : tmpl::list<::domain::creators::BinaryCompactObject>,
621 : domain_creators<volume_dim>>>,
622 : tmpl::pair<Event,
623 : tmpl::flatten<tmpl::list<
624 : Events::Completion, ::Events::ObserveDataBox,
625 : dg::Events::field_observations<
626 : volume_dim, observe_fields, non_tensor_compute_tags>,
627 : Events::ObserveAtExtremum<observe_fields,
628 : non_tensor_compute_tags>,
629 : Events::time_events<system>,
630 : dg::Events::ObserveTimeStepVolume<system>,
631 : control_system::metafunctions::control_system_events<
632 : control_systems>,
633 : tmpl::conditional_t<use_control_systems,
634 : control_system::CleanFunctionsOfTime,
635 : tmpl::list<>>,
636 : intrp::Events::InterpolateWithoutInterpComponent<
637 : volume_dim, InterpolationTargetTags,
638 : interpolator_source_vars>...,
639 : dg::Events::ChangeFixedLtsRatio<volume_dim>>>>,
640 : tmpl::pair<evolution::BoundaryCorrection,
641 : grmhd::GhValenciaDivClean::BoundaryCorrections::
642 : standard_boundary_corrections>,
643 : tmpl::pair<
644 : grmhd::GhValenciaDivClean::BoundaryConditions::BoundaryCondition,
645 : boundary_conditions>,
646 : tmpl::pair<
647 : grmhd::AnalyticData::InitialMagneticFields::InitialMagneticField,
648 : grmhd::AnalyticData::InitialMagneticFields::
649 : initial_magnetic_fields>,
650 : tmpl::pair<gh::gauges::GaugeCondition, gh::gauges::all_gauges>,
651 : tmpl::pair<MathFunction<1, Frame::Inertial>,
652 : MathFunctions::all_math_functions<1, Frame::Inertial>>,
653 : tmpl::pair<evolution::initial_data::InitialData, initial_data_list>,
654 : // Restrict to monotonic time steppers in LTS to avoid control
655 : // systems deadlocking.
656 : tmpl::pair<
657 : LtsTimeStepper,
658 : tmpl::conditional_t<use_control_systems,
659 : TimeSteppers::monotonic_lts_time_steppers,
660 : TimeSteppers::lts_time_steppers>>,
661 : tmpl::pair<PhaseChange, PhaseControl::factory_creatable_classes>,
662 : tmpl::pair<StepChooser<StepChooserUse::LtsStep>,
663 : StepChoosers::standard_step_choosers<system>>,
664 : tmpl::pair<StepChooser<StepChooserUse::Slab>,
665 : tmpl::push_back<
666 : StepChoosers::standard_slab_choosers<system>,
667 : evolution::dg::StepChoosers::FixedLtsRatio<volume_dim>>>,
668 : tmpl::pair<TimeSequence<double>,
669 : TimeSequences::all_time_sequences<double>>,
670 : tmpl::pair<TimeSequence<std::uint64_t>,
671 : TimeSequences::all_time_sequences<std::uint64_t>>,
672 : tmpl::pair<TimeStepper, TimeSteppers::time_steppers>,
673 : tmpl::pair<
674 : Trigger,
675 : tmpl::append<Triggers::logical_triggers, Triggers::time_triggers,
676 : tmpl::conditional_t<
677 : UseControlSystems,
678 : tmpl::list<Triggers::SeparationLessThan<true>>,
679 : tmpl::list<>>>>,
680 : tmpl::pair<
681 : Filters::Filter<volume_dim,
682 : typename system::variables_tag::tags_list>,
683 : tmpl::push_back<
684 : Filters::all_filters<volume_dim,
685 : typename system::variables_tag::tags_list>,
686 : Filters::SphericalShell<
687 : typename system::variables_tag::tags_list>>>>;
688 : };
689 :
690 0 : using interpolation_target_tags = tmpl::list<InterpolationTargetTags...>;
691 :
692 0 : using observed_reduction_data_tags = observers::collect_reduction_data_tags<
693 : tmpl::at<typename factory_creation::factory_classes, Event>>;
694 :
695 0 : using const_global_cache_tags = tmpl::flatten<tmpl::list<
696 : tmpl::conditional_t<
697 : use_dg_subcell,
698 : tmpl::list<
699 : grmhd::GhValenciaDivClean::fd::Tags::Reconstructor<system>,
700 : grmhd::GhValenciaDivClean::fd::Tags::FilterOptions,
701 : ::Tags::VariableFixer<grmhd::ValenciaDivClean::FixConservatives>,
702 : grmhd::ValenciaDivClean::subcell::Tags::TciOptions>,
703 : tmpl::list<>>,
704 : grmhd::ValenciaDivClean::Tags::PrimitiveFromConservativeOptions,
705 : gh::gauges::Tags::GaugeCondition, initial_data_tag,
706 : grmhd::ValenciaDivClean::Tags::ConstraintDampingParameter,
707 : equation_of_state_tag,
708 : gh::Tags::DampingFunctionGamma0<volume_dim, Frame::Grid>,
709 : gh::Tags::DampingFunctionGamma1<volume_dim, Frame::Grid>,
710 : gh::Tags::DampingFunctionGamma2<volume_dim, Frame::Grid>>>;
711 :
712 0 : using dg_registration_list =
713 : tmpl::list<observers::Actions::RegisterEventsWithObservers>;
714 :
715 0 : static constexpr auto default_phase_order = std::array<Parallel::Phase, 8>{
716 : {Parallel::Phase::Initialization,
717 : Parallel::Phase::RegisterWithElementDataReader,
718 : Parallel::Phase::Register, Parallel::Phase::ImportInitialData,
719 : Parallel::Phase::InitializeInitialDataDependentQuantities,
720 : Parallel::Phase::InitializeTimeStepperHistory, Parallel::Phase::Evolve,
721 : Parallel::Phase::Exit}};
722 :
723 0 : struct SubcellOptions {
724 0 : using evolved_vars_tags = typename system::variables_tag::tags_list;
725 0 : using prim_tags = typename system::primitive_variables_tag::tags_list;
726 :
727 0 : static constexpr bool subcell_enabled = use_dg_subcell;
728 0 : static constexpr bool subcell_enabled_at_external_boundary = true;
729 :
730 : // We send `ghost_zone_size` cell-centered grid points for variable
731 : // reconstruction, of which we need `ghost_zone_size-1` for reconstruction
732 : // to the internal side of the element face, and `ghost_zone_size` for
733 : // reconstruction to the external side of the element face.
734 : template <typename DbTagsList>
735 0 : static constexpr size_t ghost_zone_size(
736 : const db::DataBox<DbTagsList>& box) {
737 : return db::get<
738 : grmhd::GhValenciaDivClean::fd::Tags::Reconstructor<system>>(
739 : box)
740 : .ghost_zone_size();
741 : }
742 :
743 0 : using DgComputeSubcellNeighborPackagedData =
744 : grmhd::GhValenciaDivClean::subcell::NeighborPackagedData<system>;
745 :
746 0 : using GhostVariables =
747 : grmhd::GhValenciaDivClean::subcell::PrimitiveGhostVariables;
748 : };
749 :
750 0 : using events_and_dense_triggers_dg_postprocessors = tmpl::list<
751 : ::domain::CheckFunctionsOfTimeAreReadyPostprocessor<volume_dim>,
752 : evolution::dg::ApplyLtsDenseBoundaryCorrections<derived_metavars>,
753 : AlwaysReadyPostprocessor<
754 : typename system::template primitive_from_conservative<
755 : ordered_list_of_primitive_recovery_schemes>>>;
756 :
757 0 : using events_and_dense_triggers_subcell_postprocessors = tmpl::list<
758 : ::domain::CheckFunctionsOfTimeAreReadyPostprocessor<volume_dim>,
759 : AlwaysReadyPostprocessor<
760 : grmhd::GhValenciaDivClean::subcell::FixConservativesAndComputePrims<
761 : ordered_list_of_primitive_recovery_schemes, system>>>;
762 :
763 0 : using equal_rate_regions = tmpl::flatten<
764 : tmpl::list<evolution::dg::NonconformingEqualRateRegions<volume_dim>,
765 : tmpl::conditional_t<
766 : use_dg_subcell,
767 : evolution::dg::subcell::SubcellEqualRateRegion<volume_dim>,
768 : tmpl::list<>>>>;
769 :
770 0 : using dg_step_actions = tmpl::flatten<tmpl::list<
771 : dg::Actions::SpectralFilter,
772 : evolution::dg::Actions::ComputeTimeDerivative<
773 : volume_dim, system, AllStepChoosers, local_time_stepping,
774 : use_dg_element_collection>,
775 : evolution::dg::Actions::ApplyBoundaryCorrectionsToTimeDerivative<
776 : volume_dim, use_dg_element_collection>,
777 : tmpl::conditional_t<
778 : UseControlSystems,
779 : Actions::MutateApply<grmhd::GhValenciaDivClean::subcell::
780 : ZeroMhdTimeDerivatives<system>>,
781 : tmpl::list<>>,
782 : Actions::MutateApply<RecordTimeStepperData<system>>,
783 : evolution::Actions::RunEventsAndDenseTriggers<
784 : events_and_dense_triggers_dg_postprocessors>,
785 : control_system::Actions::LimitTimeStep<control_systems>,
786 : Actions::MutateApply<UpdateU<system, local_time_stepping>>,
787 : evolution::dg::Actions::ApplyLtsBoundaryCorrections<
788 : volume_dim, use_dg_element_collection>,
789 : tmpl::conditional_t<
790 : local_time_stepping,
791 : tmpl::list<Actions::MutateApply<ChangeTimeStepperOrder<system>>>,
792 : tmpl::list<>>,
793 : tmpl::conditional_t<
794 : use_dg_subcell,
795 : // Note: The primitive variables are computed as part of the TCI.
796 : evolution::dg::subcell::Actions::TciAndRollback<
797 : grmhd::GhValenciaDivClean::subcell::TciOnDgGrid<
798 : tmpl::front<ordered_list_of_primitive_recovery_schemes>>>,
799 : tmpl::list<>>,
800 : Actions::MutateApply<CleanHistory<system>>,
801 : Actions::MutateApply<evolution::dg::CleanMortarHistory<volume_dim>>,
802 : tmpl::conditional_t<
803 : use_dg_subcell,
804 : tmpl::list<parameterized_deleptonization,
805 : VariableFixing::Actions::FixVariables<
806 : VariableFixing::FixToAtmosphere<volume_dim>>,
807 : VariableFixing::Actions::FixVariables<
808 : VariableFixing::LimitLorentzFactor>,
809 : Actions::UpdateConservatives>,
810 : tmpl::list<parameterized_deleptonization,
811 : VariableFixing::Actions::FixVariables<
812 : grmhd::ValenciaDivClean::FixConservatives>,
813 : Actions::UpdatePrimitives>>>>;
814 :
815 0 : using dg_subcell_step_actions = tmpl::flatten<tmpl::list<
816 : evolution::dg::subcell::Actions::SelectNumericalMethod,
817 :
818 : Actions::Label<evolution::dg::subcell::Actions::Labels::BeginDg>,
819 : dg_step_actions,
820 : Actions::Goto<evolution::dg::subcell::Actions::Labels::EndOfSolvers>,
821 :
822 : Actions::Label<evolution::dg::subcell::Actions::Labels::BeginSubcell>,
823 : tmpl::conditional_t<local_time_stepping,
824 : // This is just to adjust for FixedLtsRatio, so we
825 : // can pass an empty list of StepChoosers.
826 : Actions::MutateApply<ChangeStepSize<tmpl::list<>>>,
827 : tmpl::list<>>,
828 : Actions::MutateApply<evolution::dg::subcell::fd::CellCenteredFlux<
829 : system, grmhd::ValenciaDivClean::ComputeFluxes, volume_dim, false>>,
830 : evolution::dg::subcell::Actions::SendDataForReconstruction<
831 : volume_dim,
832 : grmhd::GhValenciaDivClean::subcell::PrimitiveGhostVariables,
833 : use_dg_element_collection>,
834 : evolution::dg::subcell::Actions::ReceiveDataForReconstruction<volume_dim>,
835 : Actions::Label<
836 : evolution::dg::subcell::Actions::Labels::BeginSubcellAfterDgRollback>,
837 : Actions::MutateApply<
838 : grmhd::GhValenciaDivClean::subcell::PrimsAfterRollback<
839 : ordered_list_of_primitive_recovery_schemes>>,
840 : Actions::MutateApply<evolution::dg::subcell::fd::CellCenteredFlux<
841 : system, grmhd::ValenciaDivClean::ComputeFluxes, volume_dim, true>>,
842 : evolution::dg::subcell::fd::Actions::TakeTimeStep<
843 : grmhd::GhValenciaDivClean::subcell::TimeDerivative<system>>,
844 : Actions::MutateApply<RecordTimeStepperData<system>>,
845 : evolution::Actions::RunEventsAndDenseTriggers<
846 : events_and_dense_triggers_subcell_postprocessors>,
847 : control_system::Actions::LimitTimeStep<control_systems>,
848 : Actions::MutateApply<UpdateU<system, local_time_stepping>>,
849 : Actions::MutateApply<CleanHistory<system>>,
850 : Actions::MutateApply<evolution::dg::CleanMortarHistory<volume_dim>>,
851 : Actions::MutateApply<
852 : grmhd::GhValenciaDivClean::subcell::FixConservativesAndComputePrims<
853 : ordered_list_of_primitive_recovery_schemes, system>>,
854 : evolution::dg::subcell::Actions::TciAndSwitchToDg<
855 : grmhd::GhValenciaDivClean::subcell::TciOnFdGrid>,
856 : Actions::MutateApply<
857 : grmhd::GhValenciaDivClean::subcell::ResizeAndComputePrims<
858 : ordered_list_of_primitive_recovery_schemes>>,
859 : parameterized_deleptonization,
860 : VariableFixing::Actions::FixVariables<
861 : VariableFixing::FixToAtmosphere<volume_dim>>,
862 : VariableFixing::Actions::FixVariables<VariableFixing::LimitLorentzFactor>,
863 : Actions::UpdateConservatives,
864 :
865 : Actions::Label<evolution::dg::subcell::Actions::Labels::EndOfSolvers>>>;
866 :
867 0 : using step_actions =
868 : tmpl::conditional_t<use_dg_subcell, dg_subcell_step_actions,
869 : dg_step_actions>;
870 :
871 0 : using initialization_actions = tmpl::list<
872 : Initialization::Actions::InitializeItems<
873 : Initialization::TimeStepping<derived_metavars, TimeStepperBase,
874 : use_control_systems,
875 : local_time_stepping>,
876 : evolution::dg::Initialization::Domain<derived_metavars,
877 : use_control_systems>,
878 : Initialization::TimeStepperHistory<derived_metavars>>,
879 : Initialization::Actions::ConservativeSystem<system>,
880 : // This conditional is untested and probably doesn't work if
881 : // `use_dg_subcell` is `false`
882 : tmpl::conditional_t<
883 : use_dg_subcell,
884 : tmpl::list<
885 : evolution::dg::subcell::Actions::SetSubcellGrid<volume_dim,
886 : system, true>,
887 : Actions::MutateApply<evolution::dg::subcell::SetInterpolators<
888 : volume_dim,
889 : grmhd::GhValenciaDivClean::fd::Tags::Reconstructor<system>>>>,
890 : evolution::Initialization::Actions::SetVariables<
891 : ::domain::Tags::Coordinates<volume_dim, Frame::ElementLogical>>>,
892 : Initialization::Actions::AddComputeTags<
893 : StepChoosers::step_chooser_compute_tags<
894 : GhValenciaDivCleanTemplateBase>>,
895 : ::evolution::dg::Initialization::Mortars<volume_dim>,
896 : evolution::dg::Initialization::Actions::SetupEqualRateRegions<
897 : derived_metavars, volume_dim, equal_rate_regions>,
898 : evolution::Actions::InitializeRunEventsAndDenseTriggers,
899 : intrp::Actions::ElementInitInterpPoints<volume_dim,
900 : interpolation_target_tags>,
901 : tmpl::conditional_t<
902 : use_control_systems,
903 : control_system::Actions::InitializeMeasurements<control_systems>,
904 : tmpl::list<>>,
905 : Initialization::Actions::InitializeItems<
906 : evolution::dg::Initialization::SpectralFilters<
907 : volume_dim, typename system::variables_tag::tags_list>>,
908 : Parallel::Actions::TerminatePhase>;
909 :
910 0 : using import_initial_data_action_lists = tmpl::list<
911 : Parallel::PhaseActions<
912 : Parallel::Phase::RegisterWithElementDataReader,
913 : tmpl::list<importers::Actions::RegisterWithElementDataReader,
914 : Parallel::Actions::TerminatePhase>>,
915 : Parallel::PhaseActions<
916 : Parallel::Phase::ImportInitialData,
917 : tmpl::list<
918 : grmhd::GhValenciaDivClean::Actions::SetInitialData,
919 : grmhd::GhValenciaDivClean::Actions::ReceiveNumericInitialData,
920 : Parallel::Actions::TerminatePhase>>>;
921 :
922 0 : using dg_element_array_component = DgElementArray<
923 : derived_metavars,
924 : tmpl::flatten<tmpl::list<
925 : Parallel::PhaseActions<Parallel::Phase::Initialization,
926 : initialization_actions>,
927 : import_initial_data_action_lists,
928 : Parallel::PhaseActions<
929 : Parallel::Phase::InitializeInitialDataDependentQuantities,
930 : initialize_initial_data_dependent_quantities_actions>,
931 : Parallel::PhaseActions<
932 : Parallel::Phase::InitializeTimeStepperHistory,
933 : SelfStart::self_start_procedure<step_actions, system>>,
934 : Parallel::PhaseActions<Parallel::Phase::Register,
935 : tmpl::list<dg_registration_list,
936 : Parallel::Actions::TerminatePhase>>,
937 : Parallel::PhaseActions<Parallel::Phase::Restart,
938 : tmpl::list<dg_registration_list,
939 : Parallel::Actions::TerminatePhase>>,
940 : Parallel::PhaseActions<
941 : Parallel::Phase::WriteCheckpoint,
942 : tmpl::list<evolution::Actions::RunEventsAndTriggers<
943 : Triggers::WhenToCheck::AtCheckpoints>,
944 : Parallel::Actions::TerminatePhase>>,
945 : Parallel::PhaseActions<
946 : Parallel::Phase::Evolve,
947 : tmpl::flatten<tmpl::list<
948 : ::domain::Actions::CheckFunctionsOfTimeAreReady<volume_dim>,
949 : parameterized_deleptonization,
950 : VariableFixing::Actions::FixVariables<
951 : VariableFixing::FixToAtmosphere<volume_dim>>,
952 : VariableFixing::Actions::FixVariables<
953 : VariableFixing::LimitLorentzFactor>,
954 : Actions::UpdateConservatives,
955 : std::conditional_t<local_time_stepping,
956 : evolution::Actions::RunEventsAndTriggers<
957 : Triggers::WhenToCheck::AtSteps>,
958 : tmpl::list<>>,
959 : evolution::Actions::RunEventsAndTriggers<
960 : Triggers::WhenToCheck::AtSlabs>,
961 : Actions::ChangeSlabSize,
962 : evolution::dg::Actions::ChangeFixedLtsRatio, step_actions,
963 : Actions::MutateApply<AdvanceTime<>>,
964 : PhaseControl::Actions::ExecutePhaseChange>>>,
965 :
966 : tmpl::conditional_t<
967 : UseControlSystems,
968 : Parallel::PhaseActions<
969 : Parallel::Phase::DisableRotationControl,
970 : tmpl::list<
971 : control_system::Actions::SwitchGridRotationToSettle,
972 : Parallel::Actions::TerminatePhase>>,
973 : tmpl::list<>>,
974 :
975 : Parallel::PhaseActions<
976 : Parallel::Phase::PostFailureCleanup,
977 : tmpl::list<Actions::RunEventsOnFailure<Tags::Time>,
978 : Parallel::Actions::TerminatePhase>>>>>;
979 :
980 0 : struct registration
981 : : tt::ConformsTo<Parallel::protocols::RegistrationMetavariables> {
982 0 : using element_registrars =
983 : tmpl::map<tmpl::pair<dg_element_array_component, dg_registration_list>>;
984 : };
985 :
986 0 : using component_list = tmpl::flatten<tmpl::list<
987 : observers::Observer<derived_metavars>,
988 : observers::ObserverWriter<derived_metavars>,
989 : importers::ElementDataReader<derived_metavars>,
990 : control_system::control_components<derived_metavars, control_systems>,
991 : intrp::InterpolationTarget<derived_metavars, InterpolationTargetTags>...,
992 : dg_element_array_component>>;
993 : };
994 :
995 0 : struct BondiSachs : tt::ConformsTo<intrp::protocols::InterpolationTargetTag> {
996 0 : static std::string name() { return "BondiSachsInterpolation"; }
997 0 : using temporal_id = ::Tags::Time;
998 0 : using vars_to_interpolate_to_target =
999 : typename gh::System<3>::variables_tag::tags_list;
1000 0 : using compute_target_points =
1001 : intrp::TargetPoints::Sphere<BondiSachs, ::Frame::Inertial>;
1002 0 : using post_interpolation_callbacks =
1003 : tmpl::list<intrp::callbacks::DumpBondiSachsOnWorldtube<BondiSachs>>;
1004 0 : using compute_items_on_target = tmpl::list<>;
1005 : template <typename Metavariables>
1006 0 : using interpolating_component =
1007 : typename Metavariables::dg_element_array_component;
1008 : };
|