From 8479f273dfa3d3b0995fec1989c34874d391a4b7 Mon Sep 17 00:00:00 2001 From: Weiqun Zhang Date: Thu, 4 Jan 2024 17:11:32 -0800 Subject: [PATCH] Fix merge issues --- Source/Utils/WarpXUtil.cpp | 13 +++---------- Source/WarpX.H | 5 +++++ 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/Source/Utils/WarpXUtil.cpp b/Source/Utils/WarpXUtil.cpp index f35dba95c88..5b6a664efd9 100644 --- a/Source/Utils/WarpXUtil.cpp +++ b/Source/Utils/WarpXUtil.cpp @@ -192,21 +192,14 @@ void ConvertLabParamsToBoost () Vector dim_map {2}; #endif - std::string B_ext_grid_s, E_ext_grid_s; - - pp_warpx.query("B_ext_grid_init_style", B_ext_grid_s); - pp_warpx.query("E_ext_grid_init_style", E_ext_grid_s); - - if ((B_ext_grid_s == "impose_field_in_plane") || - (E_ext_grid_s == "impose_field_in_plane")) { + pp_warpx.query("impose_field_file_path", WarpX::m_impose_field_file_path); + if ( ! WarpX::m_impose_field_file_path.empty() ) { Real zstation; Real tmin = std::numeric_limits::max(); Real tmax = std::numeric_limits::lowest(); { - std::string impose_field_file_path; - pp_warpx.get("read_fields_from_path", impose_field_file_path); Vector headerfile; - ParallelDescriptor::ReadAndBcastFile(impose_field_file_path+"/StationHeader", headerfile); + ParallelDescriptor::ReadAndBcastFile(WarpX::m_impose_field_file_path+"/StationHeader", headerfile); std::istringstream is(std::string(headerfile.data())); is >> zstation; std::string tt; diff --git a/Source/WarpX.H b/Source/WarpX.H index c995974527c..6694937c7d7 100644 --- a/Source/WarpX.H +++ b/Source/WarpX.H @@ -150,6 +150,11 @@ public: //! The beginning time of boosted frame simulation static inline amrex::Real m_t_boost_offset = 0; + //! For boosted frame simulation restarting from a previous lab frame + //! run w/ recording plane, this is the path to the data. This also + //! serves as a boolean flag. + static inline std::string m_impose_field_file_path; + /** Maximum level up to which the externally defined electric and magnetic fields are initialized. * The default value is set to the max levels in the simulation. * if lev > maxlevel_extEMfield_init, the fields on those levels will have a default value of 0