From a4a58d5276ed43f479d75775b4394326b88937fa Mon Sep 17 00:00:00 2001 From: RevathiJambunathan Date: Tue, 14 Nov 2023 16:53:41 -0800 Subject: [PATCH] fix warning and error strig --- Source/WarpX.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/Source/WarpX.cpp b/Source/WarpX.cpp index 96cf5edee7d..7c3c73f9bce 100644 --- a/Source/WarpX.cpp +++ b/Source/WarpX.cpp @@ -997,12 +997,17 @@ WarpX::ReadParameters () bool fine_tag_hi_specified = utils::parser::queryArrWithParser(pp_warpx, "fine_tag_hi", hi); std::string ref_patch_function; bool parser_specified = pp_warpx.query("ref_patch_function(x,y,z)",ref_patch_function); - const std::string error_string = std::string( "For max_level > 0, you need to either set\ - warpx.fine_tag_lo and warpx.fine_tag_hi\ - or warpx.ref_patch_function(x,y,z)"); WARPX_ALWAYS_ASSERT_WITH_MESSAGE( ((fine_tag_lo_specified && fine_tag_hi_specified) || parser_specified ), - error_string); + "For max_level > 0, you need to either set\ + warpx.fine_tag_lo and warpx.fine_tag_hi\ + or warpx.ref_patch_function(x,y,z)"); + + if ( (fine_tag_lo_specified && fine_tag_hi_specified) && parser_specified) { + ablastr::warn_manager::WMRecordWarning("Refined patch", "Both fine_tag_lo,fine_tag_hi\ + and ref_patch_function(x,y,z) are provided. Note that the ref_patch_function will\ + override the fine_tag_lo/fine_tag_hi definition for the refined patches"); + } if (fine_tag_lo_specified && fine_tag_hi_specified) { fine_tag_lo = RealVect{lo}; fine_tag_hi = RealVect{hi};