From 573f76d884c30c15b3a0482ebd062fe3581edde7 Mon Sep 17 00:00:00 2001 From: Brandon Barker Date: Thu, 26 Oct 2023 04:03:57 +0000 Subject: [PATCH 1/4] fix: history failed when FMKS and not MHD --- src/geometry/geometry.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/geometry/geometry.cpp b/src/geometry/geometry.cpp index 434108c5..5f2138ff 100644 --- a/src/geometry/geometry.cpp +++ b/src/geometry/geometry.cpp @@ -60,8 +60,8 @@ std::shared_ptr Initialize(ParameterInput *pin) { geometry->AddField(geometric_variables::node_coords, gcoord_node); // Reductions - const bool do_hydro = pin->GetBoolean("physics", "hydro"); - if (params.hasKey("xh") && do_hydro) { + const bool do_mhd = pin->GetBoolean("fluid", "mhd"); + if (params.hasKey("xh") && do_mhd) { auto HstSum = parthenon::UserHistoryOperation::sum; using History::ReduceJetEnergyFlux; using History::ReduceJetMomentumFlux; From ec8346cc2700b072ca10bc5fd2cf52ead35fae35 Mon Sep 17 00:00:00 2001 From: Brandon Barker Date: Thu, 26 Oct 2023 05:00:01 +0000 Subject: [PATCH 2/4] change GetBoolean to GetOrAddBoolean incase fluid/mhd is not specified --- src/geometry/geometry.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/geometry/geometry.cpp b/src/geometry/geometry.cpp index 5f2138ff..7430edde 100644 --- a/src/geometry/geometry.cpp +++ b/src/geometry/geometry.cpp @@ -60,7 +60,7 @@ std::shared_ptr Initialize(ParameterInput *pin) { geometry->AddField(geometric_variables::node_coords, gcoord_node); // Reductions - const bool do_mhd = pin->GetBoolean("fluid", "mhd"); + const bool do_mhd = pin->GetorAddBoolean("fluid", "mhd", false); if (params.hasKey("xh") && do_mhd) { auto HstSum = parthenon::UserHistoryOperation::sum; using History::ReduceJetEnergyFlux; From 2502cd88b0817547c237ab64fee31b190fc85fe9 Mon Sep 17 00:00:00 2001 From: Brandon Barker Date: Thu, 26 Oct 2023 05:10:25 +0000 Subject: [PATCH 3/4] fix: typo... --- src/geometry/geometry.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/geometry/geometry.cpp b/src/geometry/geometry.cpp index 7430edde..cb1db386 100644 --- a/src/geometry/geometry.cpp +++ b/src/geometry/geometry.cpp @@ -60,7 +60,7 @@ std::shared_ptr Initialize(ParameterInput *pin) { geometry->AddField(geometric_variables::node_coords, gcoord_node); // Reductions - const bool do_mhd = pin->GetorAddBoolean("fluid", "mhd", false); + const bool do_mhd = pin->GetOrAddBoolean("fluid", "mhd", false); if (params.hasKey("xh") && do_mhd) { auto HstSum = parthenon::UserHistoryOperation::sum; using History::ReduceJetEnergyFlux; From 3ce6949d063a668223666ebf4c54d8741c10263a Mon Sep 17 00:00:00 2001 From: Brandon Barker Date: Thu, 26 Oct 2023 15:45:41 +0000 Subject: [PATCH 4/4] feat: check for hydro and mhd for history outputs --- src/geometry/geometry.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/geometry/geometry.cpp b/src/geometry/geometry.cpp index cb1db386..1d7d3b2f 100644 --- a/src/geometry/geometry.cpp +++ b/src/geometry/geometry.cpp @@ -61,7 +61,8 @@ std::shared_ptr Initialize(ParameterInput *pin) { // Reductions const bool do_mhd = pin->GetOrAddBoolean("fluid", "mhd", false); - if (params.hasKey("xh") && do_mhd) { + const bool do_hydro = pin->GetBoolean("physics", "hydro"); + if (params.hasKey("xh") && do_mhd && do_hydro) { auto HstSum = parthenon::UserHistoryOperation::sum; using History::ReduceJetEnergyFlux; using History::ReduceJetMomentumFlux;