Skip to content

Commit

Permalink
Merge pull request sxs-collaboration#5626 from isaaclegred/RuntimeID
Browse files Browse the repository at this point in the history
Make GrMhd and GhMhd executables use runtime initial data.
  • Loading branch information
nilsdeppe authored Dec 7, 2023
2 parents a26db87 + 2d3b794 commit fc6b207
Show file tree
Hide file tree
Showing 29 changed files with 213 additions and 1,762 deletions.
51 changes: 6 additions & 45 deletions src/Evolution/Executables/GrMhd/GhValenciaDivClean/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ set(LIBS_TO_LINK_WITH_CONTROL_SYSTEM
ControlSystemMeasurements
)

function(add_ghmhd_executable SUFFIX INITIAL_DATA USE_CONTROL_SYSTEMS)
function(add_ghmhd_executable SUFFIX USE_CONTROL_SYSTEMS)
set(EXECUTABLE "EvolveGhValenciaDivClean${SUFFIX}")
add_spectre_executable(
${EXECUTABLE}
Expand All @@ -51,7 +51,6 @@ function(add_ghmhd_executable SUFFIX INITIAL_DATA USE_CONTROL_SYSTEMS)
target_compile_definitions(
${EXECUTABLE}
PRIVATE
INITIAL_DATA=${INITIAL_DATA}
USE_CONTROL_SYSTEMS=${USE_CONTROL_SYSTEMS}
)
target_link_libraries(${EXECUTABLE} PRIVATE ${LIBS_TO_LINK})
Expand All @@ -66,63 +65,25 @@ endfunction()

add_ghmhd_executable(
""
evolution::NumericInitialData
false
"false"
)

add_ghmhd_executable(
"Bns"
evolution::NumericInitialData
true
"true"
)

function(add_ghmhd_with_horizon_executable SUFFIX INITIAL_DATA)
function(add_ghmhd_with_horizon_executable SUFFIX)
set(EXECUTABLE "EvolveGhValenciaDivClean${SUFFIX}")
add_spectre_executable(
${EXECUTABLE}
EXCLUDE_FROM_ALL
EvolveGhValenciaDivCleanWithHorizon.cpp
)
target_compile_definitions(
${EXECUTABLE}
PRIVATE
INITIAL_DATA=${INITIAL_DATA}
)
target_link_libraries(${EXECUTABLE} PRIVATE ${LIBS_TO_LINK})
endfunction()

add_ghmhd_with_horizon_executable(
BondiHoyleAccretion
gh::Solutions::WrappedGr<grmhd::AnalyticData::BondiHoyleAccretion>
false
)

add_ghmhd_with_horizon_executable(
MagnetizedFmDisk
gh::Solutions::WrappedGr<grmhd::AnalyticData::MagnetizedFmDisk>
false
)

add_ghmhd_with_horizon_executable(
BondiMichel
gh::Solutions::WrappedGr<grmhd::Solutions::BondiMichel>
false
)

add_ghmhd_with_horizon_executable(
FishboneMoncriefDisk
gh::Solutions::WrappedGr<RelativisticEuler::Solutions::FishboneMoncriefDisk>
false
)

add_ghmhd_executable(
CcsnCollapse
gh::Solutions::WrappedGr<grmhd::AnalyticData::CcsnCollapse>
false
)

add_ghmhd_executable(
TovStar
gh::Solutions::WrappedGr<RelativisticEuler::Solutions::TovStar>
false
"WithHorizon"
"false"
)
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@
#include "Utilities/Serialization/RegisterDerivedClassesWithCharm.hpp"

// Parameters chosen in CMakeLists.txt
using metavariables =
EvolutionMetavars<INITIAL_DATA, USE_CONTROL_SYSTEMS, BondiSachs>;
using metavariables = EvolutionMetavars<USE_CONTROL_SYSTEMS, BondiSachs>;

extern "C" void CkRegisterMainModule() {
Parallel::charmxx::register_main_module<metavariables>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,14 @@
#include "PointwiseFunctions/GeneralRelativity/Surfaces/Tags.hpp"
#include "Utilities/TMPL.hpp"

template <typename InitialData, bool UseControlSystems,
typename... InterpolationTargetTags>
struct EvolutionMetavars : public GhValenciaDivCleanTemplateBase<
EvolutionMetavars<InitialData, UseControlSystems,
InterpolationTargetTags...>,
true, UseControlSystems> {
template <bool UseControlSystems, typename... InterpolationTargetTags>
struct EvolutionMetavars
: public GhValenciaDivCleanTemplateBase<
EvolutionMetavars<UseControlSystems, InterpolationTargetTags...>,
true, UseControlSystems> {
using base = GhValenciaDivCleanTemplateBase<
EvolutionMetavars<InitialData, UseControlSystems,
InterpolationTargetTags...>,
true, UseControlSystems>;
EvolutionMetavars<UseControlSystems, InterpolationTargetTags...>, true,
UseControlSystems>;
using const_global_cache_tags = typename base::const_global_cache_tags;
using observed_reduction_data_tags =
typename base::observed_reduction_data_tags;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#include "Utilities/Serialization/RegisterDerivedClassesWithCharm.hpp"

// Parameters chosen in CMakeLists.txt
using metavariables = EvolutionMetavars<INITIAL_DATA, false, BondiSachs>;
using metavariables = EvolutionMetavars<false, BondiSachs>;

extern "C" void CkRegisterMainModule() {
Parallel::charmxx::register_main_module<metavariables>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,11 @@
#include "Utilities/ProtocolHelpers.hpp"
#include "Utilities/TMPL.hpp"

template <typename InitialData, bool UseControlSystems,
typename... InterpolationTargetTags>
struct EvolutionMetavars : public GhValenciaDivCleanTemplateBase<
EvolutionMetavars<InitialData, UseControlSystems,
InterpolationTargetTags...>,
false, false> {
template <bool UseControlSystems, typename... InterpolationTargetTags>
struct EvolutionMetavars
: public GhValenciaDivCleanTemplateBase<
EvolutionMetavars<UseControlSystems, InterpolationTargetTags...>,
false, false> {
static_assert(not UseControlSystems,
"GhValenciaWithHorizon doesn't support control systems yet.");
static constexpr bool use_dg_subcell = false;
Expand Down Expand Up @@ -113,14 +112,11 @@ struct EvolutionMetavars : public GhValenciaDivCleanTemplateBase<
3, AhA, interpolator_source_vars>>>>;
};

using initial_data = typename base::initial_data;
using initial_data_tag = typename base::initial_data_tag;

using const_global_cache_tags = tmpl::flatten<tmpl::list<
grmhd::ValenciaDivClean::Tags::PrimitiveFromConservativeOptions,
gh::gauges::Tags::GaugeCondition,
tmpl::conditional_t<evolution::is_numeric_initial_data_v<initial_data>,
tmpl::list<>, initial_data_tag>,
gh::gauges::Tags::GaugeCondition, initial_data_tag,
grmhd::ValenciaDivClean::Tags::ConstraintDampingParameter,
typename base::equation_of_state_tag,
gh::ConstraintDamping::Tags::DampingFunctionGamma0<volume_dim,
Expand Down
Loading

0 comments on commit fc6b207

Please sign in to comment.