diff --git a/src/FEM/LagrangeSpace.hpp b/src/FEM/LagrangeSpace.hpp index b1743cd4f..04d1e15fd 100644 --- a/src/FEM/LagrangeSpace.hpp +++ b/src/FEM/LagrangeSpace.hpp @@ -1417,7 +1417,7 @@ namespace ippl { }); temp_field.accumulateHalo(); - if ((bcType == PERIODIC_FACE) || (bcType == CONSTANT_FACE)) { + if (bcType == PERIODIC_FACE) { bcField.apply(temp_field); bcField.assignGhostToPhysical(temp_field); } diff --git a/src/PoissonSolvers/FEMPoissonSolver.h b/src/PoissonSolvers/FEMPoissonSolver.h index 8c183a6ea..6fd2a14ce 100644 --- a/src/PoissonSolvers/FEMPoissonSolver.h +++ b/src/PoissonSolvers/FEMPoissonSolver.h @@ -125,6 +125,11 @@ namespace ippl { // send boundary values to RHS (load vector) i.e. lifting (Dirichlet BCs) if (bcType == CONSTANT_FACE) { + // Set per-face Dirichlet values on physical boundary nodes before halo exchange; + // fillHalo must see the correct boundary state after load vector assembly. + bcField.apply(*(this->rhs_mp)); + bcField.assignGhostToPhysical(*(this->rhs_mp)); + this->rhs_mp->fillHalo(); *(this->rhs_mp) = *(this->rhs_mp) - lagrangeSpace_m.evaluateAx_lift(*(this->rhs_mp), poissonEquationEval); diff --git a/src/PoissonSolvers/PreconditionedFEMPoissonSolver.h b/src/PoissonSolvers/PreconditionedFEMPoissonSolver.h index 3b6c563ad..f0f4a5610 100644 --- a/src/PoissonSolvers/PreconditionedFEMPoissonSolver.h +++ b/src/PoissonSolvers/PreconditionedFEMPoissonSolver.h @@ -206,6 +206,11 @@ namespace ippl { // send boundary values to RHS (load vector) i.e. lifting (Dirichlet BCs) if (bcType == CONSTANT_FACE) { + // Set per-face Dirichlet values on physical boundary nodes before halo exchange; + // fillHalo must see the correct boundary state after load vector assembly. + bcField.apply(*(this->rhs_mp)); + bcField.assignGhostToPhysical(*(this->rhs_mp)); + this->rhs_mp->fillHalo(); *(this->rhs_mp) = *(this->rhs_mp) - lagrangeSpace_m.evaluateAx_lift(*(this->rhs_mp), poissonEquationEval);