From 0a64c2b8a42d766e5a893fcab2d4573b33cca74f Mon Sep 17 00:00:00 2001 From: Luca Fedeli Date: Tue, 8 Mar 2022 18:38:25 +0100 Subject: Make error and info messages visually uniform (#2939) * initial work to add msg formatter * wip * replace AMREX_ALWAYS_ASSERT_WITH_MESSAGE with WarpX equivalent --- Source/FieldSolver/SpectralSolver/SpectralKSpace.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'Source/FieldSolver/SpectralSolver/SpectralKSpace.cpp') diff --git a/Source/FieldSolver/SpectralSolver/SpectralKSpace.cpp b/Source/FieldSolver/SpectralSolver/SpectralKSpace.cpp index 6d31116b6..ca26682a9 100644 --- a/Source/FieldSolver/SpectralSolver/SpectralKSpace.cpp +++ b/Source/FieldSolver/SpectralSolver/SpectralKSpace.cpp @@ -7,6 +7,7 @@ */ #include "SpectralKSpace.H" +#include "Utils/TextMsg.H" #include "Utils/WarpXConst.H" #include @@ -38,7 +39,7 @@ SpectralKSpace::SpectralKSpace( const BoxArray& realspace_ba, const RealVect realspace_dx ) : dx(realspace_dx) // Store the cell size as member `dx` { - AMREX_ALWAYS_ASSERT_WITH_MESSAGE( + WARPX_ALWAYS_ASSERT_WITH_MESSAGE( realspace_ba.ixType()==IndexType::TheCellType(), "SpectralKSpace expects a cell-centered box."); @@ -104,9 +105,9 @@ SpectralKSpace::getKComponent( const DistributionMapping& dm, // Fill the k vector IntVect fft_size = realspace_ba[mfi].length(); const Real dk = 2*MathConst::pi/(fft_size[i_dim]*dx[i_dim]); - AMREX_ALWAYS_ASSERT_WITH_MESSAGE( bx.smallEnd(i_dim) == 0, + WARPX_ALWAYS_ASSERT_WITH_MESSAGE( bx.smallEnd(i_dim) == 0, "Expected box to start at 0, in spectral space."); - AMREX_ALWAYS_ASSERT_WITH_MESSAGE( bx.bigEnd(i_dim) == N-1, + WARPX_ALWAYS_ASSERT_WITH_MESSAGE( bx.bigEnd(i_dim) == N-1, "Expected different box end index in spectral space."); if (only_positive_k){ // Fill the full axis with positive k values @@ -280,7 +281,7 @@ SpectralKSpace::getModifiedKComponent( const DistributionMapping& dm, Vector getFornbergStencilCoefficients(const int n_order, const bool nodal) { - AMREX_ALWAYS_ASSERT_WITH_MESSAGE(n_order % 2 == 0, "n_order must be even"); + WARPX_ALWAYS_ASSERT_WITH_MESSAGE(n_order % 2 == 0, "n_order must be even"); const int m = n_order / 2; Vector coefs; -- cgit v1.2.3