Octopus
propagator_verlet.F90
Go to the documentation of this file.
1!! Copyright (C) 2019 N. Tancogne-Dejean
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
23 use debug_oct_m
24 use global_oct_m
26
27 implicit none
28
29 private
30 public :: &
32
34 type, extends(propagator_t) :: propagator_verlet_t
35 private
36 end type propagator_verlet_t
37
38 interface propagator_verlet_t
39 procedure propagator_verlet_constructor
40 end interface propagator_verlet_t
41
42 !# doc_start verlet_propagation_operations
43 ! Specific verlet propagation operations identifiers
44 character(len=30), public, parameter :: &
45 VERLET_START = 'VERLET_START', &
46 verlet_finish = 'VERLET_FINISH', &
47 verlet_update_pos = 'VERLET_UPDATE_POS', &
48 verlet_compute_acc = 'VERLET_COMPUTE_ACC', &
49 verlet_compute_vel = 'VERLET_COMPUTE_VEL'
50
51 ! Specific verlet propagation operations
52 type(algorithmic_operation_t), public, parameter :: &
53 OP_VERLET_START = algorithmic_operation_t(verlet_start, 'Starting Verlet propagation'), &
54 op_verlet_finish = algorithmic_operation_t(verlet_finish, 'Finishing Verlet propagation'), &
55 op_verlet_update_pos = algorithmic_operation_t(verlet_update_pos, 'Propagation step - Updating positions'), &
56 op_verlet_compute_acc = algorithmic_operation_t(verlet_compute_acc, 'Propagation step - Computing acceleration'), &
57 op_verlet_compute_vel = algorithmic_operation_t(verlet_compute_vel, 'Propagation step - Computing velocity')
58 !# doc_end
59
60contains
61
62 ! ---------------------------------------------------------
63 function propagator_verlet_constructor(dt) result(this)
64 float, intent(in) :: dt
65 type(propagator_verlet_t), pointer :: this
66
68
69 allocate(this)
70
71 this%start_operation = op_verlet_start
72 this%final_operation = op_verlet_finish
73
74 call this%add_operation(op_verlet_update_pos)
75 call this%add_operation(op_update_couplings)
76 call this%add_operation(op_update_interactions)
77 call this%add_operation(op_verlet_compute_acc)
78 call this%add_operation(op_verlet_compute_vel)
79 call this%add_operation(op_iteration_done)
80 call this%add_operation(op_rewind_algorithm)
81
82 ! Verlet has only one algorithmic step
83 this%algo_steps = 1
84
85 this%dt = dt
86
89
91
92
93!! Local Variables:
94!! mode: f90
95!! coding: utf-8
96!! End:
This module implements the basic elements defining algorithms.
Definition: algorithm.F90:132
type(algorithmic_operation_t), parameter, public op_iteration_done
Definition: algorithm.F90:170
type(algorithmic_operation_t), parameter, public op_rewind_algorithm
Definition: algorithm.F90:170
type(algorithmic_operation_t), parameter, public op_update_couplings
Definition: algorithm.F90:170
type(algorithmic_operation_t), parameter, public op_update_interactions
Definition: algorithm.F90:170
This module implements the basic propagator framework.
Definition: propagator.F90:108
character(len=30), parameter, public verlet_compute_acc
type(algorithmic_operation_t), parameter, public op_verlet_compute_acc
character(len=30), parameter, public verlet_update_pos
type(propagator_verlet_t) function, pointer propagator_verlet_constructor(dt)
type(algorithmic_operation_t), parameter, public op_verlet_finish
character(len=30), parameter, public verlet_finish
type(algorithmic_operation_t), parameter, public op_verlet_update_pos
type(algorithmic_operation_t), parameter, public op_verlet_compute_vel
character(len=30), parameter, public verlet_compute_vel
Descriptor of one algorithmic operation.
Definition: algorithm.F90:154
Abstract class implementing propagators.
Definition: propagator.F90:129
Implements a propagator for the velocity Verlet algorithm.