43 real(real64),
allocatable :: acc(:,:)
44 real(real64),
allocatable :: prev_acc(:,:,:)
45 real(real64),
allocatable :: save_pos(:,:)
46 real(real64),
allocatable :: save_vel(:,:)
47 real(real64),
allocatable :: prev_tot_force(:,:)
48 real(real64),
allocatable :: prev_pos(:,:,:)
49 real(real64),
allocatable :: prev_vel(:,:,:)
50 real(real64),
allocatable :: hamiltonian_elements(:,:)
51 logical :: initialized = .false.
57 procedure :: propagator_data_copy
58 generic ::
assignment(=) => propagator_data_copy
64 class(propagator_data_t),
intent(inout) :: this
65 type(namespace_t),
intent(in) :: namespace
66 class(algorithm_t),
intent(in) :: prop
68 type(restart_basic_t) :: restart
69 integer :: restart_file_unit
77 restart_file_unit = restart%open(
'restart_classical_particles_propagation')
78 if (restart%do_i_write())
then
82 write(restart_file_unit,*) this%acc(:,:)
83 write(restart_file_unit,*) this%prev_acc(:,:,:)
85 write(restart_file_unit,*) this%acc(:,:)
86 write(restart_file_unit,*) this%prev_acc(:,:,:)
87 if (prop%predictor_corrector)
then
88 write(restart_file_unit,*) this%prev_tot_force(:,:)
89 write(restart_file_unit,*) this%save_vel(:,:)
90 write(restart_file_unit,*) this%save_pos(:,:)
93 write(restart_file_unit,*) this%prev_vel(:,:,:)
94 write(restart_file_unit,*) this%prev_pos(:,:,:)
95 write(restart_file_unit,*) this%save_vel(:,:)
96 write(restart_file_unit,*) this%save_pos(:,:)
100 call restart%close(restart_file_unit)
109 class(propagator_data_t),
intent(inout) :: this
110 type(namespace_t),
intent(in) :: namespace
111 class(algorithm_t),
intent(in) :: prop
113 type(restart_basic_t) :: restart
114 integer :: restart_file_unit
120 restart_file_unit = restart%open(
'restart_classical_particles_propagation')
121 if (restart_file_unit /= -1)
then
124 read(restart_file_unit,*) this%acc(:,:)
125 read(restart_file_unit,*) this%prev_acc(:,:,:)
128 read(restart_file_unit,*) this%acc(:,:)
129 read(restart_file_unit,*) this%prev_acc(:,:,:)
130 if (prop%predictor_corrector)
then
131 read(restart_file_unit,*) this%prev_tot_force(:,:)
132 read(restart_file_unit,*) this%save_vel(:,:)
133 read(restart_file_unit,*) this%save_pos(:,:)
136 read(restart_file_unit,*) this%prev_vel(:,:,:)
137 read(restart_file_unit,*) this%prev_pos(:,:,:)
138 read(restart_file_unit,*) this%save_vel(:,:)
139 read(restart_file_unit,*) this%save_pos(:,:)
142 call restart%close(restart_file_unit)
158 integer,
intent(in) :: dim
159 integer,
intent(in) :: np
163 if (.not. this%initialized)
then
166 safe_allocate(this%acc(1:dim, 1:np))
167 safe_allocate(this%prev_acc(1:dim, 1:np, 1))
169 if (prop%predictor_corrector)
then
170 safe_allocate(this%save_pos(1:dim, 1:np))
171 safe_allocate(this%save_vel(1:dim, 1:np))
172 safe_allocate(this%prev_tot_force(1:dim, 1:np))
174 safe_allocate(this%acc(1:dim, 1:np))
175 safe_allocate(this%prev_acc(1:dim, 1:np, 1:2))
177 safe_allocate(this%save_pos(1:dim, 1:np))
178 safe_allocate(this%save_vel(1:dim, 1:np))
179 safe_allocate(this%hamiltonian_elements(1:dim, 1:np))
180 safe_allocate(this%prev_pos(1:dim, 1:np, 1))
181 safe_allocate(this%prev_vel(1:dim, 1:np, 1))
183 this%initialized = .
true.
195 safe_deallocate_a(this%acc)
196 safe_deallocate_a(this%prev_acc)
197 safe_deallocate_a(this%prev_tot_force)
198 safe_deallocate_a(this%save_pos)
199 safe_deallocate_a(this%save_vel)
200 safe_deallocate_a(this%hamiltonian_elements)
201 safe_deallocate_a(this%prev_pos)
202 safe_deallocate_a(this%prev_vel)
214 safe_allocate_source_a(this%acc, prop_data_in%acc)
215 safe_allocate_source_a(this%prev_acc, prop_data_in%prev_acc)
216 safe_allocate_source_a(this%save_pos, prop_data_in%save_pos)
217 safe_allocate_source_a(this%save_vel, prop_data_in%save_vel)
218 safe_allocate_source_a(this%prev_tot_force, prop_data_in%prev_tot_force)
219 safe_allocate_source_a(this%prev_pos, prop_data_in%prev_pos)
220 safe_allocate_source_a(this%prev_vel, prop_data_in%prev_vel)
221 safe_allocate_source_a(this%hamiltonian_elements, prop_data_in%hamiltonian_elements)
This module implements the basic elements defining algorithms.
logical function propagator_data_restart_read(this, namespace, prop)
subroutine propagator_data_end(this)
subroutine propagator_data_copy(this, prop_data_in)
subroutine propagator_data_initialize(this, prop, dim, np)
subroutine propagator_data_restart_write(this, namespace, prop)
This module implements the basic propagator framework.
integer, parameter, public restart_type_dump
integer, parameter, public restart_td
integer, parameter, public restart_type_load
An algorithm is a list of algorithmic operations executed sequentially.
Implements the Beeman propagator (with or without SCF)
Implements the implicit exponential midpoint propagator with predictor-corrector.
Implements a propagator for the velocity Verlet algorithm.