diff options
author | 2023-07-31 23:58:08 +0200 | |
---|---|---|
committer | 2023-07-31 14:58:08 -0700 | |
commit | acf015f95243a063b74e095a9a9890d483fb842c (patch) | |
tree | 22881fd2bc562e61b45d8840bc5938e41dec8cc0 /Source/FieldSolver/ElectrostaticSolver.cpp | |
parent | fc598a552025ce6e6f460ebf360e87545f60cd3d (diff) | |
download | WarpX-acf015f95243a063b74e095a9a9890d483fb842c.tar.gz WarpX-acf015f95243a063b74e095a9a9890d483fb842c.tar.zst WarpX-acf015f95243a063b74e095a9a9890d483fb842c.zip |
remove WarpX::GetInstance() from PoissonBoundaryHandler::definePhiBCs (#4130)
Diffstat (limited to '')
-rw-r--r-- | Source/FieldSolver/ElectrostaticSolver.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/Source/FieldSolver/ElectrostaticSolver.cpp b/Source/FieldSolver/ElectrostaticSolver.cpp index 6089cdbf2..3cb01efd3 100644 --- a/Source/FieldSolver/ElectrostaticSolver.cpp +++ b/Source/FieldSolver/ElectrostaticSolver.cpp @@ -103,7 +103,8 @@ WarpX::AddBoundaryField () // Store the boundary conditions for the field solver if they haven't been // stored yet - if (!m_poisson_boundary_handler.bcs_set) m_poisson_boundary_handler.definePhiBCs(); + if (!m_poisson_boundary_handler.bcs_set) + m_poisson_boundary_handler.definePhiBCs(Geom(0)); // Allocate fields for charge and potential const int num_levels = max_level + 1; @@ -143,7 +144,8 @@ WarpX::AddSpaceChargeField (WarpXParticleContainer& pc) // Store the boundary conditions for the field solver if they haven't been // stored yet - if (!m_poisson_boundary_handler.bcs_set) m_poisson_boundary_handler.definePhiBCs(); + if (!m_poisson_boundary_handler.bcs_set) + m_poisson_boundary_handler.definePhiBCs(Geom(0)); #ifdef WARPX_DIM_RZ WARPX_ALWAYS_ASSERT_WITH_MESSAGE(n_rz_azimuthal_modes == 1, @@ -197,7 +199,8 @@ WarpX::AddSpaceChargeFieldLabFrame () // Store the boundary conditions for the field solver if they haven't been // stored yet - if (!m_poisson_boundary_handler.bcs_set) m_poisson_boundary_handler.definePhiBCs(); + if (!m_poisson_boundary_handler.bcs_set) + m_poisson_boundary_handler.definePhiBCs(Geom(0)); #ifdef WARPX_DIM_RZ WARPX_ALWAYS_ASSERT_WITH_MESSAGE(n_rz_azimuthal_modes == 1, @@ -838,11 +841,9 @@ WarpX::computePhiTriDiagonal (const amrex::Vector<std::unique_ptr<amrex::MultiFa phi[lev]->ParallelCopy(phi1d_mf, 0, 0, 1); } -void ElectrostaticSolver::PoissonBoundaryHandler::definePhiBCs ( ) +void ElectrostaticSolver::PoissonBoundaryHandler::definePhiBCs (const amrex::Geometry& geom) { #ifdef WARPX_DIM_RZ - WarpX& warpx = WarpX::GetInstance(); - auto geom = warpx.Geom(0); if (geom.ProbLo(0) == 0){ lobc[0] = LinOpBCType::Neumann; dirichlet_flag[0] = false; @@ -866,6 +867,7 @@ void ElectrostaticSolver::PoissonBoundaryHandler::definePhiBCs ( ) const int dim_start = 1; #else const int dim_start = 0; + amrex::ignore_unused(geom); #endif for (int idim=dim_start; idim<AMREX_SPACEDIM; idim++){ if ( WarpX::field_boundary_lo[idim] == FieldBoundaryType::Periodic |