67  subroutine pcm_hartree_potential(pcm, space, mesh, psolver, ext_partners, vhartree, density, pcm_corr, &
 
   69    type(pcm_t),         
intent(inout) :: pcm
 
   70    class(space_t),      
intent(in)    :: space
 
   71    class(mesh_t),       
intent(in)    :: mesh
 
   72    type(poisson_t),     
intent(inout) :: psolver
 
   73    type(partner_list_t),
intent(in)    :: ext_partners
 
   74    real(real64),        
intent(in)    :: vhartree(:)
 
   75    real(real64),        
intent(in)    :: density(:)
 
   76    real(real64),        
intent(out)   :: pcm_corr
 
   77    type(kick_t), 
optional, 
intent(in) :: kick
 
   78    real(real64), 
optional,     
intent(in)    :: time
 
   80    real(real64), 
allocatable :: potx(:)
 
   81    complex(real64), 
allocatable :: kick_eval(:)
 
   82    real(real64), 
allocatable :: kick_real(:)
 
   86    type(lasers_t), 
pointer :: lasers
 
   90    if (.not. pcm%run_pcm .or. .not. 
pcm_update(pcm)) 
then 
   98      call pcm_calc_pot_rs(pcm, mesh, psolver, v_h = vhartree, time_present = 
present(time))
 
  105    if (pcm%localf .and. 
present(time)) 
then 
  107      if (
associated(lasers) .and. 
present(kick)) 
then  
  108        safe_allocate(potx(1:mesh%np_part))
 
  109        safe_allocate(kick_eval(1:mesh%np_part))
 
  110        safe_allocate(kick_real(1:mesh%np_part))
 
  113        do ii = 1, lasers%no_lasers
 
  117        kick_time = ((pcm%iter-1)*pcm%dt <= kick%time) .and. (pcm%iter*pcm%dt > kick%time)
 
  120          kick_eval = kick%delta_strength * kick_eval
 
  121          kick_real = real(kick_eval, real64)
 
  123        call pcm_calc_pot_rs(pcm, mesh, psolver, v_ext = potx, kick = -kick_real, &
 
  124          time_present = 
present(time), kick_time = kick_time)
 
  125        safe_deallocate_a(potx)
 
  126        safe_deallocate_a(kick_eval)
 
  127        safe_deallocate_a(kick_real)
 
  128      else if (
associated(lasers) .and. .not.
present(kick)) 
then  
  129        safe_allocate(potx(1:mesh%np_part))
 
  131        do ii = 1, lasers%no_lasers
 
  134        call pcm_calc_pot_rs(pcm, mesh, psolver, v_ext = potx, time_present = 
present(time))
 
  135        safe_deallocate_a(potx)
 
  136      else if (.not.
associated(lasers) .and. 
present(kick)) 
then  
  137        safe_allocate(kick_eval(1:mesh%np_part))
 
  138        safe_allocate(kick_real(1:mesh%np_part))
 
  141        kick_time =((pcm%iter-1)*pcm%dt <= kick%time) .and. (pcm%iter*pcm%dt > kick%time)
 
  144          kick_eval = kick%delta_strength * kick_eval
 
  145          kick_real = real(kick_eval, real64)
 
  148          time_present = 
present(time), kick_time = kick_time)
 
  149        safe_deallocate_a(kick_eval)
 
  150        safe_deallocate_a(kick_real)
 
  155      pcm_corr = 
dmf_dotp( mesh, density, pcm%v_e_rs + pcm%v_n_rs + pcm%v_ext_rs)
 
  158      pcm_corr = 
dmf_dotp( mesh, density, pcm%v_e_rs + pcm%v_n_rs)
 
type(debug_t), save, public debug
 
type(lasers_t) function, pointer, public list_get_lasers(partners)
 
real(real64), parameter, public m_zero
 
This module implements the underlying real-space grid.
 
This module implements the index, used for the mesh points.
 
This module defines classes and functions for interaction partners.
 
subroutine, public kick_function_get(space, mesh, kick, kick_function, iq, to_interpolate)
 
subroutine, public laser_potential(laser, mesh, pot, time)
 
This module defines various routines, operating on mesh functions.
 
This module defines the meshes, which are used in Octopus.
 
subroutine, public messages_info(no_lines, iunit, verbose_limit, stress, all_nodes, namespace)
 
subroutine, public messages_new_line()
 
Some general things and nomenclature:
 
subroutine, public pcm_calc_pot_rs(pcm, mesh, psolver, ions, v_h, v_ext, kick, time_present, kick_time)
 
logical function, public pcm_update(this)
Update pcm potential.
 
subroutine, public pcm_hartree_potential(pcm, space, mesh, psolver, ext_partners, vhartree, density, pcm_corr, kick, time)
PCM reaction field due to the electronic density.
 
brief This module defines the class unit_t which is used by the unit_systems_oct_m module.
 
This module defines the unit system, used for input and output.