Octopus
propagator_beeman.F90
Go to the documentation of this file.
1!! Copyright (C) 2020 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
22 use, intrinsic :: iso_fortran_env
24 use debug_oct_m
25 use global_oct_m
27
28 implicit none
29
30 private
31 public :: &
33
35 type, extends(propagator_t) :: propagator_beeman_t
36 private
37 end type propagator_beeman_t
38
39 interface propagator_beeman_t
40 procedure propagator_beeman_constructor
41 end interface propagator_beeman_t
42
43 !# doc_start beeman_propagation_operations
44 ! Specific beeman propagation operations identifiers
45 character(len=ALGO_LABEL_LEN), public, parameter :: &
46 BEEMAN_START = 'BEEMAN_START', &
47 beeman_finish = 'BEEMAN_FINISH', &
48 beeman_compute_acc = 'BEEMAN_COMPUTE_ACC', &
49 beeman_predict_pos = 'BEEMAN_PREDICT_POS', &
50 beeman_predict_vel = 'BEEMAN_PREDICT_VEL', &
51 beeman_correct_pos = 'BEEMAN_CORRECT_POS', &
52 beeman_correct_vel = 'BEEMAN_CORRECT_VEL'
53
54 ! Specific beeman propagation operations
55 type(algorithmic_operation_t), public, parameter :: &
56 OP_BEEMAN_START = algorithmic_operation_t(beeman_start, 'Starting Beeman propagation'), &
57 op_beeman_finish = algorithmic_operation_t(beeman_finish, 'Finishing Beeman propagation'), &
58 op_beeman_compute_acc = algorithmic_operation_t(beeman_compute_acc, 'Propagation step - Computing acceleration'), &
59 op_beeman_predict_pos = algorithmic_operation_t(beeman_predict_pos, 'Prediction step - Computing position'), &
60 op_beeman_predict_vel = algorithmic_operation_t(beeman_predict_vel, 'Prediction step - Computing velocity'), &
61 op_beeman_correct_pos = algorithmic_operation_t(beeman_correct_pos, 'Correction step - Computing position'), &
62 op_beeman_correct_vel = algorithmic_operation_t(beeman_correct_vel, 'Correction step - Computing velocity')
63 !# doc_end
64
65contains
66
67 ! ---------------------------------------------------------
68 function propagator_beeman_constructor(dt, predictor_corrector) result(this)
69 float, intent(in) :: dt
70 logical, intent(in) :: predictor_corrector
71 type(propagator_beeman_t), pointer :: this
72
74
75 allocate(this)
76
77 this%predictor_corrector = predictor_corrector
78
79 this%start_operation = op_beeman_start
80 this%final_operation = op_beeman_finish
81
82 if (predictor_corrector) then
83
84 call this%add_operation(op_store_current_status)
85 call this%add_operation(op_beeman_predict_pos)
86 call this%add_operation(op_update_couplings)
87 call this%add_operation(op_start_scf_loop)
88 call this%add_operation(op_update_interactions)
89 call this%add_operation(op_beeman_compute_acc)
90 call this%add_operation(op_beeman_correct_pos)
91 call this%add_operation(op_beeman_correct_vel)
92 call this%add_operation(op_end_scf_loop)
93 call this%add_operation(op_iteration_done)
94 call this%add_operation(op_rewind_algorithm)
95
96 this%max_scf_count = 2 !From Wikipedia
97 this%scf_tol = 1e-6_real64 !At the moment arbitrary
98
99 else
100
101 call this%add_operation(op_beeman_predict_pos)
102 call this%add_operation(op_update_couplings)
103 call this%add_operation(op_update_interactions)
104 call this%add_operation(op_beeman_compute_acc)
105 call this%add_operation(op_beeman_predict_vel)
106 call this%add_operation(op_iteration_done)
107 call this%add_operation(op_rewind_algorithm)
108
109 end if
110
111 ! Beeman has only one algorithmic step
112 this%algo_steps = 1
113
114 this%dt = dt
115
118
120
121
122!! Local Variables:
123!! mode: f90
124!! coding: utf-8
125!! 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
type(algorithmic_operation_t), parameter, public op_beeman_finish
type(algorithmic_operation_t), parameter, public op_beeman_correct_pos
character(len=algo_label_len), parameter, public beeman_finish
type(algorithmic_operation_t), parameter, public op_beeman_predict_vel
type(algorithmic_operation_t), parameter, public op_beeman_correct_vel
character(len=algo_label_len), parameter, public beeman_compute_acc
type(algorithmic_operation_t), parameter, public op_beeman_predict_pos
character(len=algo_label_len), parameter, public beeman_correct_pos
type(propagator_beeman_t) function, pointer propagator_beeman_constructor(dt, predictor_corrector)
type(algorithmic_operation_t), parameter, public op_beeman_compute_acc
character(len=algo_label_len), parameter, public beeman_predict_pos
character(len=algo_label_len), parameter, public beeman_correct_vel
character(len=algo_label_len), parameter, public beeman_predict_vel
This module implements the basic propagator framework.
Definition: propagator.F90:108
type(algorithmic_operation_t), parameter, public op_store_current_status
Definition: propagator.F90:163
type(algorithmic_operation_t), parameter, public op_start_scf_loop
Definition: propagator.F90:163
type(algorithmic_operation_t), parameter, public op_end_scf_loop
Definition: propagator.F90:163
Descriptor of one algorithmic operation.
Definition: algorithm.F90:154
Implements the Beeman propagator (with or without SCF)
Abstract class implementing propagators.
Definition: propagator.F90:129