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
35 use parser_oct_m
39 use space_oct_m
41 use xc_oct_m
42
43 implicit none
44
45 private
46
47 public :: &
49
50contains
51
52 ! ---------------------------------------------------------
54 subroutine exponential_midpoint(hm, namespace, space, gr, st, tr, time, dt, ions_dyn, ions, ext_partners, mc)
55 type(hamiltonian_elec_t), target, intent(inout) :: hm
56 type(namespace_t), intent(in) :: namespace
57 type(electron_space_t), intent(in) :: space
58 type(grid_t), target, intent(inout) :: gr
59 type(states_elec_t), target, intent(inout) :: st
60 type(propagator_base_t), target, intent(inout) :: tr
61 real(real64), intent(in) :: time
62 real(real64), intent(in) :: dt
63 type(ion_dynamics_t), intent(inout) :: ions_dyn
64 type(ions_t), intent(inout) :: ions
65 type(partner_list_t), intent(in) :: ext_partners
66 type(multicomm_t), intent(inout) :: mc
67
68 type(gauge_field_t), pointer :: gfield
69
70 push_sub(propagator_dt.exponential_midpoint)
71
72 ! the half step of this propagator screws with the gauge field kick
73
74 gfield => list_get_gauge_field(ext_partners)
75 if(associated(gfield)) then
76 assert(gauge_field_is_propagated(gfield) .eqv. .false.)
77 end if
78
79 call hm%ks_pot%interpolate_potentials(tr%vks_old, 3, time, dt, time - dt/m_two)
80
81 !move the ions to time 'time - dt/2'
82 call propagation_ops_elec_move_ions(tr%propagation_ops_elec, gr, hm, st, namespace, space, ions_dyn, ions, &
83 ext_partners, mc, time - m_half*dt, m_half*dt, save_pos = .true.)
84
85 if(associated(gfield)) then
86 call propagation_ops_elec_propagate_gauge_field(tr%propagation_ops_elec, gfield, &
87 m_half*dt, time, save_gf = .true.)
88 end if
89
90 call propagation_ops_elec_update_hamiltonian(namespace, space, st, gr, hm, ext_partners, time - dt*m_half)
91
92 call propagation_ops_elec_fuse_density_exp_apply(tr%te, namespace, st, gr, hm, dt)
93
94 !restore to time 'time - dt'
95 call propagation_ops_elec_restore_ions(tr%propagation_ops_elec, ions_dyn, ions)
96
97 call propagation_ops_elec_restore_gauge_field(tr%propagation_ops_elec, namespace, space, hm, gr, ext_partners)
98
99 pop_sub(propagator_dt.exponential_midpoint)
100 end subroutine exponential_midpoint
101! ---------------------------------------------------------
102
104
105!! Local Variables:
106!! mode: f90
107!! coding: utf-8
108!! 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.
This module handles the communicators for the various parallelization strategies.
Definition: multicomm.F90:145
subroutine, public propagation_ops_elec_restore_ions(wo, ions_dyn, ions)
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_move_ions(wo, gr, hm, st, namespace, space, ions_dyn, ions, ext_partners, mc, time, dt, save_pos)
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, mc)
Exponential midpoint.
Definition: xc.F90:114
int true(void)