From e31b6397d74e8ab662a1a9968134bcbf6954954c Mon Sep 17 00:00:00 2001 From: "S. Eric Clark" <25495882+clarkse@users.noreply.github.com> Date: Thu, 26 Sep 2024 15:51:58 -0700 Subject: [PATCH] Adding checks to make sure Hybrid external field loading is skipped when not enabled. Signed-off-by: S. Eric Clark <25495882+clarkse@users.noreply.github.com> --- .../FiniteDifferenceSolver/HybridPICModel/HybridPICModel.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Source/FieldSolver/FiniteDifferenceSolver/HybridPICModel/HybridPICModel.cpp b/Source/FieldSolver/FiniteDifferenceSolver/HybridPICModel/HybridPICModel.cpp index b9fef6bb195..8360dda6331 100644 --- a/Source/FieldSolver/FiniteDifferenceSolver/HybridPICModel/HybridPICModel.cpp +++ b/Source/FieldSolver/FiniteDifferenceSolver/HybridPICModel/HybridPICModel.cpp @@ -285,7 +285,8 @@ void HybridPICModel::InitData () // if the current is time dependent which is what needs to be done to // write time independent fields on the first step. GetCurrentExternal(true); - GetFieldsExternal(warpx.gett_new(0)); + if (m_add_external_fields) + GetFieldsExternal(warpx.gett_new(0)); } void HybridPICModel::GetCurrentExternal (bool skip_check /*=false*/) @@ -301,6 +302,8 @@ void HybridPICModel::GetCurrentExternal (bool skip_check /*=false*/) void HybridPICModel::GetFieldsExternal (amrex::Real t) { + if (!m_add_external_fields) return; + using ablastr::fields::Direction; auto& warpx = WarpX::GetInstance();