From 06e6d264d2c48dbd6b79db1c699ec971fb4d7dfd Mon Sep 17 00:00:00 2001 From: mayani_s Date: Tue, 17 Feb 2026 17:20:08 +0100 Subject: [PATCH] put the fields which are algorithm dependent into conditionals - otherwise setting to 0 a field which was not initialized --- src/PoissonSolvers/FFTOpenPoissonSolver.hpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/PoissonSolvers/FFTOpenPoissonSolver.hpp b/src/PoissonSolvers/FFTOpenPoissonSolver.hpp index 57e69e50a..bd8ceec80 100644 --- a/src/PoissonSolvers/FFTOpenPoissonSolver.hpp +++ b/src/PoissonSolvers/FFTOpenPoissonSolver.hpp @@ -475,8 +475,12 @@ namespace ippl { rho2_mr = 0.0; rho2tr_m = 0.0; - grnL_m = 0.0; - grn2n1_m = 0.0; + if (alg == Algorithm::VICO || alg == Algorithm::BIHARMONIC) { + grnL_m = 0.0; + } + if (alg == Algorithm::DCT_VICO) { + grn2n1_m = 0.0; + } // call greensFunction and we will get the transformed G in the class attribute // this is done in initialization so that we already have the precomputed fct