diff options
30 files changed, 97 insertions, 75 deletions
diff --git a/Examples/Tests/nci_psatd_stability/analysis_galilean.py b/Examples/Tests/nci_psatd_stability/analysis_galilean.py index 170b9cfaa..666d240da 100755 --- a/Examples/Tests/nci_psatd_stability/analysis_galilean.py +++ b/Examples/Tests/nci_psatd_stability/analysis_galilean.py @@ -113,4 +113,4 @@ if current_correction: assert(err_charge < tol_charge) test_name = os.path.split(os.getcwd())[1] -checksumAPI.evaluate_checksum(test_name, filename) +checksumAPI.evaluate_checksum(test_name, filename, rtol=1.e-8) diff --git a/Source/BoundaryConditions/WarpX_PML_kernels.H b/Source/BoundaryConditions/WarpX_PML_kernels.H index 747e09374..54a541d1b 100644 --- a/Source/BoundaryConditions/WarpX_PML_kernels.H +++ b/Source/BoundaryConditions/WarpX_PML_kernels.H @@ -9,6 +9,7 @@ #define WARPX_PML_KERNELS_H_ #include "BoundaryConditions/PMLComponent.H" +#include "Utils/TextMsg.H" #include <AMReX.H> #include <AMReX_FArrayBox.H> @@ -30,7 +31,7 @@ void warpx_damp_pml_ex (int i, int j, int k, Array4<Real> const& Ex, #if defined(WARPX_DIM_1D_Z) amrex::ignore_unused(i, j, k, Ex, Ex_stag, sigma_fac_x, sigma_fac_y, sigma_fac_z, sigma_star_fac_x, sigma_star_fac_y, sigma_star_fac_z, xlo, ylo, zlo, dive_cleaning); - amrex::Abort("PML not implemented in Cartesian 1D geometry"); + WARPX_ABORT_WITH_MESSAGE("PML not implemented in Cartesian 1D geometry"); #endif #if defined(WARPX_DIM_XZ) || defined(WARPX_DIM_RZ) @@ -107,7 +108,7 @@ void warpx_damp_pml_ey (int i, int j, int k, Array4<Real> const& Ey, #if defined(WARPX_DIM_1D_Z) amrex::ignore_unused(i, j, k, Ey, Ey_stag, sigma_fac_x, sigma_fac_y, sigma_fac_z, sigma_star_fac_x, sigma_star_fac_y, sigma_star_fac_z, xlo, ylo, zlo, dive_cleaning); - amrex::Abort("PML not implemented in Cartesian 1D geometry"); + WARPX_ABORT_WITH_MESSAGE("PML not implemented in Cartesian 1D geometry"); #endif #if defined(WARPX_DIM_XZ) || defined(WARPX_DIM_RZ) @@ -181,7 +182,7 @@ void warpx_damp_pml_ez (int i, int j, int k, Array4<Real> const& Ez, #if defined(WARPX_DIM_1D_Z) amrex::ignore_unused(i, j, k, Ez, Ez_stag, sigma_fac_x, sigma_fac_y, sigma_fac_z, sigma_star_fac_x, sigma_star_fac_y, sigma_star_fac_z, xlo, ylo, zlo, dive_cleaning); - amrex::Abort("PML not implemented in Cartesian 1D geometry"); + WARPX_ABORT_WITH_MESSAGE("PML not implemented in Cartesian 1D geometry"); #endif #if defined(WARPX_DIM_XZ) || defined(WARPX_DIM_RZ) @@ -258,7 +259,7 @@ void warpx_damp_pml_bx (int i, int j, int k, Array4<Real> const& Bx, #if defined(WARPX_DIM_1D_Z) amrex::ignore_unused(i, j, k, Bx, Bx_stag, sigma_fac_x, sigma_fac_y, sigma_fac_z, sigma_star_fac_x, sigma_star_fac_y, sigma_star_fac_z, xlo, ylo, zlo, divb_cleaning); - amrex::Abort("PML not implemented in Cartesian 1D geometry"); + WARPX_ABORT_WITH_MESSAGE("PML not implemented in Cartesian 1D geometry"); #endif #if defined(WARPX_DIM_XZ) || defined(WARPX_DIM_RZ) @@ -335,7 +336,7 @@ void warpx_damp_pml_by (int i, int j, int k, Array4<Real> const& By, #if defined(WARPX_DIM_1D_Z) amrex::ignore_unused(i, j, k, By, By_stag, sigma_fac_x, sigma_fac_y, sigma_fac_z, sigma_star_fac_x, sigma_star_fac_y, sigma_star_fac_z, xlo, ylo, zlo, divb_cleaning); - amrex::Abort("PML not implemented in Cartesian 1D geometry"); + WARPX_ABORT_WITH_MESSAGE("PML not implemented in Cartesian 1D geometry"); #endif #if defined(WARPX_DIM_XZ) || defined(WARPX_DIM_RZ) @@ -409,7 +410,7 @@ void warpx_damp_pml_bz (int i, int j, int k, Array4<Real> const& Bz, #if defined(WARPX_DIM_1D_Z) amrex::ignore_unused(i, j, k, Bz, Bz_stag, sigma_fac_x, sigma_fac_y, sigma_fac_z, sigma_star_fac_x, sigma_star_fac_y, sigma_star_fac_z, xlo, ylo, zlo, divb_cleaning); - amrex::Abort("PML not implemented in Cartesian 1D geometry"); + WARPX_ABORT_WITH_MESSAGE("PML not implemented in Cartesian 1D geometry"); #endif #if defined(WARPX_DIM_XZ) || defined(WARPX_DIM_RZ) @@ -485,7 +486,7 @@ void warpx_damp_pml_scalar (int i, int j, int k, Array4<Real> const& arr, #if defined(WARPX_DIM_1D_Z) amrex::ignore_unused(i, j, k, arr, arr_stag, sigma_fac_x, sigma_fac_y, sigma_fac_z, sigma_star_fac_x, sigma_star_fac_y, sigma_star_fac_z, xlo, ylo, zlo); - amrex::Abort("PML not implemented in Cartesian 1D geometry"); + WARPX_ABORT_WITH_MESSAGE("PML not implemented in Cartesian 1D geometry"); #endif #if defined(WARPX_DIM_XZ) || defined(WARPX_DIM_RZ) diff --git a/Source/Diagnostics/BoundaryScrapingDiagnostics.cpp b/Source/Diagnostics/BoundaryScrapingDiagnostics.cpp index 792413d98..cdcc7df65 100644 --- a/Source/Diagnostics/BoundaryScrapingDiagnostics.cpp +++ b/Source/Diagnostics/BoundaryScrapingDiagnostics.cpp @@ -10,6 +10,7 @@ #include "Diagnostics/Diagnostics.H" #include "Diagnostics/FlushFormats/FlushFormat.H" #include "Particles/ParticleBoundaryBuffer.H" +#include "Utils/TextMsg.H" #include "WarpX.H" #include <AMReX.H> @@ -46,7 +47,7 @@ BoundaryScrapingDiagnostics::ReadParameters () // Do a few checks #ifndef WARPX_USE_OPENPMD - amrex::Abort("You need to compile WarpX with openPMD support, in order to use BoundaryScrapingDiagnostic: -DWarpX_OPENPMD=ON"); + WARPX_ABORT_WITH_MESSAGE("You need to compile WarpX with openPMD support, in order to use BoundaryScrapingDiagnostic: -DWarpX_OPENPMD=ON"); #endif // Check that the output format is openPMD diff --git a/Source/Diagnostics/ReducedDiags/ParticleHistogram2D.cpp b/Source/Diagnostics/ReducedDiags/ParticleHistogram2D.cpp index 5237d3e1f..36699842a 100644 --- a/Source/Diagnostics/ReducedDiags/ParticleHistogram2D.cpp +++ b/Source/Diagnostics/ReducedDiags/ParticleHistogram2D.cpp @@ -102,8 +102,7 @@ ParticleHistogram2D::ParticleHistogram2D (std::string rd_name) } // if m_selected_species_id is not modified if ( m_selected_species_id == -1 ){ - Abort(Utils::TextMsg::Err( - "Unknown species for ParticleHistogram2D reduced diagnostic.")); + WARPX_ABORT_WITH_MESSAGE("Unknown species for ParticleHistogram2D reduced diagnostic."); } // Read optional filter diff --git a/Source/Diagnostics/WarpXOpenPMD.cpp b/Source/Diagnostics/WarpXOpenPMD.cpp index c30d58726..a9ee94cee 100644 --- a/Source/Diagnostics/WarpXOpenPMD.cpp +++ b/Source/Diagnostics/WarpXOpenPMD.cpp @@ -837,7 +837,7 @@ WarpXOpenPMDPlot::DumpToFile (ParticleContainer* pc, default : { std::string msg = "WarpX openPMD ADIOS2 work-around has unknown dtype: "; msg += datatypeToString(dtype); - amrex::Abort(msg); + WARPX_ABORT_WITH_MESSAGE(msg); break; } } diff --git a/Source/EmbeddedBoundary/DistanceToEB.H b/Source/EmbeddedBoundary/DistanceToEB.H index 94c7370cc..8f00984ee 100644 --- a/Source/EmbeddedBoundary/DistanceToEB.H +++ b/Source/EmbeddedBoundary/DistanceToEB.H @@ -7,6 +7,8 @@ #ifndef DISTANCETOEB_H_ #define DISTANCETOEB_H_ +#include "Utils/TextMsg.H" + #include <AMReX.H> #include <AMReX_REAL.H> #include <AMReX_RealVect.H> @@ -81,7 +83,7 @@ amrex::RealVect interp_normal (int i, int j, int k, const amrex::Real W[AMREX_SP #else amrex::RealVect normal{0.0, 0.0}; amrex::ignore_unused(i, j, k, W, phi, dxi); - amrex::Abort("Error: interp_distance not yet implemented in 1D"); + WARPX_ABORT_WITH_MESSAGE("Error: interp_distance not yet implemented in 1D"); #endif return normal; } diff --git a/Source/FieldSolver/FiniteDifferenceSolver/EvolveB.cpp b/Source/FieldSolver/FiniteDifferenceSolver/EvolveB.cpp index a439a91f7..81a569461 100644 --- a/Source/FieldSolver/FiniteDifferenceSolver/EvolveB.cpp +++ b/Source/FieldSolver/FiniteDifferenceSolver/EvolveB.cpp @@ -284,7 +284,7 @@ void FiniteDifferenceSolver::EvolveBCartesianECT ( jp = j; kp = k + vec(1); #else - amrex::Abort("EvolveBCartesianECT: Embedded Boundaries are only implemented in 2D3V and 3D3V"); + WARPX_ABORT_WITH_MESSAGE("EvolveBCartesianECT: Embedded Boundaries are only implemented in 2D3V and 3D3V"); #endif }else{ ip = i + vec(0); @@ -316,7 +316,7 @@ void FiniteDifferenceSolver::EvolveBCartesianECT ( jp = j; kp = k + vec(1); #else - amrex::Abort("EvolveBCartesianECT: Embedded Boundaries are only implemented in 2D3V and 3D3V"); + WARPX_ABORT_WITH_MESSAGE("EvolveBCartesianECT: Embedded Boundaries are only implemented in 2D3V and 3D3V"); #endif }else{ ip = i + vec(0); diff --git a/Source/FieldSolver/FiniteDifferenceSolver/EvolveECTRho.cpp b/Source/FieldSolver/FiniteDifferenceSolver/EvolveECTRho.cpp index a155b8f71..b7a42ad28 100644 --- a/Source/FieldSolver/FiniteDifferenceSolver/EvolveECTRho.cpp +++ b/Source/FieldSolver/FiniteDifferenceSolver/EvolveECTRho.cpp @@ -131,7 +131,7 @@ void FiniteDifferenceSolver::EvolveRhoCartesianECT ( Rhoy(i, j, k) = (Ez(i, j, k) * lz(i, j, k) - Ez(i + 1, j, k) * lz(i + 1, j, k) + Ex(i, j, k + 1) * lx(i, j, k + 1) - Ex(i, j, k) * lx(i, j, k)) / Sy(i, j, k); #else - amrex::Abort("EvolveRhoCartesianECT: Embedded Boundaries are only implemented in 3D and XZ"); + WARPX_ABORT_WITH_MESSAGE("EvolveRhoCartesianECT: Embedded Boundaries are only implemented in 3D and XZ"); #endif }, diff --git a/Source/Initialization/InjectorMomentum.H b/Source/Initialization/InjectorMomentum.H index 551b04f17..072c443c8 100644 --- a/Source/Initialization/InjectorMomentum.H +++ b/Source/Initialization/InjectorMomentum.H @@ -13,8 +13,8 @@ #include "GetVelocity.H" #include "TemperatureProperties.H" #include "VelocityProperties.H" -#include "Utils/WarpXConst.H" #include "Utils/TextMsg.H" +#include "Utils/WarpXConst.H" #include <AMReX.H> #include <AMReX_Config.H> diff --git a/Source/Parallelization/WarpXComm.cpp b/Source/Parallelization/WarpXComm.cpp index b5989ea71..538aa888b 100644 --- a/Source/Parallelization/WarpXComm.cpp +++ b/Source/Parallelization/WarpXComm.cpp @@ -655,7 +655,7 @@ WarpX::FillBoundaryE_avg (int lev, PatchType patch_type, IntVect ng) { if (do_pml && pml[lev]->ok()) { - amrex::Abort("Averaged Galilean PSATD with PML is not yet implemented"); + WARPX_ABORT_WITH_MESSAGE("Averaged Galilean PSATD with PML is not yet implemented"); } const amrex::Periodicity& period = Geom(lev).periodicity(); @@ -675,7 +675,7 @@ WarpX::FillBoundaryE_avg (int lev, PatchType patch_type, IntVect ng) { if (do_pml && pml[lev]->ok()) { - amrex::Abort("Averaged Galilean PSATD with PML is not yet implemented"); + WARPX_ABORT_WITH_MESSAGE("Averaged Galilean PSATD with PML is not yet implemented"); } const amrex::Periodicity& cperiod = Geom(lev-1).periodicity(); @@ -709,7 +709,7 @@ WarpX::FillBoundaryB_avg (int lev, PatchType patch_type, IntVect ng) { if (do_pml && pml[lev]->ok()) { - amrex::Abort("Averaged Galilean PSATD with PML is not yet implemented"); + WARPX_ABORT_WITH_MESSAGE("Averaged Galilean PSATD with PML is not yet implemented"); } const amrex::Periodicity& period = Geom(lev).periodicity(); if ( safe_guard_cells ) { @@ -728,7 +728,7 @@ WarpX::FillBoundaryB_avg (int lev, PatchType patch_type, IntVect ng) { if (do_pml && pml[lev]->ok()) { - amrex::Abort("Averaged Galilean PSATD with PML is not yet implemented"); + WARPX_ABORT_WITH_MESSAGE("Averaged Galilean PSATD with PML is not yet implemented"); } const amrex::Periodicity& cperiod = Geom(lev-1).periodicity(); diff --git a/Source/Parallelization/WarpXRegrid.cpp b/Source/Parallelization/WarpXRegrid.cpp index 16ecd49ce..25eff3045 100644 --- a/Source/Parallelization/WarpXRegrid.cpp +++ b/Source/Parallelization/WarpXRegrid.cpp @@ -14,6 +14,7 @@ #include "Particles/MultiParticleContainer.H" #include "Particles/ParticleBoundaryBuffer.H" #include "Particles/WarpXParticleContainer.H" +#include "Utils/TextMsg.H" #include "Utils/WarpXAlgorithmSelection.H" #include "Utils/WarpXProfilerWrapper.H" @@ -355,7 +356,7 @@ WarpX::RemakeLevel (int lev, Real /*time*/, const BoxArray& ba, const Distributi } else { - amrex::Abort("RemakeLevel: to be implemented"); + WARPX_ABORT_WITH_MESSAGE("RemakeLevel: to be implemented"); } // Re-initialize diagnostic functors that stores pointers to the user-requested fields at level, lev. diff --git a/Source/Particles/Collision/BackgroundMCC/MCCProcess.cpp b/Source/Particles/Collision/BackgroundMCC/MCCProcess.cpp index 0f6dae3bc..0451f62be 100644 --- a/Source/Particles/Collision/BackgroundMCC/MCCProcess.cpp +++ b/Source/Particles/Collision/BackgroundMCC/MCCProcess.cpp @@ -97,14 +97,14 @@ MCCProcess::readCrossSectionFile ( amrex::Gpu::HostVector<amrex::ParticleReal>& sigmas ) { std::ifstream infile(cross_section_file); - if(!infile.is_open()) amrex::Abort("Failed to open cross-section data file"); + if(!infile.is_open()) WARPX_ABORT_WITH_MESSAGE("Failed to open cross-section data file"); amrex::ParticleReal energy, sigma; while (infile >> energy >> sigma) { energies.push_back(energy); sigmas.push_back(sigma); } - if (infile.bad()) amrex::Abort("Failed to read cross-section data from file."); + if (infile.bad()) WARPX_ABORT_WITH_MESSAGE("Failed to read cross-section data from file."); infile.close(); } diff --git a/Source/Particles/Collision/BinaryCollision/BinaryCollision.H b/Source/Particles/Collision/BinaryCollision/BinaryCollision.H index 2c1cdc689..ea439a071 100644 --- a/Source/Particles/Collision/BinaryCollision/BinaryCollision.H +++ b/Source/Particles/Collision/BinaryCollision/BinaryCollision.H @@ -18,6 +18,7 @@ #include "Particles/MultiParticleContainer.H" #include "Particles/WarpXParticleContainer.H" #include "Utils/ParticleUtils.H" +#include "Utils/TextMsg.H" #include "Utils/WarpXAlgorithmSelection.H" #include "WarpX.H" @@ -87,7 +88,7 @@ public: : CollisionBase(collision_name) { if(m_species_names.size() != 2) - amrex::Abort("Binary collision " + collision_name + " must have exactly two species."); + WARPX_ABORT_WITH_MESSAGE("Binary collision " + collision_name + " must have exactly two species."); if (m_species_names[0] == m_species_names[1]) m_isSameSpecies = true; diff --git a/Source/Particles/Collision/BinaryCollision/BinaryCollisionUtils.cpp b/Source/Particles/Collision/BinaryCollision/BinaryCollisionUtils.cpp index d7cc754d0..c94cd8812 100644 --- a/Source/Particles/Collision/BinaryCollision/BinaryCollisionUtils.cpp +++ b/Source/Particles/Collision/BinaryCollision/BinaryCollisionUtils.cpp @@ -63,7 +63,7 @@ namespace BinaryCollisionUtils{ ||(product_species1.AmIA<PhysicalSpecies::hydrogen1>() && product_species2.AmIA<PhysicalSpecies::hydrogen3>())){ return NuclearFusionType::DeuteriumDeuteriumToProtonTritium; } else { - amrex::Abort("ERROR: Product species of deuterium-deuterium fusion must be of type helium3 and neutron, or tritium and proton"); + WARPX_ABORT_WITH_MESSAGE("ERROR: Product species of deuterium-deuterium fusion must be of type helium3 and neutron, or tritium and proton"); } } else if ((species1.AmIA<PhysicalSpecies::hydrogen2>() && species2.AmIA<PhysicalSpecies::helium3>()) @@ -97,7 +97,7 @@ namespace BinaryCollisionUtils{ "ERROR: Product species of proton-boron fusion must be of type alpha"); return NuclearFusionType::ProtonBoronToAlphas; } - amrex::Abort("Binary nuclear fusion not implemented between species " + + WARPX_ABORT_WITH_MESSAGE("Binary nuclear fusion not implemented between species " + species_names[0] + " of type " + species1.getSpeciesTypeName() + " and species " + species_names[1] + " of type " + species2.getSpeciesTypeName()); @@ -114,7 +114,7 @@ namespace BinaryCollisionUtils{ NuclearFusionType fusion_type = get_nuclear_fusion_type(collision_name, mypc); return nuclear_fusion_type_to_collision_type(fusion_type); } - amrex::Abort(type + " is not a valid type of collision that creates new particles"); + WARPX_ABORT_WITH_MESSAGE(type + " is not a valid type of collision that creates new particles"); return CollisionType::Undefined; } @@ -130,7 +130,7 @@ namespace BinaryCollisionUtils{ return CollisionType::DeuteriumHeliumToProtonHeliumFusion; if (fusion_type == NuclearFusionType::ProtonBoronToAlphas) return CollisionType::ProtonBoronToAlphasFusion; - amrex::Abort("Invalid nuclear fusion type"); + WARPX_ABORT_WITH_MESSAGE("Invalid nuclear fusion type"); return CollisionType::Undefined; } } diff --git a/Source/Particles/Collision/BinaryCollision/NuclearFusion/NuclearFusionFunc.H b/Source/Particles/Collision/BinaryCollision/NuclearFusion/NuclearFusionFunc.H index 2dcbe22e9..c4e769d2c 100644 --- a/Source/Particles/Collision/BinaryCollision/NuclearFusion/NuclearFusionFunc.H +++ b/Source/Particles/Collision/BinaryCollision/NuclearFusion/NuclearFusionFunc.H @@ -59,7 +59,7 @@ public: using namespace amrex::literals; #ifdef AMREX_SINGLE_PRECISION_PARTICLES - amrex::Abort("Nuclear fusion module does not currently work with single precision"); + WARPX_ABORT_WITH_MESSAGE("Nuclear fusion module does not currently work with single precision"); #endif m_fusion_type = BinaryCollisionUtils::get_nuclear_fusion_type(collision_name, mypc); diff --git a/Source/Particles/Collision/BinaryCollision/ParticleCreationFunc.cpp b/Source/Particles/Collision/BinaryCollision/ParticleCreationFunc.cpp index 3b1951107..f1efb9716 100644 --- a/Source/Particles/Collision/BinaryCollision/ParticleCreationFunc.cpp +++ b/Source/Particles/Collision/BinaryCollision/ParticleCreationFunc.cpp @@ -9,6 +9,7 @@ #include "BinaryCollisionUtils.H" #include "Particles/MultiParticleContainer.H" +#include "Utils/TextMsg.H" #include <AMReX_GpuContainers.H> #include <AMReX_ParmParse.H> @@ -49,7 +50,7 @@ ParticleCreationFunc::ParticleCreationFunc (const std::string collision_name, } else { - amrex::Abort("Unknown collision type in ParticleCreationFunc"); + WARPX_ABORT_WITH_MESSAGE("Unknown collision type in ParticleCreationFunc"); } #ifdef AMREX_USE_GPU diff --git a/Source/Particles/Collision/CollisionHandler.cpp b/Source/Particles/Collision/CollisionHandler.cpp index e8f25a78b..a6bcbbf46 100644 --- a/Source/Particles/Collision/CollisionHandler.cpp +++ b/Source/Particles/Collision/CollisionHandler.cpp @@ -58,7 +58,7 @@ CollisionHandler::CollisionHandler(MultiParticleContainer const * const mypc) collision_names[i], mypc); } else{ - amrex::Abort("Unknown collision type."); + WARPX_ABORT_WITH_MESSAGE("Unknown collision type."); } } diff --git a/Source/Particles/Deposition/CurrentDeposition.H b/Source/Particles/Deposition/CurrentDeposition.H index bf5b9e393..a3cb5e21f 100644 --- a/Source/Particles/Deposition/CurrentDeposition.H +++ b/Source/Particles/Deposition/CurrentDeposition.H @@ -12,6 +12,7 @@ #include "ablastr/parallelization/KernelTimer.H" #include "Particles/Pusher/GetAndSetPosition.H" #include "Particles/ShapeFactors.H" +#include "Utils/TextMsg.H" #include "Utils/WarpXAlgorithmSelection.H" #include "Utils/WarpXConst.H" #ifdef WARPX_DIM_RZ @@ -541,7 +542,7 @@ void doDepositionSharedShapeN (const GetParticlePosition& GetPosition, // using HIP/CUDA, and those things are checked prior //don't use any args ignore_unused( GetPosition, wp, uxp, uyp, uzp, ion_lev, jx_fab, jy_fab, jz_fab, np_to_depose, relative_time, dx, xyzmin, lo, q, n_rz_azimuthal_modes, cost, load_balance_costs_update_algo, a_bins, box, geom, a_tbox_max_size); - amrex::Abort("Shared memory only implemented for HIP/CUDA"); + WARPX_ABORT_WITH_MESSAGE("Shared memory only implemented for HIP/CUDA"); #endif } @@ -974,14 +975,14 @@ void doVayDepositionShapeN (const GetParticlePosition& GetPosition, amrex::ignore_unused(GetPosition, wp, uxp, uyp, uzp, ion_lev, Dx_fab, Dy_fab, Dz_fab, np_to_depose, dt, relative_time, dx, xyzmin, lo, q, n_rz_azimuthal_modes); - amrex::Abort("Vay deposition not implemented in RZ geometry"); + WARPX_ABORT_WITH_MESSAGE("Vay deposition not implemented in RZ geometry"); #endif #if defined(WARPX_DIM_1D_Z) amrex::ignore_unused(GetPosition, wp, uxp, uyp, uzp, ion_lev, Dx_fab, Dy_fab, Dz_fab, np_to_depose, dt, relative_time, dx, xyzmin, lo, q, n_rz_azimuthal_modes); - amrex::Abort("Vay deposition not implemented in cartesian 1D geometry"); + WARPX_ABORT_WITH_MESSAGE("Vay deposition not implemented in cartesian 1D geometry"); #endif #if !defined(AMREX_USE_GPU) diff --git a/Source/Particles/ElementaryProcess/QEDInternals/BreitWheelerEngineWrapper.cpp b/Source/Particles/ElementaryProcess/QEDInternals/BreitWheelerEngineWrapper.cpp index 9cc9ba25a..249e35f6f 100644 --- a/Source/Particles/ElementaryProcess/QEDInternals/BreitWheelerEngineWrapper.cpp +++ b/Source/Particles/ElementaryProcess/QEDInternals/BreitWheelerEngineWrapper.cpp @@ -6,6 +6,8 @@ */ #include "BreitWheelerEngineWrapper.H" +#include "Utils/TextMsg.H" + #include <AMReX.H> #include <AMReX_BLassert.H> #include <AMReX_GpuDevice.H> @@ -153,7 +155,7 @@ void BreitWheelerEngine::compute_lookup_tables ( m_lookup_tables_initialized = true; #else amrex::ignore_unused(ctrl, bw_minimum_chi_phot); - amrex::Abort("WarpX was not compiled with table generation support!"); + WARPX_ABORT_WITH_MESSAGE("WarpX was not compiled with table generation support!"); #endif } diff --git a/Source/Particles/ElementaryProcess/QEDInternals/QuantumSyncEngineWrapper.cpp b/Source/Particles/ElementaryProcess/QEDInternals/QuantumSyncEngineWrapper.cpp index 3bb02f27e..280c1cfd4 100644 --- a/Source/Particles/ElementaryProcess/QEDInternals/QuantumSyncEngineWrapper.cpp +++ b/Source/Particles/ElementaryProcess/QEDInternals/QuantumSyncEngineWrapper.cpp @@ -6,6 +6,8 @@ */ #include "QuantumSyncEngineWrapper.H" +#include "Utils/TextMsg.H" + #include <AMReX.H> #include <AMReX_BLassert.H> #include <AMReX_GpuDevice.H> @@ -152,7 +154,7 @@ void QuantumSynchrotronEngine::compute_lookup_tables ( m_lookup_tables_initialized = true; #else amrex::ignore_unused(ctrl, qs_minimum_chi_part); - amrex::Abort("WarpX was not compiled with table generation support!"); + WARPX_ABORT_WITH_MESSAGE("WarpX was not compiled with table generation support!"); #endif } diff --git a/Source/Particles/ElementaryProcess/QEDSchwingerProcess.H b/Source/Particles/ElementaryProcess/QEDSchwingerProcess.H index 53f515d06..cab63b967 100644 --- a/Source/Particles/ElementaryProcess/QEDSchwingerProcess.H +++ b/Source/Particles/ElementaryProcess/QEDSchwingerProcess.H @@ -9,6 +9,7 @@ #define QED_SCHWINGER_PROCESS_H_ #include "Particles/ElementaryProcess/QEDInternals/SchwingerProcessWrapper.H" +#include "Utils/TextMsg.H" /** * This structure is a functor which calls getSchwingerProductionNumber to @@ -82,7 +83,7 @@ struct SchwingerTransformFunc for (int n = 0; n < N; ++n){ #if defined(WARPX_DIM_1D_Z) amrex::ignore_unused(dst1, dst2, i_dst1, i_dst2, N, total_weight); - amrex::Abort("SchwingerTransformFunc not implemented in 1D"); + WARPX_ABORT_WITH_MESSAGE("SchwingerTransformFunc not implemented in 1D"); #elif defined(WARPX_DIM_3D) dst1.m_rdata[m_weight_index][i_dst1+n] = total_weight/N; dst2.m_rdata[m_weight_index][i_dst2+n] = total_weight/N; diff --git a/Source/Particles/LaserParticleContainer.cpp b/Source/Particles/LaserParticleContainer.cpp index fbf61d579..8221683c1 100644 --- a/Source/Particles/LaserParticleContainer.cpp +++ b/Source/Particles/LaserParticleContainer.cpp @@ -158,7 +158,7 @@ LaserParticleContainer::LaserParticleContainer (AmrCore* amr_core, int ispecies, //Check if profile exists if(laser_profiles_dictionary.count(laser_type_s) == 0 ){ - amrex::Abort(std::string("Unknown laser type: ").append(laser_type_s)); + WARPX_ABORT_WITH_MESSAGE(std::string("Unknown laser type: ").append(laser_type_s)); } m_up_laser_profile = laser_profiles_dictionary.at(laser_type_s)(); //__________ diff --git a/Source/Particles/MultiParticleContainer.cpp b/Source/Particles/MultiParticleContainer.cpp index e397d1aa8..f0f416b60 100644 --- a/Source/Particles/MultiParticleContainer.cpp +++ b/Source/Particles/MultiParticleContainer.cpp @@ -33,6 +33,7 @@ #include "Particles/WarpXParticleContainer.H" #include "SpeciesPhysicalProperties.H" #include "Utils/Parser/ParserUtils.H" +#include "Utils/TextMsg.H" #include "Utils/WarpXAlgorithmSelection.H" #include "Utils/WarpXProfilerWrapper.H" #include "Utils/WarpXUtil.H" @@ -1031,7 +1032,7 @@ void MultiParticleContainer::InitQuantumSync () pp_qed_qs.query("lookup_table_mode", lookup_table_mode); if(lookup_table_mode.empty()){ - amrex::Abort("Quantum Synchrotron table mode should be provided"); + WARPX_ABORT_WITH_MESSAGE("Quantum Synchrotron table mode should be provided"); } if(lookup_table_mode == "generate"){ @@ -1039,7 +1040,7 @@ void MultiParticleContainer::InitQuantumSync () "A new Quantum Synchrotron table will be generated.", ablastr::warn_manager::WarnPriority::low); #ifndef WARPX_QED_TABLE_GEN - amrex::Error("Error: Compile with QED_TABLE_GEN=TRUE to enable table generation!\n"); + WARPX_ABORT_WITH_MESSAGE("Error: Compile with QED_TABLE_GEN=TRUE to enable table generation!\n"); #else QuantumSyncGenerateTable(); #endif @@ -1051,7 +1052,7 @@ void MultiParticleContainer::InitQuantumSync () "The Quantum Synchrotron table will be read from the file: " + load_table_name, ablastr::warn_manager::WarnPriority::low); if(load_table_name.empty()){ - amrex::Abort("Quantum Synchrotron table name should be provided"); + WARPX_ABORT_WITH_MESSAGE("Quantum Synchrotron table name should be provided"); } Vector<char> table_data; ParallelDescriptor::ReadAndBcastFile(load_table_name, table_data); @@ -1067,12 +1068,12 @@ void MultiParticleContainer::InitQuantumSync () m_shr_p_qs_engine->init_builtin_tables(qs_minimum_chi_part); } else{ - amrex::Abort("Unknown Quantum Synchrotron table mode"); + WARPX_ABORT_WITH_MESSAGE("Unknown Quantum Synchrotron table mode"); } - if(!m_shr_p_qs_engine->are_lookup_tables_initialized()){ - amrex::Abort("Table initialization has failed!"); - } + WARPX_ALWAYS_ASSERT_WITH_MESSAGE( + m_shr_p_qs_engine->are_lookup_tables_initialized(), + "Table initialization has failed!"); } void MultiParticleContainer::InitBreitWheeler () @@ -1085,11 +1086,11 @@ void MultiParticleContainer::InitBreitWheeler () // the optical depth is not evolved and photon generation is ignored amrex::Real bw_minimum_chi_part; if(!utils::parser::queryWithParser(pp_qed_bw, "chi_min", bw_minimum_chi_part)) - amrex::Abort("qed_bw.chi_min should be provided!"); + WARPX_ABORT_WITH_MESSAGE("qed_bw.chi_min should be provided!"); pp_qed_bw.query("lookup_table_mode", lookup_table_mode); if(lookup_table_mode.empty()){ - amrex::Abort("Breit Wheeler table mode should be provided"); + WARPX_ABORT_WITH_MESSAGE("Breit Wheeler table mode should be provided"); } if(lookup_table_mode == "generate"){ @@ -1109,7 +1110,7 @@ void MultiParticleContainer::InitBreitWheeler () "The Breit Wheeler table will be read from the file:" + load_table_name, ablastr::warn_manager::WarnPriority::low); if(load_table_name.empty()){ - amrex::Abort("Breit Wheeler table name should be provided"); + WARPX_ABORT_WITH_MESSAGE("Breit Wheeler table name should be provided"); } Vector<char> table_data; ParallelDescriptor::ReadAndBcastFile(load_table_name, table_data); @@ -1125,12 +1126,12 @@ void MultiParticleContainer::InitBreitWheeler () m_shr_p_bw_engine->init_builtin_tables(bw_minimum_chi_part); } else{ - amrex::Abort("Unknown Breit Wheeler table mode"); + WARPX_ABORT_WITH_MESSAGE("Unknown Breit Wheeler table mode"); } - if(!m_shr_p_bw_engine->are_lookup_tables_initialized()){ - amrex::Abort("Table initialization has failed!"); - } + WARPX_ALWAYS_ASSERT_WITH_MESSAGE( + m_shr_p_bw_engine->are_lookup_tables_initialized(), + "Table initialization has failed!"); } void @@ -1139,8 +1140,9 @@ MultiParticleContainer::QuantumSyncGenerateTable () ParmParse pp_qed_qs("qed_qs"); std::string table_name; pp_qed_qs.query("save_table_in", table_name); - if(table_name.empty()) - amrex::Abort("qed_qs.save_table_in should be provided!"); + WARPX_ALWAYS_ASSERT_WITH_MESSAGE( + !table_name.empty(), + "qed_qs.save_table_in should be provided!"); // qs_minimum_chi_part is the minimum chi parameter to be // considered for Synchrotron emission. If a lepton has chi < chi_min, @@ -1228,8 +1230,9 @@ MultiParticleContainer::BreitWheelerGenerateTable () ParmParse pp_qed_bw("qed_bw"); std::string table_name; pp_qed_bw.query("save_table_in", table_name); - if(table_name.empty()) - amrex::Abort("qed_bw.save_table_in should be provided!"); + WARPX_ALWAYS_ASSERT_WITH_MESSAGE( + !table_name.empty(), + "qed_bw.save_table_in should be provided!"); // bw_minimum_chi_phot is the minimum chi parameter to be // considered for pair production. If a photon has chi < chi_min, @@ -1326,10 +1329,10 @@ MultiParticleContainer::doQEDSchwinger () "ERROR: Schwinger process not implemented with mesh refinement"); #ifdef WARPX_DIM_RZ - amrex::Abort("Schwinger process not implemented in rz geometry"); + WARPX_ABORT_WITH_MESSAGE("Schwinger process not implemented in rz geometry"); #endif #ifdef WARPX_DIM_1D_Z - amrex::Abort("Schwinger process not implemented in 1D geometry"); + WARPX_ABORT_WITH_MESSAGE("Schwinger process not implemented in 1D geometry"); #endif // Get cell volume. In 2D the transverse size is diff --git a/Source/Particles/PhysicalParticleContainer.cpp b/Source/Particles/PhysicalParticleContainer.cpp index 0c9b7ce69..60a5afbeb 100644 --- a/Source/Particles/PhysicalParticleContainer.cpp +++ b/Source/Particles/PhysicalParticleContainer.cpp @@ -375,13 +375,13 @@ PhysicalParticleContainer::BackwardCompatibility () ParmParse pp_species_name(species_name); std::vector<std::string> backward_strings; if (pp_species_name.queryarr("plot_vars", backward_strings)){ - amrex::Abort("<species>.plot_vars is not supported anymore. " + WARPX_ABORT_WITH_MESSAGE("<species>.plot_vars is not supported anymore. " "Please use the new syntax for diagnostics, see documentation."); } int backward_int; if (pp_species_name.query("plot_species", backward_int)){ - amrex::Abort("<species>.plot_species is not supported anymore. " + WARPX_ABORT_WITH_MESSAGE("<species>.plot_species is not supported anymore. " "Please use the new syntax for diagnostics, see documentation."); } } diff --git a/Source/Particles/Resampling/Resampling.cpp b/Source/Particles/Resampling/Resampling.cpp index 2034f291c..66bff5ac5 100644 --- a/Source/Particles/Resampling/Resampling.cpp +++ b/Source/Particles/Resampling/Resampling.cpp @@ -7,6 +7,7 @@ #include "Resampling.H" #include "LevelingThinning.H" +#include "Utils/TextMsg.H" #include <AMReX.H> #include <AMReX_ParmParse.H> @@ -22,7 +23,7 @@ Resampling::Resampling (const std::string species_name) m_resampling_algorithm = std::make_unique<LevelingThinning>(species_name); } else - { amrex::Abort("Unknown resampling algorithm."); } + { WARPX_ABORT_WITH_MESSAGE("Unknown resampling algorithm."); } m_resampling_trigger = ResamplingTrigger(species_name); } diff --git a/Source/Particles/ShapeFactors.H b/Source/Particles/ShapeFactors.H index 647e48cf8..60e54b5d5 100644 --- a/Source/Particles/ShapeFactors.H +++ b/Source/Particles/ShapeFactors.H @@ -7,6 +7,8 @@ #ifndef SHAPEFACTORS_H_ #define SHAPEFACTORS_H_ +#include "Utils/TextMsg.H" + #include <AMReX.H> #include <AMReX_GpuQualifiers.H> @@ -63,7 +65,7 @@ struct Compute_shape_factor return j-1; } else{ - amrex::Abort("Unknown particle shape selected in Compute_shape_factor"); + WARPX_ABORT_WITH_MESSAGE("Unknown particle shape selected in Compute_shape_factor"); amrex::ignore_unused(sx, xmid); } return 0; @@ -117,7 +119,7 @@ struct Compute_shifted_shape_factor return i - 1; } else{ - amrex::Abort("Unknown particle shape selected in Compute_shifted_shape_factor"); + WARPX_ABORT_WITH_MESSAGE("Unknown particle shape selected in Compute_shifted_shape_factor"); amrex::ignore_unused(sx, x_old, i_new); } return 0; diff --git a/Source/Particles/WarpXParticleContainer.cpp b/Source/Particles/WarpXParticleContainer.cpp index b6e33180a..87bbff624 100644 --- a/Source/Particles/WarpXParticleContainer.cpp +++ b/Source/Particles/WarpXParticleContainer.cpp @@ -445,7 +445,7 @@ WarpXParticleContainer::DepositCurrent (WarpXParIter& pti, if (WarpX::current_deposition_algo == CurrentDepositionAlgo::Esirkepov) { if (WarpX::grid_type == GridType::Collocated) { - amrex::Abort("The Esirkepov algorithm cannot be used with a collocated grid."); + WARPX_ABORT_WITH_MESSAGE("The Esirkepov algorithm cannot be used with a collocated grid."); } } @@ -503,10 +503,10 @@ WarpXParticleContainer::DepositCurrent (WarpXParIter& pti, // Now pick current deposition algorithm if (WarpX::current_deposition_algo == CurrentDepositionAlgo::Esirkepov) { - amrex::Abort("Cannot do shared memory deposition with Esirkepov algorithm"); + WARPX_ABORT_WITH_MESSAGE("Cannot do shared memory deposition with Esirkepov algorithm"); } else if (WarpX::current_deposition_algo == CurrentDepositionAlgo::Vay) { - amrex::Abort("Cannot do shared memory deposition with Vay algorithm"); + WARPX_ABORT_WITH_MESSAGE("Cannot do shared memory deposition with Vay algorithm"); } else { WARPX_PROFILE_VAR_START(direct_current_dep_kernel); diff --git a/Source/Utils/Interpolate.cpp b/Source/Utils/Interpolate.cpp index 9d20e7485..67781fae6 100644 --- a/Source/Utils/Interpolate.cpp +++ b/Source/Utils/Interpolate.cpp @@ -1,6 +1,8 @@ #include "Interpolate.H" #include "Interpolate_K.H" +#include "Utils/TextMsg.H" + #include <AMReX.H> #include <AMReX_Array4.H> #include <AMReX_BCRec.H> @@ -53,7 +55,7 @@ namespace Interpolate node_bilinear_interp.interp(cfab, 0, ffab, 0, 1, finebx, refinement_vector, {}, {}, {}, 0, 0, RunOn::Device); } else { - amrex::Abort("Unknown field staggering."); + WARPX_ABORT_WITH_MESSAGE("Unknown field staggering."); } // Add temporary array to the returned structure diff --git a/Source/Utils/WarpXAlgorithmSelection.cpp b/Source/Utils/WarpXAlgorithmSelection.cpp index 99c068fc0..cbe1deee3 100644 --- a/Source/Utils/WarpXAlgorithmSelection.cpp +++ b/Source/Utils/WarpXAlgorithmSelection.cpp @@ -8,6 +8,7 @@ */ #include "WarpX.H" #include "WarpXAlgorithmSelection.H" +#include "Utils/TextMsg.H" #include <AMReX.H> @@ -177,7 +178,7 @@ GetAlgorithmInteger( amrex::ParmParse& pp, const char* pp_search_key ){ algo_to_int = ReductionType_algo_to_int; } else { std::string pp_search_string = pp_search_key; - amrex::Abort("Unknown algorithm type: " + pp_search_string); + WARPX_ABORT_WITH_MESSAGE("Unknown algorithm type: " + pp_search_string); } // Check if the user-input is a valid key for the dictionary @@ -191,7 +192,7 @@ GetAlgorithmInteger( amrex::ParmParse& pp, const char* pp_search_key ){ error_message += " - " + valid_pair.first + "\n"; } } - amrex::Abort(error_message); + WARPX_ABORT_WITH_MESSAGE(error_message); } // If the input is a valid key, return the value @@ -209,7 +210,7 @@ GetFieldBCTypeInteger( std::string BCType ){ error_message += " - " + valid_pair.first + "\n"; } } - amrex::Abort(error_message); + WARPX_ABORT_WITH_MESSAGE(error_message); } // return FieldBCType_algo_to_int[BCType]; // This operator cannot be used for a const map return FieldBCType_algo_to_int.at(BCType); @@ -226,7 +227,7 @@ GetParticleBCTypeInteger( std::string BCType ){ error_message += " - " + valid_pair.first + "\n"; } } - amrex::Abort(error_message); + WARPX_ABORT_WITH_MESSAGE(error_message); } // return ParticleBCType_algo_to_enum[BCType]; // This operator cannot be used for a const map return ParticleBCType_algo_to_enum.at(BCType); diff --git a/Source/ablastr/particles/NodalFieldGather.H b/Source/ablastr/particles/NodalFieldGather.H index 53c329604..5fabc36bd 100644 --- a/Source/ablastr/particles/NodalFieldGather.H +++ b/Source/ablastr/particles/NodalFieldGather.H @@ -7,13 +7,14 @@ #ifndef ABLASTR_NODALFIELDGATHER_H_ #define ABLASTR_NODALFIELDGATHER_H_ +#include "ablastr/utils/TextMsg.H" + #include <AMReX_Array.H> #include <AMReX_Extension.H> #include <AMReX_GpuQualifiers.H> #include <AMReX_Math.H> #include <AMReX_REAL.H> - namespace ablastr::particles { /** @@ -77,7 +78,7 @@ void compute_weights_nodal (const amrex::ParticleReal xp, k = 0; #else amrex::ignore_unused(xp, yp, zp, plo, dxi, i, j, k, W); - amrex::Abort("Error: compute_weights not yet implemented in 1D"); + ABLASTR_ABORT_WITH_MESSAGE("Error: compute_weights not yet implemented in 1D"); #endif } @@ -110,7 +111,7 @@ amrex::Real interp_field_nodal (int i, int j, int k, value += scalar_field(i+1, j+1, k) * W[0][1] * W[1][1]; #else amrex::ignore_unused(i, j, k, W, scalar_field); - amrex::Abort("Error: interp_field not yet implemented in 1D"); + ABLASTR_ABORT_WITH_MESSAGE("Error: interp_field not yet implemented in 1D"); #endif return value; } |