diff options
Diffstat (limited to 'Source/FieldSolver')
-rw-r--r-- | Source/FieldSolver/Make.package | 6 | ||||
-rw-r--r-- | Source/FieldSolver/openbc_poisson_solver.F90 | 62 | ||||
-rw-r--r-- | Source/FieldSolver/solve_E_nodal.F90 | 73 |
3 files changed, 0 insertions, 141 deletions
diff --git a/Source/FieldSolver/Make.package b/Source/FieldSolver/Make.package index 076be41bb..018cfbfba 100644 --- a/Source/FieldSolver/Make.package +++ b/Source/FieldSolver/Make.package @@ -7,12 +7,6 @@ ifeq ($(USE_PSATD),TRUE) include $(WARPX_HOME)/Source/FieldSolver/PicsarHybridSpectralSolver/Make.package endif endif -ifeq ($(USE_OPENBC_POISSON),TRUE) - F90EXE_sources += openbc_poisson_solver.F90 -endif -ifeq ($DO_ELECTROSTATIC,TRUE) - F90EXE_sources += solve_E_nodal.F90 -endif INCLUDE_LOCATIONS += $(WARPX_HOME)/Source/FieldSolver VPATH_LOCATIONS += $(WARPX_HOME)/Source/FieldSolver diff --git a/Source/FieldSolver/openbc_poisson_solver.F90 b/Source/FieldSolver/openbc_poisson_solver.F90 deleted file mode 100644 index 8e962a2ef..000000000 --- a/Source/FieldSolver/openbc_poisson_solver.F90 +++ /dev/null @@ -1,62 +0,0 @@ - -module warpx_openbc_module - - implicit none - - integer, parameter :: idecomp = 0 ! 0=xyz, 1=xy, 2=yz, 3=xz, 4=x, 5=y, 6=z. - integer, parameter :: igfflag = 1 ! =0 for ordinary 1/r Green function; - ! =1 for integrated Green function - - integer, save :: gb_lo(3), gb_hi(3) - integer, save :: lc_lo(3), lc_hi(3) - -contains - - subroutine warpx_openbc_decompose(glo, ghi, lo, hi) bind(c,name='warpx_openbc_decompose') - - use mpi - - integer, intent(in) :: glo(3), ghi(3) - integer, intent(out) :: lo(3), hi(3) - integer :: myrank, mprocs, ierr, npx, npy, npz - - call MPI_Comm_size(MPI_COMM_WORLD, mprocs, ierr); - call MPI_COMM_RANK(MPI_COMM_WORLD,myrank,ierr) - - gb_lo = glo + 1 ! +1 because AMReX's domain index starts with 0 - gb_hi = ghi + 2 ! +2 to nodalize it - - call procgriddecomp(mprocs, gb_lo(1),gb_hi(1), & - & gb_lo(2),gb_hi(2), & - & gb_lo(3),gb_hi(3), & - & idecomp, npx, npy, npz) - - call decompose(myrank,mprocs, gb_lo(1),gb_hi(1), & - & gb_lo(2),gb_hi(2), & - & gb_lo(3),gb_hi(3), & - idecomp, lc_lo(1), lc_hi(1), & - & lc_lo(2), lc_hi(2), & - & lc_lo(3), lc_hi(3)) - - lo = lc_lo - 1 ! AMReX's domain index starts with zero. - hi = lc_hi - 1 - - end subroutine warpx_openbc_decompose - - subroutine warpx_openbc_potential(rho, phi, dx) & - bind(C, name="warpx_openbc_potential") - - double precision, intent(in ) :: dx(3) - double precision, intent(in ) :: rho(lc_lo(1):lc_hi(1),lc_lo(2):lc_hi(2),lc_lo(3):lc_hi(3)) - double precision, intent(out) :: phi(lc_lo(1):lc_hi(1),lc_lo(2):lc_hi(2),lc_lo(3):lc_hi(3)) - - integer :: ierr - - call openbcpotential(rho, phi, dx(1), dx(2), dx(3), & - lc_lo(1), lc_hi(1), lc_lo(2), lc_hi(2), lc_lo(3), lc_hi(3), & - gb_lo(1), gb_hi(1), gb_lo(2), gb_hi(2), gb_lo(3), gb_hi(3), & - idecomp, igfflag, ierr) - - end subroutine warpx_openbc_potential - -end module warpx_openbc_module diff --git a/Source/FieldSolver/solve_E_nodal.F90 b/Source/FieldSolver/solve_E_nodal.F90 deleted file mode 100644 index 4ed9bb845..000000000 --- a/Source/FieldSolver/solve_E_nodal.F90 +++ /dev/null @@ -1,73 +0,0 @@ -module warpx_ES_solve_E_nodal - - use iso_c_binding - use amrex_fort_module, only : amrex_real - - implicit none - -contains - -! This routine computes the node-centered electric field given a node-centered phi. -! The gradient is computed using 2nd-order centered differences. It assumes the -! Boundary conditions have already been set and that you have two rows of ghost cells -! for phi and one row of ghost cells for Ex, Ey, and Ez. -! Note that this routine includes the minus sign in E = - grad phi. -! -! Arguments: -! lo, hi: The corners of the valid box over which the gradient is taken -! Ex, Ey, Ez: The electric field in the x, y, and z directions. -! dx: The cell spacing -! - subroutine warpx_compute_E_nodal_3d (lo, hi, phi, Ex, Ey, Ez, dx) & - bind(c,name='warpx_compute_E_nodal_3d') - integer(c_int), intent(in) :: lo(3), hi(3) - real(amrex_real), intent(in) :: dx(3) - real(amrex_real), intent(in ) :: phi(lo(1)-2:hi(1)+2,lo(2)-2:hi(2)+2,lo(3)-2:hi(3)+2) - real(amrex_real), intent(inout) :: Ex (lo(1)-1:hi(1)+1,lo(2)-1:hi(2)+1,lo(3)-1:hi(3)+1) - real(amrex_real), intent(inout) :: Ey (lo(1)-1:hi(1)+1,lo(2)-1:hi(2)+1,lo(3)-1:hi(3)+1) - real(amrex_real), intent(inout) :: Ez (lo(1)-1:hi(1)+1,lo(2)-1:hi(2)+1,lo(3)-1:hi(3)+1) - - integer :: i, j, k - real(amrex_real) :: fac(3) - - fac = 0.5d0 / dx - - do k = lo(3)-1, hi(3)+1 - do j = lo(2)-1, hi(2)+1 - do i = lo(1)-1, hi(1)+1 - - Ex(i,j,k) = fac(1) * (phi(i-1,j,k) - phi(i+1,j,k)) - Ey(i,j,k) = fac(2) * (phi(i,j-1,k) - phi(i,j+1,k)) - Ez(i,j,k) = fac(3) * (phi(i,j,k-1) - phi(i,j,k+1)) - - end do - end do - end do - - end subroutine warpx_compute_E_nodal_3d - - subroutine warpx_compute_E_nodal_2d (lo, hi, phi, Ex, Ey, dx) & - bind(c,name='warpx_compute_E_nodal_2d') - integer(c_int), intent(in) :: lo(2), hi(2) - real(amrex_real), intent(in) :: dx(2) - real(amrex_real), intent(in ) :: phi(lo(1)-2:hi(1)+2,lo(2)-2:hi(2)+2) - real(amrex_real), intent(inout) :: Ex (lo(1)-1:hi(1)+1,lo(2)-1:hi(2)+1) - real(amrex_real), intent(inout) :: Ey (lo(1)-1:hi(1)+1,lo(2)-1:hi(2)+1) - - integer :: i, j - real(amrex_real) :: fac(2) - - fac = 0.5d0 / dx - - do j = lo(2)-1, hi(2)+1 - do i = lo(1)-1, hi(1)+1 - - Ex(i,j) = fac(1) * (phi(i-1,j) - phi(i+1,j)) - Ey(i,j) = fac(2) * (phi(i,j-1) - phi(i,j+1)) - - end do - end do - - end subroutine warpx_compute_E_nodal_2d - -end module warpx_ES_solve_E_nodal |