Skip to content

Commit

Permalink
Limit execs with control systems to monotonic LTS
Browse files Browse the repository at this point in the history
The others LTS steppers will deadlock.
  • Loading branch information
wthrowe committed Jun 12, 2024
1 parent b53d2df commit 75b04f2
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,9 @@ struct EvolutionMetavars {
tmpl::pair<
gh::gauges::GaugeCondition,
tmpl::list<gh::gauges::DampedHarmonic, gh::gauges::Harmonic>>,
tmpl::pair<LtsTimeStepper, TimeSteppers::lts_time_steppers>,
// Restrict to monotonic time steppers in LTS to avoid control
// systems deadlocking.
tmpl::pair<LtsTimeStepper, TimeSteppers::monotonic_lts_time_steppers>,
tmpl::pair<PhaseChange, PhaseControl::factory_creatable_classes>,
tmpl::pair<StepChooser<StepChooserUse::LtsStep>,
StepChoosers::standard_step_choosers<system>>,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,13 @@ struct EvolutionMetavars : public GeneralizedHarmonicTemplateBase<3, UseLts> {
struct factory_creation
: tt::ConformsTo<Options::protocols::FactoryCreation> {
using factory_classes = Options::add_factory_classes<
typename gh_base::factory_creation::factory_classes,
// Restrict to monotonic time steppers in LTS to avoid control
// systems deadlocking.
tmpl::insert<
tmpl::erase<typename gh_base::factory_creation::factory_classes,
LtsTimeStepper>,
tmpl::pair<LtsTimeStepper,
TimeSteppers::monotonic_lts_time_steppers>>,
tmpl::pair<Event,
tmpl::flatten<tmpl::list<
intrp::Events::Interpolate<3, ApparentHorizon,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -616,7 +616,13 @@ struct GhValenciaDivCleanTemplateBase<
boundary_conditions>,
tmpl::pair<gh::gauges::GaugeCondition, gh::gauges::all_gauges>,
tmpl::pair<evolution::initial_data::InitialData, initial_data_list>,
tmpl::pair<LtsTimeStepper, TimeSteppers::lts_time_steppers>,
// Restrict to monotonic time steppers in LTS to avoid control
// systems deadlocking.
tmpl::pair<
LtsTimeStepper,
tmpl::conditional_t<use_control_systems,
TimeSteppers::monotonic_lts_time_steppers,
TimeSteppers::lts_time_steppers>>,
tmpl::pair<PhaseChange, PhaseControl::factory_creatable_classes>,
tmpl::pair<StepChooser<StepChooserUse::LtsStep>,
StepChoosers::standard_step_choosers<system>>,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,13 @@ struct EvolutionMetavars : public ScalarTensorTemplateBase<EvolutionMetavars> {
struct factory_creation
: tt::ConformsTo<Options::protocols::FactoryCreation> {
using factory_classes = Options::add_factory_classes<
typename st_base::factory_creation::factory_classes,
// Restrict to monotonic time steppers in LTS to avoid control
// systems deadlocking.
tmpl::insert<
tmpl::erase<typename st_base::factory_creation::factory_classes,
LtsTimeStepper>,
tmpl::pair<LtsTimeStepper,
TimeSteppers::monotonic_lts_time_steppers>>,
tmpl::pair<Event,
tmpl::flatten<tmpl::list<
intrp::Events::Interpolate<volume_dim, AhA,
Expand Down
5 changes: 5 additions & 0 deletions src/Time/TimeSteppers/Factory.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,9 @@ using imex_time_steppers =
/// Typelist of TimeSteppers whose substep times are strictly increasing
using increasing_substep_time_steppers =
tmpl::list<AdamsBashforth, Rk3Owren, Rk4Owren>;

/// Typelist of LtsTimeSteppers with monotonic() true, i.e., those
/// that work with control systems.
using monotonic_lts_time_steppers =
tmpl::list<AdamsBashforth, AdamsMoultonPc<true>>;
} // namespace TimeSteppers
6 changes: 6 additions & 0 deletions tests/Unit/Time/TimeSteppers/Test_Factory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,5 +82,11 @@ SPECTRE_TEST_CASE("Unit.Time.TimeSteppers.Factory", "[Unit][Time]") {
}
return true;
});
check_list_contents<TimeSteppers::monotonic_lts_time_steppers>(
"monotonic_lts_time_steppers",
[]<typename Stepper>(tmpl::type_<Stepper> /*meta*/) {
return std::is_convertible_v<Stepper*, LtsTimeStepper*> and
create_example(tmpl::type_<Stepper>{}).monotonic();
});
}
} // namespace

0 comments on commit 75b04f2

Please sign in to comment.