From 9570dfb386e43f8c3943541ae54d7fe66d5e44a5 Mon Sep 17 00:00:00 2001 From: Gabriel Robert-Dautun Date: Wed, 8 Oct 2025 15:33:02 +0200 Subject: [PATCH 1/2] initialized to {0._rt} all arrays concerned --- Source/Particles/Gather/FieldGather.H | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Source/Particles/Gather/FieldGather.H b/Source/Particles/Gather/FieldGather.H index 5aece69ff01..e6751d878a3 100644 --- a/Source/Particles/Gather/FieldGather.H +++ b/Source/Particles/Gather/FieldGather.H @@ -443,8 +443,8 @@ void doGatherShapeN ([[maybe_unused]] const amrex::ParticleReal xp, const amrex::Real y = (yp-xyzmin.y)*dinv.y; amrex::Real sy_node[depos_order + 1]; amrex::Real sy_cell[depos_order + 1]; - amrex::Real sy_node_v[depos_order + 1 - galerkin_interpolation]; - amrex::Real sy_cell_v[depos_order + 1 - galerkin_interpolation]; + amrex::Real sy_node_v[depos_order + 1 - galerkin_interpolation] = {0._rt}; + amrex::Real sy_cell_v[depos_order + 1 - galerkin_interpolation] = {0._rt}; int k_node = 0; int k_cell = 0; int k_node_v = 0; @@ -481,8 +481,8 @@ void doGatherShapeN ([[maybe_unused]] const amrex::ParticleReal xp, const amrex::Real z = (zp-xyzmin.z)*dinv.z; amrex::Real sz_node[depos_order + 1]; amrex::Real sz_cell[depos_order + 1]; - amrex::Real sz_node_v[depos_order + 1 - galerkin_interpolation]; - amrex::Real sz_cell_v[depos_order + 1 - galerkin_interpolation]; + amrex::Real sz_node_v[depos_order + 1 - galerkin_interpolation] = {0._rt}; + amrex::Real sz_cell_v[depos_order + 1 - galerkin_interpolation] = {0._rt}; int l_node = 0; int l_cell = 0; int l_node_v = 0; From d9d42b3cadd2ed5334be74b03f472e4f3bf53f6b Mon Sep 17 00:00:00 2001 From: Gabriel Robert-Dautun Date: Wed, 8 Oct 2025 16:25:39 +0200 Subject: [PATCH 2/2] initialising everything to be sure --- Source/Particles/Gather/FieldGather.H | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Source/Particles/Gather/FieldGather.H b/Source/Particles/Gather/FieldGather.H index e6751d878a3..e11b394905e 100644 --- a/Source/Particles/Gather/FieldGather.H +++ b/Source/Particles/Gather/FieldGather.H @@ -403,8 +403,8 @@ void doGatherShapeN ([[maybe_unused]] const amrex::ParticleReal xp, // sx_[eb][xyz] shape factor along x for the centering of each current // There are only two possible centerings, node or cell centered, so at most only two shape factor // arrays will be needed. - amrex::Real sx_node[depos_order + 1]; - amrex::Real sx_cell[depos_order + 1]; + amrex::Real sx_node[depos_order + 1] = {0._rt}; + amrex::Real sx_cell[depos_order + 1] = {0._rt}; amrex::Real sx_node_galerkin[depos_order + 1 - galerkin_interpolation] = {0._rt}; amrex::Real sx_cell_galerkin[depos_order + 1 - galerkin_interpolation] = {0._rt}; @@ -441,8 +441,8 @@ void doGatherShapeN ([[maybe_unused]] const amrex::ParticleReal xp, #if defined(WARPX_DIM_3D) // y direction const amrex::Real y = (yp-xyzmin.y)*dinv.y; - amrex::Real sy_node[depos_order + 1]; - amrex::Real sy_cell[depos_order + 1]; + amrex::Real sy_node[depos_order + 1] = {0._rt}; + amrex::Real sy_cell[depos_order + 1] = {0._rt}; amrex::Real sy_node_v[depos_order + 1 - galerkin_interpolation] = {0._rt}; amrex::Real sy_cell_v[depos_order + 1 - galerkin_interpolation] = {0._rt}; int k_node = 0; @@ -479,8 +479,8 @@ void doGatherShapeN ([[maybe_unused]] const amrex::ParticleReal xp, #if !defined(WARPX_DIM_RCYLINDER) && !defined(WARPX_DIM_RSPHERE) // z direction const amrex::Real z = (zp-xyzmin.z)*dinv.z; - amrex::Real sz_node[depos_order + 1]; - amrex::Real sz_cell[depos_order + 1]; + amrex::Real sz_node[depos_order + 1] = {0._rt}; + amrex::Real sz_cell[depos_order + 1] = {0._rt}; amrex::Real sz_node_v[depos_order + 1 - galerkin_interpolation] = {0._rt}; amrex::Real sz_cell_v[depos_order + 1 - galerkin_interpolation] = {0._rt}; int l_node = 0;