00001 subroutine poisson_solver_binary_bhex_homosol(char_bc,sou, &
00002 & sou_exsurf,dsou_exsurf, &
00003 & sou_insurf,dsou_insurf, &
00004 & sou_outsurf,dsou_outsurf,pot)
00005 use phys_constant, only : long
00006 use grid_parameter, only : nrg, npg, ntg
00007 use make_array_3d
00008 use interface_poisson_solver_binary_vol_int
00009 use interface_poisson_solver_binary_surf_int
00010 use interface_poisson_solver_bhex_surf_int
00011 use interface_sourceterm_surface_int_homosol
00012 use interface_copy_to_hgfn_and_gfnsf
00013 use radial_green_fn_grav_bhex_nb
00014 use radial_green_fn_grav_bhex_dh
00015 use radial_green_fn_grav_bhex_nh
00016 implicit none
00017 real(long), pointer :: pot(:,:,:), sou(:,:,:)
00018 real(long), pointer :: sou_exsurf(:,:), dsou_exsurf(:,:)
00019 real(long), pointer :: sou_insurf(:,:), dsou_insurf(:,:)
00020 real(long), pointer :: sou_outsurf(:,:), dsou_outsurf(:,:)
00021 real(long), pointer :: sou_iosurf(:,:,:)
00022 real(long), pointer :: pot_vol(:,:,:), pot_exsurf(:,:,:)
00023 real(long), pointer :: pot_insurf(:,:,:), pot_outsurf(:,:,:)
00024 real(long), pointer :: pot_integrals(:,:,:)
00025 character(len=2) :: char_bc
00026
00027 call alloc_array3d(pot_vol,0,nrg,0,ntg,0,npg)
00028 call alloc_array3d(pot_exsurf,0,nrg,0,ntg,0,npg)
00029 call alloc_array3d(pot_insurf,0,nrg,0,ntg,0,npg)
00030 call alloc_array3d(pot_outsurf,0,nrg,0,ntg,0,npg)
00031 call alloc_array3d(pot_integrals,0,nrg,0,ntg,0,npg)
00032 call alloc_array3d(sou_iosurf,0,ntg,0,npg,1,4)
00033
00034 call calc_hgfn_bhex_nb
00035 call copy_to_hgfn_and_gfnsf(hgfn_nb,gfnsf_nb)
00036 call poisson_solver_binary_vol_int(sou,pot_vol)
00037 call poisson_solver_binary_surf_int(sou_exsurf,dsou_exsurf,pot_exsurf)
00038
00039 sou_iosurf(1:ntg,1:npg,1) = dsou_insurf(1:ntg,1:npg)
00040 sou_iosurf(1:ntg,1:npg,2) = sou_insurf(1:ntg,1:npg)
00041 call poisson_solver_bhex_surf_int('in',sou_iosurf,pot_insurf)
00042 sou_iosurf(1:ntg,1:npg,3) = dsou_outsurf(1:ntg,1:npg)
00043 sou_iosurf(1:ntg,1:npg,4) = sou_outsurf(1:ntg,1:npg)
00044 if (char_bc.eq.'dh') then
00045 call calc_hgfn_bhex_dh
00046 call copy_to_hgfn_and_gfnsf(hgfn_dh,gfnsf_dh)
00047 end if
00048 if (char_bc.eq.'nh') then
00049 call calc_hgfn_bhex_nh
00050 call copy_to_hgfn_and_gfnsf(hgfn_nh,gfnsf_nh)
00051 end if
00052 call poisson_solver_bhex_surf_int('ou',sou_iosurf,pot_outsurf)
00053
00054 pot_integrals(0:nrg,0:ntg,0:npg) = pot_vol(0:nrg,0:ntg,0:npg) &
00055 & + pot_exsurf(0:nrg,0:ntg,0:npg) &
00056 & + pot_insurf(0:nrg,0:ntg,0:npg) &
00057 & + pot_outsurf(0:nrg,0:ntg,0:npg)
00058
00059 call sourceterm_surface_int_homosol(pot_integrals,0,sou_insurf,dsou_insurf)
00060 sou_iosurf(1:ntg,1:npg,1) = dsou_insurf(1:ntg,1:npg)
00061 sou_iosurf(1:ntg,1:npg,2) = sou_insurf(1:ntg,1:npg)
00062 call poisson_solver_bhex_surf_int('in',sou_iosurf,pot_insurf)
00063 pot(0:nrg,0:ntg,0:npg) = pot_integrals(0:nrg,0:ntg,0:npg) &
00064 & + pot_insurf(0:nrg,0:ntg,0:npg)
00065
00066 deallocate(pot_vol)
00067 deallocate(pot_exsurf)
00068 deallocate(pot_insurf)
00069 deallocate(pot_outsurf)
00070 deallocate(pot_integrals)
00071 deallocate(sou_iosurf)
00072
00073 end subroutine poisson_solver_binary_bhex_homosol