33module adjoint_fluid_scheme
34 use gather_scatter,
only: gs_t
35 use checkpoint,
only: chkp_t
36 use num_types,
only: rp
37 use field,
only: field_t
38 use space,
only: space_t
39 use dofmap,
only: dofmap_t
40 use coefs,
only: coef_t
41 use dirichlet,
only: dirichlet_t
42 use precon,
only: pc_t, precon_factory, precon_destroy
43 use fluid_stats,
only: fluid_stats_t
44 use bc_list,
only: bc_list_t
45 use mesh,
only: mesh_t, neko_msh_max_zlbl_len
46 use time_state,
only: time_state_t
47 use time_scheme_controller,
only: time_scheme_controller_t
48 use logger,
only: log_size
49 use json_module,
only: json_file
50 use user_intf,
only: user_t, user_material_properties_intf
51 use field_series,
only: field_series_t
52 use time_step_controller,
only: time_step_controller_t
53 use field_list,
only : field_list_t
62 character(len=:),
allocatable :: name
65 type(dofmap_t) :: dm_xh
69 type(time_scheme_controller_t),
allocatable :: ext_bdf
72 type(field_t),
pointer :: u_adj => null()
73 type(field_t),
pointer :: v_adj => null()
74 type(field_t),
pointer :: w_adj => null()
75 type(field_t),
pointer :: p_adj => null()
76 type(field_series_t) :: ulag, vlag, wlag
78 type(field_t),
pointer :: u_b => null()
79 type(field_t),
pointer :: v_b => null()
80 type(field_t),
pointer :: w_b => null()
81 type(field_t),
pointer :: p_b => null()
84 type(chkp_t),
pointer :: chkp => null()
87 type(field_t),
pointer :: f_adj_x => null()
89 type(field_t),
pointer :: f_adj_y => null()
91 type(field_t),
pointer :: f_adj_z => null()
95 type(bc_list_t) :: bcs_prs
97 type(bc_list_t) :: bcs_vel
99 type(json_file),
pointer :: params
100 type(mesh_t),
pointer :: msh => null()
103 character(len=NEKO_MSH_MAX_ZLBL_LEN),
allocatable :: bc_labels(:)
112 type(field_list_t) :: material_properties
115 logical :: freeze = .false.
118 procedure(user_material_properties_intf),
nopass,
pointer :: &
119 user_material_properties => null()
123 procedure(adjoint_fluid_scheme_init_intrf), pass(this),
deferred :: init
125 procedure(adjoint_fluid_scheme_free_intrf), pass(this),
deferred :: free
127 procedure(adjoint_fluid_scheme_step_intrf), pass(this),
deferred :: step
129 procedure(adjoint_fluid_scheme_restart_intrf), &
130 pass(this),
deferred :: restart
132 procedure(adjoint_fluid_scheme_setup_bcs_intrf), pass(this),
deferred :: &
136 procedure(validate_intrf), pass(this),
deferred :: validate
138 procedure(fluid_scheme_base_compute_cfl_intrf), pass(this),
deferred :: compute_cfl
140 procedure(update_material_properties), pass(this),
deferred :: update_material_properties
146 kspp_init, scheme, user)
151 class(adjoint_fluid_scheme_t),
target,
intent(inout) :: this
152 type(mesh_t),
target,
intent(inout) :: msh
153 integer,
intent(inout) :: lx
154 type(json_file),
target,
intent(inout) :: params
155 logical,
intent(inout) :: kspv_init
156 logical,
intent(inout) :: kspp_init
157 type(user_t),
target,
intent(in) :: user
158 character(len=*),
intent(in) :: scheme
164 subroutine adjoint_fluid_init_common_intrf(this, msh, lx, params, scheme, &
170 class(adjoint_fluid_scheme_t),
target,
intent(inout) :: this
171 type(mesh_t),
target,
intent(inout) :: msh
172 integer,
intent(inout) :: lx
173 character(len=*),
intent(in) :: scheme
174 type(json_file),
target,
intent(inout) :: params
175 type(user_t),
target,
intent(in) :: user
176 logical,
intent(in) :: kspv_init
177 end subroutine adjoint_fluid_init_common_intrf
182 subroutine adjoint_fluid_free_intrf(this)
184 class(adjoint_fluid_scheme_t),
intent(inout) :: this
185 end subroutine adjoint_fluid_free_intrf
190 subroutine adjoint_fluid_scheme_init_intrf(this, msh, lx, params, user, &
197 class(adjoint_fluid_scheme_t),
target,
intent(inout) :: this
198 type(mesh_t),
target,
intent(inout) :: msh
199 integer,
intent(in) :: lx
200 type(json_file),
target,
intent(inout) :: params
201 type(user_t),
target,
intent(in) :: user
202 type(chkp_t),
target,
intent(inout) :: chkp
203 end subroutine adjoint_fluid_scheme_init_intrf
208 subroutine adjoint_fluid_scheme_free_intrf(this)
210 class(adjoint_fluid_scheme_t),
intent(inout) :: this
211 end subroutine adjoint_fluid_scheme_free_intrf
216 subroutine adjoint_fluid_scheme_step_intrf(this, time, dt_controller)
219 import time_step_controller_t
220 class(adjoint_fluid_scheme_t),
target,
intent(inout) :: this
221 type(time_state_t),
intent(in) :: time
222 type(time_step_controller_t),
intent(in) :: dt_controller
223 end subroutine adjoint_fluid_scheme_step_intrf
228 subroutine adjoint_fluid_scheme_restart_intrf(this, chkp)
231 class(adjoint_fluid_scheme_t),
target,
intent(inout) :: this
232 type(chkp_t),
intent(inout) :: chkp
233 end subroutine adjoint_fluid_scheme_restart_intrf
238 subroutine adjoint_fluid_scheme_setup_bcs_intrf(this, user, params)
240 class(adjoint_fluid_scheme_t),
intent(inout) :: this
241 type(user_t),
target,
intent(in) :: user
242 type(json_file),
intent(inout) :: params
243 end subroutine adjoint_fluid_scheme_setup_bcs_intrf
248 subroutine validate_intrf(this)
250 class(adjoint_fluid_scheme_t),
target,
intent(inout) :: this
251 end subroutine validate_intrf
256 subroutine update_material_properties(this, time)
258 class(adjoint_fluid_scheme_t),
intent(inout) :: this
259 type(time_state_t),
intent(in) :: time
260 end subroutine update_material_properties
265 function fluid_scheme_base_compute_cfl_intrf(this, dt)
result(c)
268 class(adjoint_fluid_scheme_t),
intent(in) :: this
269 real(kind=rp),
intent(in) :: dt
271 end function fluid_scheme_base_compute_cfl_intrf
276 module subroutine adjoint_fluid_scheme_factory(object, type_name)
277 class(adjoint_fluid_scheme_t),
intent(inout),
allocatable :: object
278 character(len=*) :: type_name
279 end subroutine adjoint_fluid_scheme_factory
281end module adjoint_fluid_scheme
Base type of all fluid formulations.