Neko-TOP
A portable framework for high-order spectral element flow toplogy optimization.
Loading...
Searching...
No Matches
state_recover.f90
Go to the documentation of this file.
1
34!
48 use case, only: case_t
49 use json_file_module, only: json_file
50 implicit none
51 private
52
54 type, abstract, public :: state_recover_t
55 private
57 class(case_t), pointer, public :: neko_case => null()
59 integer :: n_timesteps = 0
60 contains
61 procedure(state_recover_init), pass(this), public, deferred :: init
62 procedure(state_recover_free), pass(this), public, deferred :: free
63 procedure(state_recover_reset), pass(this), public, deferred :: reset
64 procedure(state_recover_save), pass(this), public, deferred :: save
65 procedure(state_recover_restore), pass(this), public, deferred :: restore
66 procedure, pass(this), public :: get_n_timesteps => &
67 state_recover_get_n_timesteps
68 procedure, pass(this), public :: set_n_timesteps => &
69 state_recover_set_n_timesteps
70 end type state_recover_t
71
72 abstract interface
73
77 subroutine state_recover_init(this, neko_case, params)
78 import state_recover_t, case_t, json_file
79 class(state_recover_t), intent(inout) :: this
80 class(case_t), target, intent(inout) :: neko_case
81 type(json_file), intent(inout) :: params
82 end subroutine state_recover_init
83
86 subroutine state_recover_free(this)
87 import state_recover_t
88 class(state_recover_t), intent(inout) :: this
89 end subroutine state_recover_free
90
93 subroutine state_recover_reset(this)
94 import state_recover_t
95 class(state_recover_t), intent(inout) :: this
96 end subroutine state_recover_reset
97
100 subroutine state_recover_save(this)
101 import state_recover_t
102 class(state_recover_t), intent(inout) :: this
103 end subroutine state_recover_save
104
108 subroutine state_recover_restore(this, tstep)
109 import state_recover_t
110 class(state_recover_t), intent(inout) :: this
111 integer, intent(in) :: tstep
112 end subroutine state_recover_restore
113 end interface
114
115 interface
116 ! Construct and initialize a state recovery object from JSON parameters.
117 module subroutine state_recover_factory(recover, neko_case, params)
118 class(state_recover_t), allocatable, intent(inout) :: recover
119 class(case_t), target, intent(inout) :: neko_case
120 type(json_file), intent(inout) :: params
121 end subroutine state_recover_factory
122 end interface
123
124 public :: state_recover_factory
125
126contains
127
130 pure function state_recover_get_n_timesteps(this) result(n)
131 class(state_recover_t), intent(in) :: this
132 integer :: n
133
134 n = this%n_timesteps
135 end function state_recover_get_n_timesteps
136
140 subroutine state_recover_set_n_timesteps(this, n)
141 class(state_recover_t), intent(inout) :: this
142 integer, intent(in) :: n
143
144 this%n_timesteps = n
145 end subroutine state_recover_set_n_timesteps
146
147end module state_recover
Initialize state recovery from JSON parameters.
Abstract interface for state recovery strategies.
Abstract base type for state recovery implementations.