subroutine poisson
use modglobal, only : ib,ie,ih,kb,ke,kh,kmax,dxh,dxf,dy,dzf,dzh,linoutflow,iinletgen,ipoiss,POISS_FFT,POISS_CYC
use modmpi, only : myid,nprocs,barrou
implicit none
integer ibc1,ibc2,kbc1,kbc2,ksen
call fillps
! ibc?=1: neumann
! ibc?=2: periodic
! ibc?=3: dirichlet
select case (ipoiss)
case (POISS_FFT)
call solmpj(p)
case (POISS_CYC)
if (linoutflow ) then
ibc1 = 1 ! inlet
ibc2 = 3 ! outlet
else
ibc1 = 2
ibc2 = 2
endif
kbc1 = 1
kbc2 = 1
ksen = kmax/nprocs
call poisr(p,dxf,dxh,dy,dzf,dzh, &
ibc1,ibc2,kbc1,kbc2,ksen)
case default
write(0, *) "Invalid choice for Poisson solver"
stop 1
end select
call tderive
end subroutine poisson