Octopus
propagator_rk4.F90
Go to the documentation of this file.
1!! Copyright (C) 2023 Sebastian Ohlmann
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_rk4_t
35 private
36 end type propagator_rk4_t
37
38 interface propagator_rk4_t
39 procedure propagator_rk4_constructor
40 end interface propagator_rk4_t
41
42 !# doc_start rk4_propagation_operations
43 ! Specific exponential mid-point propagation operations identifiers
44 character(len=ALGO_LABEL_LEN), public, parameter :: &
45 RK4_START = 'RK4_START', &
46 rk4_finish = 'RK4_FINISH', &
47 rk4_extrapolate = 'RK4_EXTRAPOLATE', &
48 rk4_propagate = 'RK4_PROPAGATE'
49
50 ! Specific exponential mid-point propagation operations
51 type(algorithmic_operation_t), public, parameter :: &
52 OP_RK4_START = algorithmic_operation_t(rk4_start, 'Starting RK4'), &
54 op_rk4_extrapolate = algorithmic_operation_t(rk4_extrapolate, 'Extrapolate to dt/2 and dt for RK4'), &
55 op_rk4_propagate = algorithmic_operation_t(rk4_propagate, 'Propagation step for RK4')
56 !# doc_end
57
58contains
59
60 ! ---------------------------------------------------------
61 function propagator_rk4_constructor(dt) result(this)
62 float, intent(in) :: dt
63 type(propagator_rk4_t), pointer :: this
64
66
67 allocate(this)
68
69 this%predictor_corrector = .false.
70 this%start_operation = op_rk4_start
71 this%final_operation = op_rk4_finish
72
73 call this%add_operation(op_rk4_extrapolate)
74 call this%add_operation(op_rk4_propagate)
75 call this%add_operation(op_update_couplings)
76 call this%add_operation(op_update_interactions)
77 call this%add_operation(op_iteration_done)
78 call this%add_operation(op_rewind_algorithm)
79
80 this%algo_steps = 1
81 this%dt = dt
82
85
86end module propagator_rk4_oct_m
87
88
89!! Local Variables:
90!! mode: f90
91!! coding: utf-8
92!! 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=algo_label_len), parameter, public rk4_finish
type(algorithmic_operation_t), parameter, public op_rk4_extrapolate
type(algorithmic_operation_t), parameter, public op_rk4_finish
character(len=algo_label_len), parameter, public rk4_propagate
type(propagator_rk4_t) function, pointer propagator_rk4_constructor(dt)
type(algorithmic_operation_t), parameter, public op_rk4_propagate
character(len=algo_label_len), parameter, public rk4_extrapolate
Descriptor of one algorithmic operation.
Definition: algorithm.F90:154
Abstract class implementing propagators.
Definition: propagator.F90:129
Implements a the 4th order Runge Kutta propagator.