From 6191e2d535c1104b52e5da883dc114cfb6f8505e Mon Sep 17 00:00:00 2001 From: zhi Date: Wed, 20 Nov 2024 14:42:22 -0500 Subject: [PATCH] make coverity happy --- Source/driver/Castro.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/Source/driver/Castro.cpp b/Source/driver/Castro.cpp index 0133c68bfe..a3ceec8f8a 100644 --- a/Source/driver/Castro.cpp +++ b/Source/driver/Castro.cpp @@ -851,12 +851,13 @@ Castro::buildMetrics () dLogArea[dir].clear(); geom.GetDLogA(dLogArea[dir],grids,dmap,dir,NUM_GROW); } - for (int dir = AMREX_SPACEDIM; dir < 2; dir++) - { - dLogArea[dir].clear(); - dLogArea[dir].define(grids, dmap, 1, 0); - dLogArea[dir].setVal(0.0); - } + +#if (AMREX_SPACEDIM == 1) + dLogArea[1].clear(); + dLogArea[1].define(grids, dmap, 1, 0); + dLogArea[1].setVal(0.0); +#endif + #endif wall_time_start = 0.0;