64 subroutine pcm_hartree_potential(pcm, space, mesh, psolver, ext_partners, vhartree, density, pcm_corr, &
66 type(pcm_t),
intent(inout) :: pcm
67 class(space_t),
intent(in) :: space
68 class(mesh_t),
intent(in) :: mesh
69 type(poisson_t),
intent(inout) :: psolver
70 type(partner_list_t),
intent(in) :: ext_partners
71 real(real64),
intent(in) :: vhartree(:)
72 real(real64),
intent(in) :: density(:)
73 real(real64),
intent(out) :: pcm_corr
74 type(kick_t),
optional,
intent(in) :: kick
75 real(real64),
optional,
intent(in) :: time
77 real(real64),
allocatable :: potx(:)
78 complex(real64),
allocatable :: kick_eval(:)
79 real(real64),
allocatable :: kick_real(:)
83 type(lasers_t),
pointer :: lasers
87 if (.not. pcm%run_pcm .or. .not.
pcm_update(pcm))
then
95 call pcm_calc_pot_rs(pcm, mesh, psolver, v_h = vhartree, time_present =
present(time))
102 if (pcm%localf .and.
present(time))
then
104 if (
associated(lasers) .and.
present(kick))
then
105 safe_allocate(potx(1:mesh%np_part))
106 safe_allocate(kick_eval(1:mesh%np_part))
107 safe_allocate(kick_real(1:mesh%np_part))
110 do ii = 1, lasers%no_lasers
114 kick_time = ((pcm%iter-1)*pcm%dt <= kick%time) .and. (pcm%iter*pcm%dt > kick%time)
117 kick_eval = kick%delta_strength * kick_eval
118 kick_real = real(kick_eval, real64)
120 call pcm_calc_pot_rs(pcm, mesh, psolver, v_ext = potx, kick = -kick_real, &
121 time_present =
present(time), kick_time = kick_time)
122 safe_deallocate_a(potx)
123 safe_deallocate_a(kick_eval)
124 safe_deallocate_a(kick_real)
125 else if (
associated(lasers) .and. .not.
present(kick))
then
126 safe_allocate(potx(1:mesh%np_part))
128 do ii = 1, lasers%no_lasers
131 call pcm_calc_pot_rs(pcm, mesh, psolver, v_ext = potx, time_present =
present(time))
132 safe_deallocate_a(potx)
133 else if (.not.
associated(lasers) .and.
present(kick))
then
134 safe_allocate(kick_eval(1:mesh%np_part))
135 safe_allocate(kick_real(1:mesh%np_part))
138 kick_time =((pcm%iter-1)*pcm%dt <= kick%time) .and. (pcm%iter*pcm%dt > kick%time)
141 kick_eval = kick%delta_strength * kick_eval
142 kick_real = real(kick_eval, real64)
145 time_present =
present(time), kick_time = kick_time)
146 safe_deallocate_a(kick_eval)
147 safe_deallocate_a(kick_real)
152 pcm_corr =
dmf_dotp( mesh, density, pcm%v_e_rs + pcm%v_n_rs + pcm%v_ext_rs)
155 pcm_corr =
dmf_dotp( mesh, density, pcm%v_e_rs + pcm%v_n_rs)
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_new_line()
subroutine, public messages_info(no_lines, iunit, debug_only, stress, all_nodes, namespace)
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.