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<
623 : Event,
624 : tmpl::flatten<tmpl::list<
625 : Events::Completion, ::Events::ObserveDataBox,
626 : dg::Events::field_observations<volume_dim, observe_fields,
627 : non_tensor_compute_tags>,
628 : Events::ObserveAtExtremum<observe_fields,
629 : non_tensor_compute_tags>,
630 : Events::time_events<system>,
631 : dg::Events::ObserveTimeStepVolume<system>,
632 : control_system::metafunctions::control_system_events<
633 : control_systems>,
634 : tmpl::conditional_t<use_control_systems,
635 : control_system::CleanFunctionsOfTime,
636 : tmpl::list<>>,
637 : intrp::Events::InterpolateWithoutInterpComponent<
638 : volume_dim, InterpolationTargetTags,
639 : interpolator_source_vars>...,
640 : tmpl::conditional_t<local_time_stepping,
641 : dg::Events::ChangeFixedLtsRatio<volume_dim>,
642 : tmpl::list<>>>>>,
643 : tmpl::pair<evolution::BoundaryCorrection,
644 : grmhd::GhValenciaDivClean::BoundaryCorrections::
645 : standard_boundary_corrections>,
646 : tmpl::pair<
647 : grmhd::GhValenciaDivClean::BoundaryConditions::BoundaryCondition,
648 : boundary_conditions>,
649 : tmpl::pair<
650 : grmhd::AnalyticData::InitialMagneticFields::InitialMagneticField,
651 : grmhd::AnalyticData::InitialMagneticFields::
652 : initial_magnetic_fields>,
653 : tmpl::pair<gh::gauges::GaugeCondition, gh::gauges::all_gauges>,
654 : tmpl::pair<MathFunction<1, Frame::Inertial>,
655 : MathFunctions::all_math_functions<1, Frame::Inertial>>,
656 : tmpl::pair<evolution::initial_data::InitialData, initial_data_list>,
657 : // Restrict to monotonic time steppers in LTS to avoid control
658 : // systems deadlocking.
659 : tmpl::pair<
660 : LtsTimeStepper,
661 : tmpl::conditional_t<use_control_systems,
662 : TimeSteppers::monotonic_lts_time_steppers,
663 : TimeSteppers::lts_time_steppers>>,
664 : tmpl::pair<PhaseChange, PhaseControl::factory_creatable_classes>,
665 : tmpl::pair<StepChooser<StepChooserUse::LtsStep>,
666 : StepChoosers::standard_step_choosers<system>>,
667 : tmpl::pair<StepChooser<StepChooserUse::Slab>,
668 : tmpl::append<StepChoosers::standard_slab_choosers<system>,
669 : tmpl::conditional_t<
670 : local_time_stepping,
671 : tmpl::list<evolution::dg::StepChoosers::
672 : FixedLtsRatio<volume_dim>>,
673 : tmpl::list<>>>>,
674 : tmpl::pair<TimeSequence<double>,
675 : TimeSequences::all_time_sequences<double>>,
676 : tmpl::pair<TimeSequence<std::uint64_t>,
677 : TimeSequences::all_time_sequences<std::uint64_t>>,
678 : tmpl::pair<TimeStepper, TimeSteppers::time_steppers>,
679 : tmpl::pair<
680 : Trigger,
681 : tmpl::append<Triggers::logical_triggers, Triggers::time_triggers,
682 : tmpl::conditional_t<
683 : UseControlSystems,
684 : tmpl::list<Triggers::SeparationLessThan<true>>,
685 : tmpl::list<>>>>,
686 : tmpl::pair<
687 : Filters::Filter<volume_dim,
688 : typename system::variables_tag::tags_list>,
689 : tmpl::push_back<
690 : Filters::all_filters<volume_dim,
691 : typename system::variables_tag::tags_list>,
692 : Filters::SphericalShell<
693 : typename system::variables_tag::tags_list>>>>;
694 : };
695 :
696 0 : using interpolation_target_tags = tmpl::list<InterpolationTargetTags...>;
697 :
698 0 : using observed_reduction_data_tags = observers::collect_reduction_data_tags<
699 : tmpl::at<typename factory_creation::factory_classes, Event>>;
700 :
701 0 : using const_global_cache_tags = tmpl::flatten<tmpl::list<
702 : tmpl::conditional_t<
703 : use_dg_subcell,
704 : tmpl::list<
705 : grmhd::GhValenciaDivClean::fd::Tags::Reconstructor<system>,
706 : grmhd::GhValenciaDivClean::fd::Tags::FilterOptions,
707 : ::Tags::VariableFixer<grmhd::ValenciaDivClean::FixConservatives>,
708 : grmhd::ValenciaDivClean::subcell::Tags::TciOptions>,
709 : tmpl::list<>>,
710 : grmhd::ValenciaDivClean::Tags::PrimitiveFromConservativeOptions,
711 : gh::gauges::Tags::GaugeCondition, initial_data_tag,
712 : grmhd::ValenciaDivClean::Tags::ConstraintDampingParameter,
713 : equation_of_state_tag,
714 : gh::Tags::DampingFunctionGamma0<volume_dim, Frame::Grid>,
715 : gh::Tags::DampingFunctionGamma1<volume_dim, Frame::Grid>,
716 : gh::Tags::DampingFunctionGamma2<volume_dim, Frame::Grid>>>;
717 :
718 0 : using dg_registration_list =
719 : tmpl::list<observers::Actions::RegisterEventsWithObservers>;
720 :
721 0 : static constexpr auto default_phase_order = std::array<Parallel::Phase, 8>{
722 : {Parallel::Phase::Initialization,
723 : Parallel::Phase::RegisterWithElementDataReader,
724 : Parallel::Phase::Register, Parallel::Phase::ImportInitialData,
725 : Parallel::Phase::InitializeInitialDataDependentQuantities,
726 : Parallel::Phase::InitializeTimeStepperHistory, Parallel::Phase::Evolve,
727 : Parallel::Phase::Exit}};
728 :
729 0 : struct SubcellOptions {
730 0 : using evolved_vars_tags = typename system::variables_tag::tags_list;
731 0 : using prim_tags = typename system::primitive_variables_tag::tags_list;
732 :
733 0 : static constexpr bool subcell_enabled = use_dg_subcell;
734 0 : static constexpr bool subcell_enabled_at_external_boundary = true;
735 :
736 : // We send `ghost_zone_size` cell-centered grid points for variable
737 : // reconstruction, of which we need `ghost_zone_size-1` for reconstruction
738 : // to the internal side of the element face, and `ghost_zone_size` for
739 : // reconstruction to the external side of the element face.
740 : template <typename DbTagsList>
741 0 : static constexpr size_t ghost_zone_size(
742 : const db::DataBox<DbTagsList>& box) {
743 : return db::get<
744 : grmhd::GhValenciaDivClean::fd::Tags::Reconstructor<system>>(
745 : box)
746 : .ghost_zone_size();
747 : }
748 :
749 0 : using DgComputeSubcellNeighborPackagedData =
750 : grmhd::GhValenciaDivClean::subcell::NeighborPackagedData<system>;
751 :
752 0 : using GhostVariables =
753 : grmhd::GhValenciaDivClean::subcell::PrimitiveGhostVariables;
754 : };
755 :
756 0 : using events_and_dense_triggers_dg_postprocessors = tmpl::list<
757 : ::domain::CheckFunctionsOfTimeAreReadyPostprocessor<volume_dim>,
758 : evolution::dg::ApplyLtsDenseBoundaryCorrections<derived_metavars>,
759 : AlwaysReadyPostprocessor<
760 : typename system::template primitive_from_conservative<
761 : ordered_list_of_primitive_recovery_schemes>>>;
762 :
763 0 : using events_and_dense_triggers_subcell_postprocessors = tmpl::list<
764 : ::domain::CheckFunctionsOfTimeAreReadyPostprocessor<volume_dim>,
765 : AlwaysReadyPostprocessor<
766 : grmhd::GhValenciaDivClean::subcell::FixConservativesAndComputePrims<
767 : ordered_list_of_primitive_recovery_schemes, system>>>;
768 :
769 0 : using equal_rate_regions = tmpl::flatten<
770 : tmpl::list<evolution::dg::NonconformingEqualRateRegions<volume_dim>,
771 : tmpl::conditional_t<
772 : use_dg_subcell,
773 : evolution::dg::subcell::SubcellEqualRateRegion<volume_dim>,
774 : tmpl::list<>>>>;
775 :
776 0 : using dg_step_actions = tmpl::flatten<tmpl::list<
777 : dg::Actions::SpectralFilter,
778 : evolution::dg::Actions::ComputeTimeDerivative<
779 : volume_dim, system, AllStepChoosers, local_time_stepping,
780 : use_dg_element_collection>,
781 : evolution::dg::Actions::ApplyBoundaryCorrectionsToTimeDerivative<
782 : volume_dim, use_dg_element_collection>,
783 : tmpl::conditional_t<
784 : UseControlSystems,
785 : Actions::MutateApply<grmhd::GhValenciaDivClean::subcell::
786 : ZeroMhdTimeDerivatives<system>>,
787 : tmpl::list<>>,
788 : Actions::MutateApply<RecordTimeStepperData<system>>,
789 : evolution::Actions::RunEventsAndDenseTriggers<
790 : events_and_dense_triggers_dg_postprocessors>,
791 : control_system::Actions::LimitTimeStep<control_systems>,
792 : Actions::MutateApply<UpdateU<system, local_time_stepping>>,
793 : evolution::dg::Actions::ApplyLtsBoundaryCorrections<
794 : volume_dim, use_dg_element_collection>,
795 : tmpl::conditional_t<
796 : local_time_stepping,
797 : tmpl::list<Actions::MutateApply<ChangeTimeStepperOrder<system>>>,
798 : tmpl::list<>>,
799 : tmpl::conditional_t<
800 : use_dg_subcell,
801 : // Note: The primitive variables are computed as part of the TCI.
802 : evolution::dg::subcell::Actions::TciAndRollback<
803 : grmhd::GhValenciaDivClean::subcell::TciOnDgGrid<
804 : tmpl::front<ordered_list_of_primitive_recovery_schemes>>>,
805 : tmpl::list<>>,
806 : Actions::MutateApply<CleanHistory<system>>,
807 : Actions::MutateApply<evolution::dg::CleanMortarHistory<volume_dim>>,
808 : tmpl::conditional_t<
809 : use_dg_subcell,
810 : tmpl::list<parameterized_deleptonization,
811 : VariableFixing::Actions::FixVariables<
812 : VariableFixing::FixToAtmosphere<volume_dim>>,
813 : VariableFixing::Actions::FixVariables<
814 : VariableFixing::LimitLorentzFactor>,
815 : Actions::UpdateConservatives>,
816 : tmpl::list<parameterized_deleptonization,
817 : VariableFixing::Actions::FixVariables<
818 : grmhd::ValenciaDivClean::FixConservatives>,
819 : Actions::UpdatePrimitives>>>>;
820 :
821 0 : using dg_subcell_step_actions = tmpl::flatten<tmpl::list<
822 : evolution::dg::subcell::Actions::SelectNumericalMethod,
823 :
824 : Actions::Label<evolution::dg::subcell::Actions::Labels::BeginDg>,
825 : dg_step_actions,
826 : Actions::Goto<evolution::dg::subcell::Actions::Labels::EndOfSolvers>,
827 :
828 : Actions::Label<evolution::dg::subcell::Actions::Labels::BeginSubcell>,
829 : tmpl::conditional_t<local_time_stepping,
830 : // This is just to adjust for FixedLtsRatio, so we
831 : // can pass an empty list of StepChoosers.
832 : Actions::MutateApply<ChangeStepSize<tmpl::list<>>>,
833 : tmpl::list<>>,
834 : Actions::MutateApply<evolution::dg::subcell::fd::CellCenteredFlux<
835 : system, grmhd::ValenciaDivClean::ComputeFluxes, volume_dim, false>>,
836 : evolution::dg::subcell::Actions::SendDataForReconstruction<
837 : volume_dim,
838 : grmhd::GhValenciaDivClean::subcell::PrimitiveGhostVariables,
839 : use_dg_element_collection>,
840 : evolution::dg::subcell::Actions::ReceiveDataForReconstruction<volume_dim>,
841 : Actions::Label<
842 : evolution::dg::subcell::Actions::Labels::BeginSubcellAfterDgRollback>,
843 : Actions::MutateApply<
844 : grmhd::GhValenciaDivClean::subcell::PrimsAfterRollback<
845 : ordered_list_of_primitive_recovery_schemes>>,
846 : Actions::MutateApply<evolution::dg::subcell::fd::CellCenteredFlux<
847 : system, grmhd::ValenciaDivClean::ComputeFluxes, volume_dim, true>>,
848 : evolution::dg::subcell::fd::Actions::TakeTimeStep<
849 : grmhd::GhValenciaDivClean::subcell::TimeDerivative<system>>,
850 : Actions::MutateApply<RecordTimeStepperData<system>>,
851 : evolution::Actions::RunEventsAndDenseTriggers<
852 : events_and_dense_triggers_subcell_postprocessors>,
853 : control_system::Actions::LimitTimeStep<control_systems>,
854 : Actions::MutateApply<UpdateU<system, local_time_stepping>>,
855 : Actions::MutateApply<CleanHistory<system>>,
856 : Actions::MutateApply<evolution::dg::CleanMortarHistory<volume_dim>>,
857 : Actions::MutateApply<
858 : grmhd::GhValenciaDivClean::subcell::FixConservativesAndComputePrims<
859 : ordered_list_of_primitive_recovery_schemes, system>>,
860 : evolution::dg::subcell::Actions::TciAndSwitchToDg<
861 : grmhd::GhValenciaDivClean::subcell::TciOnFdGrid>,
862 : Actions::MutateApply<
863 : grmhd::GhValenciaDivClean::subcell::ResizeAndComputePrims<
864 : ordered_list_of_primitive_recovery_schemes>>,
865 : parameterized_deleptonization,
866 : VariableFixing::Actions::FixVariables<
867 : VariableFixing::FixToAtmosphere<volume_dim>>,
868 : VariableFixing::Actions::FixVariables<VariableFixing::LimitLorentzFactor>,
869 : Actions::UpdateConservatives,
870 :
871 : Actions::Label<evolution::dg::subcell::Actions::Labels::EndOfSolvers>>>;
872 :
873 0 : using step_actions =
874 : tmpl::conditional_t<use_dg_subcell, dg_subcell_step_actions,
875 : dg_step_actions>;
876 :
877 0 : using initialization_actions = tmpl::list<
878 : Initialization::Actions::InitializeItems<
879 : Initialization::TimeStepping<derived_metavars, TimeStepperBase,
880 : use_control_systems>,
881 : evolution::dg::Initialization::Domain<derived_metavars,
882 : use_control_systems>,
883 : Initialization::TimeStepperHistory<derived_metavars>>,
884 : Initialization::Actions::ConservativeSystem<system>,
885 : // This conditional is untested and probably doesn't work if
886 : // `use_dg_subcell` is `false`
887 : tmpl::conditional_t<
888 : use_dg_subcell,
889 : tmpl::list<
890 : evolution::dg::subcell::Actions::SetSubcellGrid<volume_dim,
891 : system, true>,
892 : Actions::MutateApply<evolution::dg::subcell::SetInterpolators<
893 : volume_dim,
894 : grmhd::GhValenciaDivClean::fd::Tags::Reconstructor<system>>>>,
895 : evolution::Initialization::Actions::SetVariables<
896 : ::domain::Tags::Coordinates<volume_dim, Frame::ElementLogical>>>,
897 : Initialization::Actions::AddComputeTags<
898 : StepChoosers::step_chooser_compute_tags<
899 : GhValenciaDivCleanTemplateBase>>,
900 : ::evolution::dg::Initialization::Mortars<volume_dim>,
901 : evolution::dg::Initialization::Actions::SetupEqualRateRegions<
902 : derived_metavars, volume_dim, equal_rate_regions>,
903 : evolution::Actions::InitializeRunEventsAndDenseTriggers,
904 : intrp::Actions::ElementInitInterpPoints<volume_dim,
905 : interpolation_target_tags>,
906 : tmpl::conditional_t<
907 : use_control_systems,
908 : control_system::Actions::InitializeMeasurements<control_systems>,
909 : tmpl::list<>>,
910 : Initialization::Actions::InitializeItems<
911 : evolution::dg::Initialization::SpectralFilters<
912 : volume_dim, typename system::variables_tag::tags_list>>,
913 : Parallel::Actions::TerminatePhase>;
914 :
915 0 : using import_initial_data_action_lists = tmpl::list<
916 : Parallel::PhaseActions<
917 : Parallel::Phase::RegisterWithElementDataReader,
918 : tmpl::list<importers::Actions::RegisterWithElementDataReader,
919 : Parallel::Actions::TerminatePhase>>,
920 : Parallel::PhaseActions<
921 : Parallel::Phase::ImportInitialData,
922 : tmpl::list<
923 : grmhd::GhValenciaDivClean::Actions::SetInitialData,
924 : grmhd::GhValenciaDivClean::Actions::ReceiveNumericInitialData,
925 : Parallel::Actions::TerminatePhase>>>;
926 :
927 0 : using dg_element_array_component = DgElementArray<
928 : derived_metavars,
929 : tmpl::flatten<tmpl::list<
930 : Parallel::PhaseActions<Parallel::Phase::Initialization,
931 : initialization_actions>,
932 : import_initial_data_action_lists,
933 : Parallel::PhaseActions<
934 : Parallel::Phase::InitializeInitialDataDependentQuantities,
935 : initialize_initial_data_dependent_quantities_actions>,
936 : Parallel::PhaseActions<
937 : Parallel::Phase::InitializeTimeStepperHistory,
938 : SelfStart::self_start_procedure<step_actions, system>>,
939 : Parallel::PhaseActions<Parallel::Phase::Register,
940 : tmpl::list<dg_registration_list,
941 : Parallel::Actions::TerminatePhase>>,
942 : Parallel::PhaseActions<Parallel::Phase::Restart,
943 : tmpl::list<dg_registration_list,
944 : Parallel::Actions::TerminatePhase>>,
945 : Parallel::PhaseActions<
946 : Parallel::Phase::WriteCheckpoint,
947 : tmpl::list<evolution::Actions::RunEventsAndTriggers<
948 : Triggers::WhenToCheck::AtCheckpoints>,
949 : Parallel::Actions::TerminatePhase>>,
950 : Parallel::PhaseActions<
951 : Parallel::Phase::Evolve,
952 : tmpl::flatten<tmpl::list<
953 : ::domain::Actions::CheckFunctionsOfTimeAreReady<volume_dim>,
954 : parameterized_deleptonization,
955 : VariableFixing::Actions::FixVariables<
956 : VariableFixing::FixToAtmosphere<volume_dim>>,
957 : VariableFixing::Actions::FixVariables<
958 : VariableFixing::LimitLorentzFactor>,
959 : Actions::UpdateConservatives,
960 : std::conditional_t<local_time_stepping,
961 : evolution::Actions::RunEventsAndTriggers<
962 : Triggers::WhenToCheck::AtSteps>,
963 : tmpl::list<>>,
964 : evolution::Actions::RunEventsAndTriggers<
965 : Triggers::WhenToCheck::AtSlabs>,
966 : Actions::ChangeSlabSize,
967 : std::conditional_t<
968 : local_time_stepping,
969 : evolution::dg::Actions::ChangeFixedLtsRatio,
970 : tmpl::list<>>,
971 : step_actions, Actions::MutateApply<AdvanceTime<>>,
972 : PhaseControl::Actions::ExecutePhaseChange>>>,
973 :
974 : tmpl::conditional_t<
975 : UseControlSystems,
976 : Parallel::PhaseActions<
977 : Parallel::Phase::DisableRotationControl,
978 : tmpl::list<
979 : control_system::Actions::SwitchGridRotationToSettle,
980 : Parallel::Actions::TerminatePhase>>,
981 : tmpl::list<>>,
982 :
983 : Parallel::PhaseActions<
984 : Parallel::Phase::PostFailureCleanup,
985 : tmpl::list<Actions::RunEventsOnFailure<Tags::Time>,
986 : Parallel::Actions::TerminatePhase>>>>>;
987 :
988 0 : struct registration
989 : : tt::ConformsTo<Parallel::protocols::RegistrationMetavariables> {
990 0 : using element_registrars =
991 : tmpl::map<tmpl::pair<dg_element_array_component, dg_registration_list>>;
992 : };
993 :
994 0 : using component_list = tmpl::flatten<tmpl::list<
995 : observers::Observer<derived_metavars>,
996 : observers::ObserverWriter<derived_metavars>,
997 : importers::ElementDataReader<derived_metavars>,
998 : control_system::control_components<derived_metavars, control_systems>,
999 : intrp::InterpolationTarget<derived_metavars, InterpolationTargetTags>...,
1000 : dg_element_array_component>>;
1001 : };
1002 :
1003 0 : struct BondiSachs : tt::ConformsTo<intrp::protocols::InterpolationTargetTag> {
1004 0 : static std::string name() { return "BondiSachsInterpolation"; }
1005 0 : using temporal_id = ::Tags::Time;
1006 0 : using vars_to_interpolate_to_target =
1007 : typename gh::System<3>::variables_tag::tags_list;
1008 0 : using compute_target_points =
1009 : intrp::TargetPoints::Sphere<BondiSachs, ::Frame::Inertial>;
1010 0 : using post_interpolation_callbacks =
1011 : tmpl::list<intrp::callbacks::DumpBondiSachsOnWorldtube<BondiSachs>>;
1012 0 : using compute_items_on_target = tmpl::list<>;
1013 : template <typename Metavariables>
1014 0 : using interpolating_component =
1015 : typename Metavariables::dg_element_array_component;
1016 : };
|