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 use radial_green_fn_grav_bhex_dd
00017 use radial_green_fn_grav_bhex_nd
00018 implicit none
00019 real(long), pointer :: pot(:,:,:), sou(:,:,:)
00020 real(long), pointer :: sou_exsurf(:,:), dsou_exsurf(:,:)
00021 real(long), pointer :: sou_insurf(:,:), dsou_insurf(:,:)
00022 real(long), pointer :: sou_outsurf(:,:), dsou_outsurf(:,:)
00023 real(long), pointer :: sou_iosurf(:,:,:)
00024 real(long), pointer :: pot_vol(:,:,:), pot_exsurf(:,:,:)
00025 real(long), pointer :: pot_insurf(:,:,:), pot_outsurf(:,:,:)
00026 real(long), pointer :: pot_integrals(:,:,:)
00027 character(len=2) :: char_bc
00028
00029 call alloc_array3d(pot_vol,0,nrg,0,ntg,0,npg)
00030 call alloc_array3d(pot_exsurf,0,nrg,0,ntg,0,npg)
00031 call alloc_array3d(pot_insurf,0,nrg,0,ntg,0,npg)
00032 call alloc_array3d(pot_outsurf,0,nrg,0,ntg,0,npg)
00033 call alloc_array3d(pot_integrals,0,nrg,0,ntg,0,npg)
00034 call alloc_array3d(sou_iosurf,0,ntg,0,npg,1,4)
00035
00036 call calc_hgfn_bhex_nb
00037 call copy_to_hgfn_and_gfnsf(hgfn_nb,gfnsf_nb)
00038 call poisson_solver_binary_vol_int(sou,pot_vol)
00039 call poisson_solver_binary_surf_int(sou_exsurf,dsou_exsurf,pot_exsurf)
00040
00041 pot_integrals(0:nrg,0:ntg,0:npg) = pot_vol(0:nrg,0:ntg,0:npg) &
00042 & + pot_exsurf(0:nrg,0:ntg,0:npg)
00043
00044 if (char_bc.eq.'dh') then
00045 call calc_hgfn_bhex_dd
00046 call copy_to_hgfn_and_gfnsf(hgfn_dd,gfnsf_dd)
00047 end if
00048 if (char_bc.eq.'nh') then
00049 call calc_hgfn_bhex_nd
00050 call copy_to_hgfn_and_gfnsf(hgfn_nd,gfnsf_nd)
00051 end if
00052
00053 call sourceterm_surface_int_homosol(pot_integrals,0,sou_insurf,dsou_insurf)
00054 sou_iosurf(1:ntg,1:npg,1) = dsou_insurf(1:ntg,1:npg)
00055 sou_iosurf(1:ntg,1:npg,2) = sou_insurf(1:ntg,1:npg)
00056 call poisson_solver_bhex_surf_int('in',sou_iosurf,pot_insurf)
00057 call sourceterm_surface_int_homosol(pot_integrals,nrg,sou_outsurf,dsou_outsurf)
00058 sou_iosurf(1:ntg,1:npg,3) = dsou_outsurf(1:ntg,1:npg)
00059 sou_iosurf(1:ntg,1:npg,4) = sou_outsurf(1:ntg,1:npg)
00060 call poisson_solver_bhex_surf_int('ou',sou_iosurf,pot_outsurf)
00061
00062 pot(0:nrg,0:ntg,0:npg) = pot_integrals(0:nrg,0:ntg,0:npg) &
00063 & + pot_insurf(0:nrg,0:ntg,0:npg) &
00064 & + pot_outsurf(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