diff options
author | 2021-05-03 12:48:21 -0700 | |
---|---|---|
committer | 2021-05-03 12:48:21 -0700 | |
commit | 1f8862084391fbeb4b87f765eea01beaf5f21074 (patch) | |
tree | 75c526dbafbd6fb14b5602970087552b72ae9f26 /Source/Parallelization/GuardCellManager.cpp | |
parent | 7113d7e9ce4fe89c87ba5e2c490a24595f85bc74 (diff) | |
download | WarpX-1f8862084391fbeb4b87f765eea01beaf5f21074.tar.gz WarpX-1f8862084391fbeb4b87f765eea01beaf5f21074.tar.zst WarpX-1f8862084391fbeb4b87f765eea01beaf5f21074.zip |
Implement div(B) Cleaning With FDTD (#1829)
* Implement div(B) Cleaning With FDTD
* Add CI Test
* Clean Up
Diffstat (limited to 'Source/Parallelization/GuardCellManager.cpp')
-rw-r--r-- | Source/Parallelization/GuardCellManager.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/Source/Parallelization/GuardCellManager.cpp b/Source/Parallelization/GuardCellManager.cpp index b40c4433b..b569c43e7 100644 --- a/Source/Parallelization/GuardCellManager.cpp +++ b/Source/Parallelization/GuardCellManager.cpp @@ -122,6 +122,11 @@ guardCellManager::Init ( if (maxwell_solver_id == MaxwellSolverAlgo::CKC) ng_alloc_F_int = std::max( ng_alloc_F_int, 1 ); ng_alloc_F = IntVect(AMREX_D_DECL(ng_alloc_F_int, ng_alloc_F_int, ng_alloc_F_int)); + // Used if warpx.do_divb_cleaning = 1 + int ng_alloc_G_int = (do_moving_window) ? 2 : 1; + // TODO Does the CKC solver require one additional guard cell (as for F)? + ng_alloc_G = IntVect(AMREX_D_DECL(ng_alloc_G_int, ng_alloc_G_int, ng_alloc_G_int)); + if (maxwell_solver_id == MaxwellSolverAlgo::PSATD) { // The number of guard cells should be enough to contain the stencil of the FFT solver. @@ -178,9 +183,11 @@ guardCellManager::Init ( if (maxwell_solver_id == MaxwellSolverAlgo::PSATD) { ng_FieldSolver = ng_alloc_EB; ng_FieldSolverF = ng_alloc_EB; + ng_FieldSolverG = ng_alloc_EB; } else { ng_FieldSolver = IntVect(AMREX_D_DECL(1, 1, 1)); ng_FieldSolverF = IntVect(AMREX_D_DECL(1, 1, 1)); + ng_FieldSolverG = IntVect(AMREX_D_DECL(1, 1, 1)); } if (safe_guard_cells){ @@ -188,6 +195,7 @@ guardCellManager::Init ( // call of FillBoundary ng_FieldSolver = ng_alloc_EB; ng_FieldSolverF = ng_alloc_F; + ng_FieldSolverG = ng_alloc_G; ng_FieldGather = ng_alloc_EB; ng_UpdateAux = ng_alloc_EB; if (do_moving_window){ @@ -217,6 +225,7 @@ guardCellManager::Init ( ng_FieldGather = ng_FieldGather.min(ng_alloc_EB); ng_UpdateAux = ng_UpdateAux.min(ng_alloc_EB); ng_FieldSolverF = ng_FieldSolverF.min(ng_alloc_F); + ng_FieldSolverG = ng_FieldSolverG.min(ng_alloc_G); // Only FillBoundary(ng_FieldGather) is called between consecutive // field solves. So ng_FieldGather must have enough cells // for the field solve too. |