diff options
author | 2023-05-01 18:25:01 +0200 | |
---|---|---|
committer | 2023-05-01 09:25:01 -0700 | |
commit | 1c6f1bf24513b4e56f640eea402fa8223ea1c667 (patch) | |
tree | 29967ef551e4632b757f41ac98e10b258692be71 /Source/Initialization | |
parent | a602c6e60ec8d6b728dfe7fe5e79ec191c906f57 (diff) | |
download | WarpX-1c6f1bf24513b4e56f640eea402fa8223ea1c667.tar.gz WarpX-1c6f1bf24513b4e56f640eea402fa8223ea1c667.tar.zst WarpX-1c6f1bf24513b4e56f640eea402fa8223ea1c667.zip |
Use WARPX_ABORT_WITH_MESSAGE("msg") instead of amrex::Abort(Utils::TextMsg::Err("msg")) (#3879)
* use WARPX_ABORT_WITH_MSG instead of amrex::Abort(Utils::TextMsg::Err(msg)) [WIP]
* use WARPX_ABORT_WITH_MESSAGE
* fix typo
* fix missing parenthesis
* remove spaces to prevent automatic text wrapping
* remove wrong parenthesis
Diffstat (limited to 'Source/Initialization')
-rw-r--r-- | Source/Initialization/PlasmaInjector.cpp | 10 | ||||
-rw-r--r-- | Source/Initialization/TemperatureProperties.cpp | 2 | ||||
-rw-r--r-- | Source/Initialization/VelocityProperties.cpp | 8 | ||||
-rw-r--r-- | Source/Initialization/WarpXInitData.cpp | 19 |
4 files changed, 19 insertions, 20 deletions
diff --git a/Source/Initialization/PlasmaInjector.cpp b/Source/Initialization/PlasmaInjector.cpp index 439e7a8d6..0282636c7 100644 --- a/Source/Initialization/PlasmaInjector.cpp +++ b/Source/Initialization/PlasmaInjector.cpp @@ -50,7 +50,7 @@ namespace { std::string string; stringstream << var << " string '" << name << "' not recognized."; string = stringstream.str(); - amrex::Abort(Utils::TextMsg::Err(string.c_str())); + WARPX_ABORT_WITH_MESSAGE(string.c_str()); } } @@ -388,9 +388,9 @@ PlasmaInjector::PlasmaInjector (int ispecies, const std::string& name) parseMomentum(pp_species_name); } else if (injection_style == "external_file") { #ifndef WARPX_USE_OPENPMD - amrex::Abort(Utils::TextMsg::Err( + WARPX_ABORT_WITH_MESSAGE( "WarpX has to be compiled with USE_OPENPMD=TRUE to be able" - " to read the external openPMD file with species data")); + " to read the external openPMD file with species data"); #endif external_file = true; std::string str_injection_file; @@ -475,9 +475,9 @@ PlasmaInjector::PlasmaInjector (int ispecies, const std::string& name) amrex::ParallelDescriptor::Bcast(&mass, 1, amrex::ParallelDescriptor::IOProcessorNumber()); #else - amrex::Abort(Utils::TextMsg::Err( + WARPX_ABORT_WITH_MESSAGE( "Plasma injection via external_file requires openPMD support: " - "Add USE_OPENPMD=TRUE when compiling WarpX.")); + "Add USE_OPENPMD=TRUE when compiling WarpX."); #endif // WARPX_USE_OPENPMD } else { diff --git a/Source/Initialization/TemperatureProperties.cpp b/Source/Initialization/TemperatureProperties.cpp index 6414fd118..76ea1ac1b 100644 --- a/Source/Initialization/TemperatureProperties.cpp +++ b/Source/Initialization/TemperatureProperties.cpp @@ -69,6 +69,6 @@ TemperatureProperties::TemperatureProperties (amrex::ParmParse& pp) { std::string string; stringstream << "Temperature distribution type '" << temp_dist_s << "' not recognized."; string = stringstream.str(); - amrex::Abort(Utils::TextMsg::Err(string.c_str())); + WARPX_ABORT_WITH_MESSAGE(string.c_str()); } } diff --git a/Source/Initialization/VelocityProperties.cpp b/Source/Initialization/VelocityProperties.cpp index 95f41d403..e70c1255e 100644 --- a/Source/Initialization/VelocityProperties.cpp +++ b/Source/Initialization/VelocityProperties.cpp @@ -38,10 +38,10 @@ VelocityProperties::VelocityProperties (amrex::ParmParse& pp) { m_dir = 2; } else { - amrex::Abort(Utils::TextMsg::Err( + WARPX_ABORT_WITH_MESSAGE( "Cannot interpret <s_name>.bulk_vel_dir input '" + vel_dir_s + "'. Please enter +/- x, y, or z with no whitespace between the sign and"+ - " other character.")); + " other character."); } pp.query("beta_distribution_type", vel_dist_s); @@ -63,7 +63,7 @@ VelocityProperties::VelocityProperties (amrex::ParmParse& pp) { m_type = VelParserFunction; } else { - amrex::Abort(Utils::TextMsg::Err( - "Velocity distribution type '" + vel_dist_s + "' not recognized.")); + WARPX_ABORT_WITH_MESSAGE( + "Velocity distribution type '" + vel_dist_s + "' not recognized."); } } diff --git a/Source/Initialization/WarpXInitData.cpp b/Source/Initialization/WarpXInitData.cpp index 062f8a83b..d8353a7e5 100644 --- a/Source/Initialization/WarpXInitData.cpp +++ b/Source/Initialization/WarpXInitData.cpp @@ -769,8 +769,8 @@ WarpX::InitLevelData (int lev, Real /*time*/) if (B_ext_grid_s == "parse_b_ext_grid_function") { #ifdef WARPX_DIM_RZ - amrex::Abort(Utils::TextMsg::Err( - "E and B parser for external fields does not work with RZ -- TO DO")); + WARPX_ABORT_WITH_MESSAGE( + "E and B parser for external fields does not work with RZ -- TO DO"); #endif utils::parser::Store_parserString(pp_warpx, "Bx_external_grid_function(x,y,z)", str_Bx_ext_grid_function); @@ -827,8 +827,8 @@ WarpX::InitLevelData (int lev, Real /*time*/) if (E_ext_grid_s == "parse_e_ext_grid_function") { #ifdef WARPX_DIM_RZ - amrex::Abort(Utils::TextMsg::Err( - "E and B parser for external fields does not work with RZ -- TO DO")); + WARPX_ABORT_WITH_MESSAGE( + "E and B parser for external fields does not work with RZ -- TO DO"); #endif utils::parser::Store_parserString(pp_warpx, "Ex_external_grid_function(x,y,z)", str_Ex_ext_grid_function); @@ -1336,8 +1336,8 @@ WarpX::ReadExternalFieldFromFile ( WARPX_ALWAYS_ASSERT_WITH_MESSAGE(axisLabels[0] == "x" && axisLabels[1] == "z", "XZ expects axisLabels {x, z}"); #elif defined(WARPX_DIM_1D_Z) - amrex::Abort(Utils::TextMsg::Err( - "Reading from openPMD for external fields is not known to work with 1D3V (see #3830)")); + WARPX_ABORT_WITH_MESSAGE( + "Reading from openPMD for external fields is not known to work with 1D3V (see #3830)"); WARPX_ALWAYS_ASSERT_WITH_MESSAGE(fileGeom == "cartesian", "1D3V can only read from files with cartesian geometry"); WARPX_ALWAYS_ASSERT_WITH_MESSAGE(axisLabels[0] == "z"); #elif defined(WARPX_DIM_RZ) @@ -1485,12 +1485,11 @@ void WarpX::ReadExternalFieldFromFile (std::string , amrex::MultiFab* ,std::string, std::string) { #if defined(WARPX_DIM_1D) - Abort(Utils::TextMsg::Err("Reading fields from openPMD files is not supported in 1D"); + WARPX_ABORT_WITH_MESSAGE("Reading fields from openPMD files is not supported in 1D"); #elif defined(WARPX_DIM_XZ) - Abort(Utils::TextMsg::Err( - "Reading from openPMD for external fields is not known to work with XZ (see #3828)")); + WARPX_ABORT_WITH_MESSAGE("Reading from openPMD for external fields is not known to work with XZ (see #3828)"); #elif !defined(WARPX_USE_OPENPMD) - Abort(Utils::TextMsg::Err("OpenPMD field reading requires OpenPMD support to be enabled")); + WARPX_ABORT_WITH_MESSAGE("OpenPMD field reading requires OpenPMD support to be enabled"); #endif } #endif // WARPX_USE_OPENPMD |