From 4a9ccb5c011296cf249cda948db93dfa7c455cdc Mon Sep 17 00:00:00 2001 From: Burlen Loring Date: Thu, 15 Nov 2018 04:52:38 -0800 Subject: init ghost cells during cell centering conversion for in situ --- Source/WarpX.cpp | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) (limited to 'Source/WarpX.cpp') diff --git a/Source/WarpX.cpp b/Source/WarpX.cpp index 181da6360..6ed1ec968 100644 --- a/Source/WarpX.cpp +++ b/Source/WarpX.cpp @@ -842,6 +842,26 @@ WarpX::ComputeDivB (MultiFab& divB, int dcomp, } } +void +WarpX::ComputeDivB (MultiFab& divB, int dcomp, + const std::array& B, + const std::array& dx, int ngrow) +{ +#ifdef _OPENMP +#pragma omp parallel +#endif + for (MFIter mfi(divB, true); mfi.isValid(); ++mfi) + { + Box bx = mfi.growntilebox(ngrow); + WRPX_COMPUTE_DIVB(bx.loVect(), bx.hiVect(), + BL_TO_FORTRAN_N_ANYD(divB[mfi],dcomp), + BL_TO_FORTRAN_ANYD((*B[0])[mfi]), + BL_TO_FORTRAN_ANYD((*B[1])[mfi]), + BL_TO_FORTRAN_ANYD((*B[2])[mfi]), + dx.data()); + } +} + void WarpX::ComputeDivE (MultiFab& divE, int dcomp, const std::array& E, @@ -862,6 +882,26 @@ WarpX::ComputeDivE (MultiFab& divE, int dcomp, } } +void +WarpX::ComputeDivE (MultiFab& divE, int dcomp, + const std::array& E, + const std::array& dx, int ngrow) +{ +#ifdef _OPENMP +#pragma omp parallel +#endif + for (MFIter mfi(divE, true); mfi.isValid(); ++mfi) + { + Box bx = mfi.growntilebox(ngrow); + WRPX_COMPUTE_DIVE(bx.loVect(), bx.hiVect(), + BL_TO_FORTRAN_N_ANYD(divE[mfi],dcomp), + BL_TO_FORTRAN_ANYD((*E[0])[mfi]), + BL_TO_FORTRAN_ANYD((*E[1])[mfi]), + BL_TO_FORTRAN_ANYD((*E[2])[mfi]), + dx.data()); + } +} + void WarpX::applyFilter (MultiFab& dstmf, const MultiFab& srcmf, int scomp, int dcomp, int ncomp) { -- cgit v1.2.3