Skip to content

Commit a950749

Browse files
committed
Update ScalarTensor executable
1 parent eefe1af commit a950749

File tree

5 files changed

+150
-78
lines changed

5 files changed

+150
-78
lines changed

src/Evolution/Executables/ScalarTensor/CMakeLists.txt

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,7 @@
11
# Distributed under the MIT License.
22
# See LICENSE.txt for details.
33

4-
set(EXECUTABLE EvolveScalarTensorSingleBlackHole)
5-
6-
add_spectre_executable(
7-
${EXECUTABLE}
8-
EXCLUDE_FROM_ALL
9-
EvolveScalarTensorSingleBlackHole.cpp
10-
)
11-
12-
target_link_libraries(
13-
${EXECUTABLE}
14-
PRIVATE
4+
set(LIBS_TO_LINK
155
Actions
166
ApparentHorizonFinder
177
Charmxx::main
@@ -45,3 +35,16 @@ target_link_libraries(
4535
Time
4636
Utilities
4737
)
38+
39+
set(SINGLE_BH_EXECUTABLE EvolveScalarTensorSingleBlackHole)
40+
add_spectre_executable(
41+
${SINGLE_BH_EXECUTABLE}
42+
EXCLUDE_FROM_ALL
43+
EvolveScalarTensorSingleBlackHole.cpp
44+
)
45+
target_link_libraries(
46+
${SINGLE_BH_EXECUTABLE}
47+
PRIVATE
48+
${LIBS_TO_LINK}
49+
Cce
50+
)

src/Evolution/Executables/ScalarTensor/EvolveScalarTensorSingleBlackHole.hpp

Lines changed: 62 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,17 @@
88

99
#include "ControlSystem/Actions/InitializeMeasurements.hpp"
1010
#include "ControlSystem/Component.hpp"
11+
#include "ControlSystem/ControlErrors/Size/Factory.hpp"
12+
#include "ControlSystem/ControlErrors/Size/State.hpp"
1113
#include "ControlSystem/Measurements/SingleHorizon.hpp"
1214
#include "ControlSystem/Metafunctions.hpp"
1315
#include "ControlSystem/Systems/Shape.hpp"
16+
#include "ControlSystem/Systems/Size.hpp"
17+
#include "ControlSystem/Systems/Translation.hpp"
1418
#include "ControlSystem/Trigger.hpp"
1519
#include "Domain/Structure/ObjectLabel.hpp"
1620
#include "Evolution/Actions/RunEventsAndTriggers.hpp"
1721
#include "Evolution/Executables/ScalarTensor/ScalarTensorBase.hpp"
18-
#include "Evolution/Systems/GeneralizedHarmonic/Actions/SetInitialData.hpp"
1922
#include "Options/FactoryHelpers.hpp"
2023
#include "Options/Protocols/FactoryCreation.hpp"
2124
#include "Options/String.hpp"
@@ -31,6 +34,8 @@
3134
#include "ParallelAlgorithms/ApparentHorizonFinder/ComputeHorizonVolumeQuantities.tpp"
3235
#include "ParallelAlgorithms/ApparentHorizonFinder/HorizonAliases.hpp"
3336
#include "ParallelAlgorithms/ApparentHorizonFinder/InterpolationTarget.hpp"
37+
#include "ParallelAlgorithms/ApparentHorizonFinder/ObserveCenters.hpp"
38+
#include "ParallelAlgorithms/EventsAndTriggers/Actions/RunEventsOnFailure.hpp"
3439
#include "ParallelAlgorithms/Interpolation/Actions/CleanUpInterpolator.hpp"
3540
#include "ParallelAlgorithms/Interpolation/Actions/ElementInitInterpPoints.hpp"
3641
#include "ParallelAlgorithms/Interpolation/Actions/InitializeInterpolationTarget.hpp"
@@ -52,9 +57,13 @@
5257
#include "PointwiseFunctions/GeneralRelativity/Surfaces/Tags.hpp"
5358
#include "Time/Actions/SelfStartActions.hpp"
5459
#include "Time/ChangeSlabSize/Action.hpp"
60+
#include "Time/ChangeSlabSize/Tags.hpp"
5561
#include "Time/StepChoosers/Factory.hpp"
62+
#include "Time/Tags/StepperErrors.hpp"
5663
#include "Time/Tags/Time.hpp"
64+
#include "Utilities/Algorithm.hpp"
5765
#include "Utilities/ErrorHandling/Error.hpp"
66+
#include "Utilities/PrettyType.hpp"
5867
#include "Utilities/ProtocolHelpers.hpp"
5968

6069
struct EvolutionMetavars : public ScalarTensorTemplateBase<EvolutionMetavars> {
@@ -69,27 +78,31 @@ struct EvolutionMetavars : public ScalarTensorTemplateBase<EvolutionMetavars> {
6978
"field \n"
7079
"on a domain with a single horizon and corresponding excised region"};
7180

72-
struct AhA : tt::ConformsTo<intrp::protocols::InterpolationTargetTag> {
81+
template <typename Frame>
82+
struct Ah : tt::ConformsTo<intrp::protocols::InterpolationTargetTag> {
7383
using temporal_id = ::Tags::Time;
74-
using tags_to_observe = ::ah::tags_for_observing<Frame::Inertial>;
84+
using tags_to_observe = ::ah::tags_for_observing<Frame>;
7585
using surface_tags_to_observe = ::ah::surface_tags_for_observing;
7686
using compute_vars_to_interpolate = ah::ComputeHorizonVolumeQuantities;
7787
using vars_to_interpolate_to_target =
78-
::ah::vars_to_interpolate_to_target<volume_dim, ::Frame::Inertial>;
88+
::ah::vars_to_interpolate_to_target<volume_dim, Frame>;
7989
using compute_items_on_target =
80-
::ah::compute_items_on_target<volume_dim, Frame::Inertial>;
90+
::ah::compute_items_on_target<volume_dim, Frame>;
8191
using compute_target_points =
82-
intrp::TargetPoints::ApparentHorizon<AhA, ::Frame::Inertial>;
83-
using post_interpolation_callbacks = tmpl::list<
84-
intrp::callbacks::FindApparentHorizon<AhA, ::Frame::Inertial>>;
92+
intrp::TargetPoints::ApparentHorizon<Ah, Frame>;
93+
using post_interpolation_callbacks =
94+
tmpl::list<intrp::callbacks::FindApparentHorizon<Ah, Frame>>;
8595
using horizon_find_failure_callbacks =
8696
tmpl::list<intrp::callbacks::IgnoreFailedApparentHorizon>;
8797
using post_horizon_find_callbacks = tmpl::list<
88-
intrp::callbacks::ObserveTimeSeriesOnSurface<tags_to_observe, AhA>,
89-
intrp::callbacks::ObserveSurfaceData<surface_tags_to_observe, AhA,
90-
::Frame::Inertial>>;
98+
intrp::callbacks::ObserveTimeSeriesOnSurface<tags_to_observe, Ah>,
99+
intrp::callbacks::ObserveSurfaceData<surface_tags_to_observe, Ah,
100+
Frame>,
101+
::ah::callbacks::ObserveCenters<Ah, Frame>>;
91102
};
92103

104+
using ApparentHorizon = Ah<::Frame::Distorted>;
105+
93106
struct ExcisionBoundaryA
94107
: tt::ConformsTo<intrp::protocols::InterpolationTargetTag> {
95108
using temporal_id = ::Tags::Time;
@@ -129,17 +142,24 @@ struct EvolutionMetavars : public ScalarTensorTemplateBase<EvolutionMetavars> {
129142
using interpolating_component = typename metavariables::st_dg_element_array;
130143
};
131144

132-
using control_systems = tmpl::list<control_system::Systems::Shape<
133-
::domain::ObjectLabel::None, 2,
134-
control_system::measurements::SingleHorizon<
135-
::domain::ObjectLabel::None>>>;
145+
using control_systems =
146+
tmpl::list<control_system::Systems::Shape<
147+
::domain::ObjectLabel::None, 2,
148+
control_system::measurements::SingleHorizon<
149+
::domain::ObjectLabel::None>>,
150+
control_system::Systems::Translation<
151+
2,
152+
control_system::measurements::SingleHorizon<
153+
::domain::ObjectLabel::None>,
154+
1>,
155+
control_system::Systems::Size<::domain::ObjectLabel::None, 2>>;
136156

137157
static constexpr bool use_control_systems =
138158
tmpl::size<control_systems>::value > 0;
139159

140160
using interpolation_target_tags = tmpl::push_back<
141161
control_system::metafunctions::interpolation_target_tags<control_systems>,
142-
AhA, ExcisionBoundaryA, SphericalSurface>;
162+
ApparentHorizon, ExcisionBoundaryA, SphericalSurface>;
143163
using interpolator_source_vars = ::ah::source_vars<volume_dim>;
144164

145165
using scalar_charge_interpolator_source_vars =
@@ -161,26 +181,30 @@ struct EvolutionMetavars : public ScalarTensorTemplateBase<EvolutionMetavars> {
161181
LtsTimeStepper>,
162182
tmpl::pair<LtsTimeStepper,
163183
TimeSteppers::monotonic_lts_time_steppers>>,
164-
tmpl::pair<Event,
165-
tmpl::flatten<tmpl::list<
166-
intrp::Events::Interpolate<volume_dim, AhA,
167-
interpolator_source_vars>,
168-
intrp::Events::InterpolateWithoutInterpComponent<
169-
volume_dim, ExcisionBoundaryA,
170-
interpolator_source_vars>,
171-
intrp::Events::InterpolateWithoutInterpComponent<
172-
volume_dim, SphericalSurface,
173-
scalar_charge_interpolator_source_vars>>>>,
184+
tmpl::pair<
185+
Event,
186+
tmpl::flatten<tmpl::list<
187+
intrp::Events::Interpolate<volume_dim, ApparentHorizon,
188+
interpolator_source_vars>,
189+
control_system::metafunctions::control_system_events<
190+
control_systems>,
191+
intrp::Events::InterpolateWithoutInterpComponent<
192+
volume_dim, ExcisionBoundaryA, interpolator_source_vars>,
193+
intrp::Events::InterpolateWithoutInterpComponent<
194+
volume_dim, SphericalSurface,
195+
scalar_charge_interpolator_source_vars>>>>,
174196
tmpl::pair<DenseTrigger,
175-
control_system::control_system_triggers<control_systems>>>;
197+
control_system::control_system_triggers<control_systems>>,
198+
tmpl::pair<control_system::size::State,
199+
control_system::size::States::factory_creatable_states>>;
176200
};
177201

178202
using typename st_base::const_global_cache_tags;
179203

180204
using observed_reduction_data_tags =
181205
observers::collect_reduction_data_tags<tmpl::push_back<
182206
tmpl::at<typename factory_creation::factory_classes, Event>,
183-
typename AhA::post_horizon_find_callbacks>>;
207+
typename ApparentHorizon::post_horizon_find_callbacks>>;
184208

185209
using dg_registration_list =
186210
tmpl::push_back<typename st_base::dg_registration_list,
@@ -220,7 +244,14 @@ struct EvolutionMetavars : public ScalarTensorTemplateBase<EvolutionMetavars> {
220244
::domain::Actions::CheckFunctionsOfTimeAreReady<volume_dim>,
221245
evolution::Actions::RunEventsAndTriggers<local_time_stepping>,
222246
Actions::ChangeSlabSize, step_actions, Actions::AdvanceTime,
223-
PhaseControl::Actions::ExecutePhaseChange>>>>>;
247+
PhaseControl::Actions::ExecutePhaseChange>>,
248+
Parallel::PhaseActions<
249+
Parallel::Phase::PostFailureCleanup,
250+
tmpl::list<Actions::RunEventsOnFailure<::Tags::Time>,
251+
Parallel::Actions::TerminatePhase>>>>>;
252+
253+
// ControlSystem/Measurements/CharSpeed.hpp assumes gh_dg_element_array
254+
using gh_dg_element_array = st_dg_element_array;
224255

225256
template <typename ParallelComponent>
226257
struct registration_list {
@@ -232,8 +263,8 @@ struct EvolutionMetavars : public ScalarTensorTemplateBase<EvolutionMetavars> {
232263
using component_list = tmpl::flatten<tmpl::list<
233264
observers::Observer<EvolutionMetavars>,
234265
observers::ObserverWriter<EvolutionMetavars>,
235-
mem_monitor::MemoryMonitor<EvolutionMetavars>,
236-
st_dg_element_array, intrp::Interpolator<EvolutionMetavars>,
266+
mem_monitor::MemoryMonitor<EvolutionMetavars>, st_dg_element_array,
267+
intrp::Interpolator<EvolutionMetavars>,
237268
control_system::control_components<EvolutionMetavars, control_systems>,
238269
tmpl::transform<interpolation_target_tags,
239270
tmpl::bind<intrp::InterpolationTarget,

src/Evolution/Executables/ScalarTensor/ScalarTensorBase.hpp

Lines changed: 23 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@
4646
#include "Evolution/Systems/ScalarTensor/BoundaryCorrections/Factory.hpp"
4747
#include "Evolution/Systems/ScalarTensor/Constraints.hpp"
4848
#include "Evolution/Systems/ScalarTensor/Initialize.hpp"
49-
#include "Evolution/Systems/ScalarTensor/Sources/ScalarSource.hpp"
5049
#include "Evolution/Systems/ScalarTensor/StressEnergy.hpp"
5150
#include "Evolution/Systems/ScalarTensor/System.hpp"
5251
#include "Evolution/Systems/ScalarTensor/Tags.hpp"
@@ -127,6 +126,8 @@
127126
#include "PointwiseFunctions/ScalarTensor/ConstraintDampingTags.hpp"
128127
#include "PointwiseFunctions/ScalarTensor/ConstraintGammas.hpp"
129128
#include "PointwiseFunctions/ScalarTensor/ScalarCharge.hpp"
129+
#include "PointwiseFunctions/ScalarTensor/ScalarSource.hpp"
130+
#include "PointwiseFunctions/ScalarTensor/SourceTags.hpp"
130131
#include "Time/Actions/AdvanceTime.hpp"
131132
#include "Time/Actions/CleanHistory.hpp"
132133
#include "Time/Actions/RecordTimeStepperData.hpp"
@@ -203,8 +204,7 @@ struct ObserverTags {
203204
Frame::Inertial>,
204205
gr::Tags::Shift<DataVector, volume_dim, Frame::Inertial>,
205206
gr::Tags::Lapse<DataVector>,
206-
gr::Tags::SqrtDetSpatialMetricCompute<DataVector, volume_dim,
207-
Frame::Inertial>,
207+
gr::Tags::SqrtDetSpatialMetric<DataVector>,
208208
gr::Tags::SpacetimeNormalOneFormCompute<DataVector, volume_dim,
209209
Frame::Inertial>,
210210
gr::Tags::SpacetimeNormalVector<DataVector, volume_dim,
@@ -223,19 +223,16 @@ struct ObserverTags {
223223
Frame::Inertial>,
224224
gr::Tags::ExtrinsicCurvature<DataVector, volume_dim, Frame::Inertial>,
225225
gr::Tags::TraceExtrinsicCurvature<DataVector>,
226+
// More 3 plus 1 variables
227+
::Tags::deriv<gr::Tags::SpatialChristoffelSecondKind<
228+
DataVector, volume_dim, Frame::Inertial>,
229+
tmpl::size_t<volume_dim>, Frame::Inertial>,
230+
gr::Tags::SpatialRicci<DataVector, volume_dim, Frame::Inertial>,
231+
gr::Tags::SpatialRicciScalar<DataVector>,
226232
// Compute the constraints of GH
227233
gh::Tags::GaugeConstraintCompute<volume_dim, Frame::Inertial>,
228234
gh::Tags::TwoIndexConstraintCompute<volume_dim, Frame::Inertial>,
229235
gh::Tags::ThreeIndexConstraintCompute<volume_dim, Frame::Inertial>,
230-
::Tags::DerivTensorCompute<
231-
gr::Tags::SpatialChristoffelSecondKind<DataVector, volume_dim>,
232-
::domain::Tags::InverseJacobian<volume_dim, Frame::ElementLogical,
233-
Frame::Inertial>,
234-
::domain::Tags::Mesh<volume_dim>>,
235-
gr::Tags::SpatialRicciCompute<DataVector, volume_dim,
236-
::Frame::Inertial>,
237-
gr::Tags::SpatialRicciScalarCompute<DataVector, volume_dim,
238-
::Frame::Inertial>,
239236
// Compute the constraints of CSW
240237
ScalarTensor::Tags::CswOneIndexConstraintCompute<volume_dim>,
241238
ScalarTensor::Tags::CswTwoIndexConstraintCompute<volume_dim>,
@@ -254,6 +251,10 @@ struct ObserverTags {
254251
// Damping parameters
255252
gh::Tags::ConstraintGamma0, gh::Tags::ConstraintGamma1,
256253
gh::Tags::ConstraintGamma2,
254+
ScalarTensor::Tags::CswCompute<
255+
CurvedScalarWave::Tags::ConstraintGamma1>,
256+
ScalarTensor::Tags::CswCompute<
257+
CurvedScalarWave::Tags::ConstraintGamma2>,
257258
// Sources
258259
ScalarTensor::Tags::TraceReversedStressEnergyCompute,
259260
ScalarTensor::Tags::ScalarSource,
@@ -269,13 +270,14 @@ struct ObserverTags {
269270
::Tags::PointwiseL2NormCompute<
270271
gh::Tags::FourIndexConstraint<DataVector, volume_dim>>,
271272
gh::Tags::ConstraintEnergyCompute<volume_dim, Frame::Inertial>,
272-
::Tags::DerivTensorCompute<
273-
gr::Tags::ExtrinsicCurvature<DataVector, volume_dim>,
274-
::domain::Tags::InverseJacobian<volume_dim, Frame::ElementLogical,
275-
Frame::Inertial>,
276-
::domain::Tags::Mesh<volume_dim>>,
277-
gr::Tags::WeylElectricCompute<DataVector, volume_dim,
278-
Frame::Inertial>,
273+
::Tags::deriv<gr::Tags::ExtrinsicCurvature<DataVector, volume_dim,
274+
Frame::Inertial>,
275+
tmpl::size_t<volume_dim>, Frame::Inertial>,
276+
gr::Tags::CovariantDerivativeOfExtrinsicCurvature<
277+
DataVector, volume_dim, Frame::Inertial>,
278+
gr::Tags::WeylElectric<DataVector, volume_dim, Frame::Inertial>,
279+
gr::Tags::WeylElectricScalar<DataVector>,
280+
gr::Tags::WeylMagneticScalar<DataVector>,
279281
gr::Tags::Psi4RealCompute<Frame::Inertial>>>;
280282
using non_tensor_compute_tags = tmpl::list<
281283
::Events::Tags::ObserverMeshCompute<volume_dim>,
@@ -411,7 +413,8 @@ struct ScalarTensorTemplateBase {
411413
ScalarTensor::Tags::DampingFunctionGamma1<volume_dim, Frame::Grid>,
412414
ScalarTensor::Tags::DampingFunctionGamma2<volume_dim, Frame::Grid>,
413415
// Source parameters
414-
ScalarTensor::Tags::ScalarMass>;
416+
ScalarTensor::Tags::CouplingParameters, ScalarTensor::Tags::ScalarMass,
417+
ScalarTensor::Tags::RampUpParameters>;
415418

416419
using dg_registration_list =
417420
tmpl::list<observers::Actions::RegisterEventsWithObservers>;
@@ -447,9 +450,6 @@ struct ScalarTensorTemplateBase {
447450
dg::Actions::Filter<Filters::Exponential<1>,
448451
system::scalar_system::variables_tag::tags_list>>;
449452

450-
// // For labeling the yaml option for RandomizeVariables
451-
// struct RandomizeInitialGuess {};
452-
453453
template <bool UseControlSystems>
454454
using initialization_actions = tmpl::list<
455455
Initialization::Actions::InitializeItems<
@@ -459,9 +459,6 @@ struct ScalarTensorTemplateBase {
459459
Initialization::Actions::NonconservativeSystem<system>,
460460
evolution::Initialization::Actions::SetVariables<
461461
domain::Tags::Coordinates<volume_dim, Frame::ElementLogical>>,
462-
// Random noise system::variables_tag
463-
// Actions::RandomizeVariables<typename system::variables_tag,
464-
// RandomizeInitialGuess>,
465462
Initialization::Actions::AddComputeTags<::Tags::DerivCompute<
466463
typename system::variables_tag, domain::Tags::Mesh<volume_dim>,
467464
domain::Tags::InverseJacobian<volume_dim, Frame::ElementLogical,

0 commit comments

Comments
 (0)