From 8ec6b19767cfaea7949fb47053c788b001994ef8 Mon Sep 17 00:00:00 2001 From: Axel Huebl Date: Thu, 8 Jun 2023 16:45:02 -0700 Subject: `geometry.is_periodic`: Only Warn (#3974) We want to be able to directly run a simulation from the created `warpx_used_inputs` file of a previous simulation. Since we use `geometry.is_periodic` internally to communicate boundary conditions to AMReX solvers and communication routines, we cannot fail if it is present but instead should only warn. --- Source/Utils/WarpXUtil.cpp | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'Source/Utils/WarpXUtil.cpp') diff --git a/Source/Utils/WarpXUtil.cpp b/Source/Utils/WarpXUtil.cpp index 906269cd8..debb34459 100644 --- a/Source/Utils/WarpXUtil.cpp +++ b/Source/Utils/WarpXUtil.cpp @@ -14,6 +14,8 @@ #include "WarpXProfilerWrapper.H" #include "WarpXUtil.H" +#include + #include #include #include @@ -395,13 +397,15 @@ void ReadBCParams () ParmParse pp_algo("algo"); int electromagnetic_solver_id = GetAlgorithmInteger(pp_algo, "maxwell_solver"); - WARPX_ALWAYS_ASSERT_WITH_MESSAGE( - !pp_geometry.queryarr("is_periodic", geom_periodicity), - "geometry.is_periodic is not supported. Please use `boundary.field_lo`," - " `boundary.field_hi` to specifiy field boundary conditions and" - " 'boundary.particle_lo', 'boundary.particle_hi' to specify particle" - " boundary conditions." - ); + if (pp_geometry.queryarr("is_periodic", geom_periodicity)) + { + std::string const warnMsg = + "geometry.is_periodic is only used internally. Please use `boundary.field_lo`," + " `boundary.field_hi` to specifiy field boundary conditions and" + " 'boundary.particle_lo', 'boundary.particle_hi' to specify particle" + " boundary conditions."; + ablastr::warn_manager::WMRecordWarning("Input", warnMsg); + } // particle boundary may not be explicitly specified for some applications bool particle_boundary_specified = false; -- cgit v1.2.3