From f976d3d1fe3827609f1efad5823000345de10ea2 Mon Sep 17 00:00:00 2001 From: Maxence Thevenet Date: Tue, 25 May 2021 10:38:38 +0200 Subject: [PATCH] check that the density is >0 --- src/particles/MultiPlasma.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/particles/MultiPlasma.cpp b/src/particles/MultiPlasma.cpp index c8cc09b959..243d33485b 100644 --- a/src/particles/MultiPlasma.cpp +++ b/src/particles/MultiPlasma.cpp @@ -43,10 +43,11 @@ MultiPlasma::InitData (int lev, amrex::BoxArray slice_ba, amrex::Real MultiPlasma::maxDensity () { - amrex::Real max_density = 0; + amrex::Real max_density = 0.; for (auto& plasma : m_all_plasmas) { max_density = amrex::max(max_density, plasma.m_density); } + AMREX_ALWAYS_ASSERT(max_density>0.); return amrex::max(max_density, m_adaptive_density); }