Octopus
propagator_expmid.F90
Go to the documentation of this file.
1!! Copyright (C) 2002-2006 M. Marques, A. Castro, A. Rubio, G. Bertsch
2!!
3!! This program is free software; you can redistribute it and/or modify
4!! it under the terms of the GNU General Public License as published by
5!! the Free Software Foundation; either version 2, or (at your option)
6!! any later version.
7!!
8!! This program is distributed in the hope that it will be useful,
9!! but WITHOUT ANY WARRANTY; without even the implied warranty of
10!! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11!! GNU General Public License for more details.
12!!
13!! You should have received a copy of the GNU General Public License
14!! along with this program; if not, write to the Free Software
15!! Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
16!! 02110-1301, USA.
17!!
18
19#include "global.h"
20
22 use debug_oct_m
25 use grid_oct_m
27 use global_oct_m
31 use ions_oct_m
34 use parser_oct_m
38 use space_oct_m
40 use xc_oct_m
41
42 implicit none
43
44 private
45
46 public :: &
48
49contains
50
51 ! ---------------------------------------------------------
53 subroutine exponential_midpoint(hm, namespace, space, gr, st, tr, time, dt, ions_dyn, ions, ext_partners)
54 type(hamiltonian_elec_t), target, intent(inout) :: hm
55 type(namespace_t), intent(in) :: namespace
56 type(electron_space_t), intent(in) :: space
57 type(grid_t), target, intent(in) :: gr
58 type(states_elec_t), target, intent(inout) :: st
59 type(propagator_base_t), target, intent(inout) :: tr
60 real(real64), intent(in) :: time
61 real(real64), intent(in) :: dt
62 type(ion_dynamics_t), intent(inout) :: ions_dyn
63 type(ions_t), intent(inout) :: ions
64 type(partner_list_t), intent(in) :: ext_partners
65
66 type(gauge_field_t), pointer :: gfield
67
68 push_sub(propagator_dt.exponential_midpoint)
69
70 ! the half step of this propagator screws with the gauge field kick
71
72 gfield => list_get_gauge_field(ext_partners)
73 if(associated(gfield)) then
74 assert(gauge_field_is_propagated(gfield) .eqv. .false.)
75 end if
76
77 call hm%ks_pot%interpolate_potentials(tr%vks_old, 3, time, dt, time - dt/m_two)
78
79 !move the ions to time 'time - dt/2'
80 call propagation_ops_elec_move_ions(tr%propagation_ops_elec, gr, hm, st, namespace, space, ions_dyn, ions, &
81 ext_partners, time - m_half*dt, m_half*dt, save_pos = .true.)
82
83 if(associated(gfield)) then
84 call propagation_ops_elec_propagate_gauge_field(tr%propagation_ops_elec, gfield, &
85 m_half*dt, time, save_gf = .true.)
86 end if
87
88 call propagation_ops_elec_update_hamiltonian(namespace, space, st, gr, hm, ext_partners, time - dt*m_half)
89
90 call propagation_ops_elec_fuse_density_exp_apply(tr%te, namespace, st, gr, hm, dt)
91
92 !restore to time 'time - dt'
93 call propagation_ops_elec_restore_ions(tr%propagation_ops_elec, ions_dyn, ions)
94
95 call propagation_ops_elec_restore_gauge_field(tr%propagation_ops_elec, namespace, space, hm, gr, ext_partners)
96
97 pop_sub(propagator_dt.exponential_midpoint)
98 end subroutine exponential_midpoint
99! ---------------------------------------------------------
100
102
103!! Local Variables:
104!! mode: f90
105!! coding: utf-8
106!! End:
type(gauge_field_t) function, pointer, public list_get_gauge_field(partners)
logical pure function, public gauge_field_is_propagated(this)
real(real64), parameter, public m_two
Definition: global.F90:190
real(real64), parameter, public m_half
Definition: global.F90:194
This module implements the underlying real-space grid.
Definition: grid.F90:117
This module defines classes and functions for interaction partners.
A module to handle KS potential, without the external potential.
subroutine, public propagation_ops_elec_restore_ions(wo, ions_dyn, ions)
subroutine, public propagation_ops_elec_move_ions(wo, gr, hm, st, namespace, space, ions_dyn, ions, ext_partners, time, dt, save_pos)
subroutine, public propagation_ops_elec_propagate_gauge_field(wo, gfield, dt, time, save_gf)
subroutine, public propagation_ops_elec_update_hamiltonian(namespace, space, st, mesh, hm, ext_partners, time)
subroutine, public propagation_ops_elec_restore_gauge_field(wo, namespace, space, hm, mesh, ext_partners)
subroutine, public propagation_ops_elec_fuse_density_exp_apply(te, namespace, st, gr, hm, dt, dt2, vmagnus)
subroutine, public exponential_midpoint(hm, namespace, space, gr, st, tr, time, dt, ions_dyn, ions, ext_partners)
Exponential midpoint.
int true(void)