From 54c163bacc7f47afde5138d05ef8ff1505b348f8 Mon Sep 17 00:00:00 2001 From: Jochem Snuverink <jochem.snuverink@psi.ch> Date: Thu, 6 Aug 2020 12:08:12 +0200 Subject: [PATCH] replace BL_ASSERT with PAssert --- src/Amr/AmrBoxLib.cpp | 5 +++-- src/Amr/BoxLibLayout.hpp | 19 ++++++++++--------- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/src/Amr/AmrBoxLib.cpp b/src/Amr/AmrBoxLib.cpp index f5a985c73..06d1e292e 100644 --- a/src/Amr/AmrBoxLib.cpp +++ b/src/Amr/AmrBoxLib.cpp @@ -27,9 +27,10 @@ #include "Algorithms/AmrPartBunch.h" #include "Structure/FieldSolver.h" #include "Solvers/PoissonSolver.h" +#include "Utility/PAssert.h" #include "Amr/AmrYtWriter.h" - + #include <AMReX_MultiFabUtil.H> #include <AMReX_ParmParse.H> // used in initialize function @@ -721,7 +722,7 @@ void AmrBoxLib::doRegrid_m(int lbase, double time) { MakeNewGrids(lbase, time, new_finest, new_grids); - BL_ASSERT(new_finest <= finest_level+1); + PAssert(new_finest <= finest_level+1); for (int lev = lbase+1; lev <= new_finest; ++lev) { diff --git a/src/Amr/BoxLibLayout.hpp b/src/Amr/BoxLibLayout.hpp index 01d3e048d..82e4f28fc 100644 --- a/src/Amr/BoxLibLayout.hpp +++ b/src/Amr/BoxLibLayout.hpp @@ -39,6 +39,7 @@ #include "BoxLibLayout.h" #include "Message/Formatter.h" +#include "Utility/PAssert.h" #include "Utilities/OpalException.h" #include <cmath> @@ -472,7 +473,7 @@ void BoxLibLayout<T, Dim>::buildLevelMask(int lev, const int ncells) { template <class T, unsigned Dim> void BoxLibLayout<T, Dim>::clearLevelMask(int lev) { - BL_ASSERT(lev < (int)masks_m.size()); + PAssert(lev < (int)masks_m.size()); masks_m[lev].reset(nullptr); } @@ -547,9 +548,9 @@ bool BoxLibLayout<T, Dim>::Where(AmrParticleBase< BoxLibLayout<T,Dim> >& p, if (lev_max == -1) lev_max = finestLevel(); - BL_ASSERT(lev_max <= finestLevel()); + PAssert(lev_max <= finestLevel()); - BL_ASSERT(nGrow == 0 || (nGrow >= 0 && lev_min == lev_max)); + PAssert(nGrow == 0 || (nGrow >= 0 && lev_min == lev_max)); std::vector< std::pair<int, AmrBox_t> > isects; @@ -557,7 +558,7 @@ bool BoxLibLayout<T, Dim>::Where(AmrParticleBase< BoxLibLayout<T,Dim> >& p, { const AmrIntVect_t& iv = Index(p, ip, lev); const AmrGrid_t& ba = ParticleBoxArray(lev); - BL_ASSERT(ba.ixType().cellCentered()); + PAssert(ba.ixType().cellCentered()); if (lev == (int)p.Level[ip]) { // The fact that we are here means this particle does not belong to any finer grids. @@ -604,7 +605,7 @@ bool BoxLibLayout<T, Dim>::EnforcePeriodicWhere (AmrParticleBase< BoxLibLayout<T if (lev_max == -1) lev_max = finestLevel(); - BL_ASSERT(lev_max <= finestLevel()); + PAssert(lev_max <= finestLevel()); // // Create a copy "dummy" particle to check for periodic outs. // @@ -677,7 +678,7 @@ bool BoxLibLayout<T, Dim>::PeriodicShift (SingleParticlePos_t R) const // R[i] += .125*geom.CellSize(i); - BL_ASSERT(R[i] >= geom.ProbLo(i)); + PAssert(R[i] >= geom.ProbLo(i)); shifted = true; } @@ -699,7 +700,7 @@ bool BoxLibLayout<T, Dim>::PeriodicShift (SingleParticlePos_t R) const // R[i] -= .125*geom.CellSize(i); - BL_ASSERT(R[i] <= geom.ProbHi(i)); + PAssert(R[i] <= geom.ProbHi(i)); shifted = true; } @@ -809,8 +810,8 @@ void BoxLibLayout<T, Dim>::initBaseBox_m(int nGridPoints, AmrDomain_t real_box; for (int d = 0; d < AMREX_SPACEDIM; ++d) { - BL_ASSERT(lowerBound[d] < 0); - BL_ASSERT(upperBound[d] > 0); + PAssert(lowerBound[d] < 0); + PAssert(upperBound[d] > 0); real_box.setLo(d, lowerBound[d] * (1.0 + dh)); real_box.setHi(d, upperBound[d] * (1.0 + dh)); -- GitLab