Octopus
minimizer_static.F90
Go to the documentation of this file.
1!! Copyright (C) 2024 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
28 use system_oct_m
29
30 implicit none
31
32 private
33 public :: &
35
38 private
39 contains
40 procedure :: finished => minimizer_static_finished
41 end type minimizer_static_t
42
43 interface minimizer_static_t
44 procedure minimizer_static_constructor
45 end interface minimizer_static_t
46
47contains
48
49 ! ---------------------------------------------------------
50 function minimizer_static_constructor() result(this)
51 type(minimizer_static_t), pointer :: this
52
54
55 allocate(this)
56
57 this%start_operation = op_skip
58 this%final_operation = op_skip
59
60 call this%add_operation(op_update_couplings)
61 call this%add_operation(op_update_interactions)
62 call this%add_operation(op_iteration_done)
63 call this%add_operation(op_rewind_algorithm)
64
65 this%algo_steps = 1
66
69
70
71 ! ---------------------------------------------------------
75 logical function minimizer_static_finished(this) result(finished)
76 class(minimizer_static_t), intent(in) :: this
77
78 class(interaction_t), pointer :: interaction
79 type(interaction_iterator_t) :: iter
80
81 finished = minimizer_algorithm_finished(this)
82 if (finished) return
83
84 finished = .true.
85 call iter%start(this%system%interactions)
86 do while (iter%has_next())
87 interaction => iter%get_next()
88
89 select type (partner => interaction%partner)
90 class is (system_t)
91
92 finished = finished .and. partner%algo%finished()
93 end select
94 end do
95 end function minimizer_static_finished
96
97
99
100!!o, Local Variables:
101!! mode: f90
102!! coding: utf-8
103!! End:
This module implements the basic elements defining algorithms.
Definition: algorithm.F90:141
type(algorithmic_operation_t), parameter, public op_iteration_done
Definition: algorithm.F90:179
type(algorithmic_operation_t), parameter, public op_rewind_algorithm
Definition: algorithm.F90:179
type(algorithmic_operation_t), parameter, public op_update_couplings
Definition: algorithm.F90:179
type(algorithmic_operation_t), parameter, public op_skip
Definition: algorithm.F90:179
type(algorithmic_operation_t), parameter, public op_update_interactions
Definition: algorithm.F90:179
This module defines the abstract interaction_t class, and some auxiliary classes for interactions.
This module defines classes and functions for interaction partners.
This module implements the basic minimizer framework.
logical function, public minimizer_algorithm_finished(this)
indicate whether a minimizer has reached the final time
type(minimizer_static_t) function, pointer minimizer_static_constructor()
logical function minimizer_static_finished(this)
indicate whether a static minimizer is finished
This module implements the abstract system type.
Definition: system.F90:118
Abstract class implementing minimizers.
Implements a static minimizer that keeps the state of the system constant.
Abstract class for systems.
Definition: system.F90:172
int true(void)