35module adjoint_fluid_scheme
36 use gather_scatter,
only: gs_t
37 use checkpoint,
only: chkp_t
38 use num_types,
only: rp
39 use field,
only: field_t
40 use space,
only: space_t
41 use dofmap,
only: dofmap_t
42 use coefs,
only: coef_t
43 use dirichlet,
only: dirichlet_t
44 use precon,
only: pc_t, precon_factory, precon_destroy
45 use fluid_stats,
only: fluid_stats_t
46 use bc_list,
only: bc_list_t
47 use mesh,
only: mesh_t, neko_msh_max_zlbl_len
48 use time_state,
only: time_state_t
49 use time_scheme_controller,
only: time_scheme_controller_t
50 use logger,
only: log_size
51 use json_module,
only: json_file
52 use user_intf,
only: user_t, user_material_properties_intf
53 use field_series,
only: field_series_t
54 use time_step_controller,
only: time_step_controller_t
55 use field_list,
only : field_list_t
56 use interpolation,
only: interpolator_t
57 use scratch_registry,
only : scratch_registry_t
66 character(len=:),
allocatable :: name
69 type(dofmap_t) :: dm_xh
77 type(space_t) :: xh_gl
78 type(dofmap_t) :: dm_xh_gl
79 type(gs_t) :: gs_xh_gl
80 type(coef_t) :: c_xh_gl
82 type(interpolator_t) :: gll_to_gl
84 type(scratch_registry_t) :: scratch_gl
86 type(time_scheme_controller_t),
allocatable :: ext_bdf
89 type(field_t),
pointer :: u_adj => null()
90 type(field_t),
pointer :: v_adj => null()
91 type(field_t),
pointer :: w_adj => null()
92 type(field_t),
pointer :: p_adj => null()
93 type(field_series_t) :: ulag, vlag, wlag
95 type(field_t),
pointer :: u_b => null()
96 type(field_t),
pointer :: v_b => null()
97 type(field_t),
pointer :: w_b => null()
98 type(field_t),
pointer :: p_b => null()
101 type(chkp_t),
pointer :: chkp => null()
104 type(field_t),
pointer :: f_adj_x => null()
106 type(field_t),
pointer :: f_adj_y => null()
108 type(field_t),
pointer :: f_adj_z => null()
112 type(bc_list_t) :: bcs_prs
114 type(bc_list_t) :: bcs_vel
116 type(json_file),
pointer :: params
117 type(mesh_t),
pointer :: msh => null()
120 character(len=NEKO_MSH_MAX_ZLBL_LEN),
allocatable :: bc_labels(:)
129 type(field_list_t) :: material_properties
132 logical :: freeze = .false.
135 procedure(user_material_properties_intf),
nopass,
pointer :: &
136 user_material_properties => null()
140 procedure(adjoint_fluid_scheme_init_intrf), pass(this),
deferred :: init
142 procedure(adjoint_fluid_scheme_free_intrf), pass(this),
deferred :: free
144 procedure(adjoint_fluid_scheme_step_intrf), pass(this),
deferred :: step
146 procedure(adjoint_fluid_scheme_restart_intrf), &
147 pass(this),
deferred :: restart
149 procedure(adjoint_fluid_scheme_setup_bcs_intrf), pass(this),
deferred :: &
153 procedure(validate_intrf), pass(this),
deferred :: validate
155 procedure(fluid_scheme_base_compute_cfl_intrf), pass(this),
deferred :: compute_cfl
157 procedure(update_material_properties), pass(this),
deferred :: update_material_properties
163 kspp_init, scheme, user)
168 class(adjoint_fluid_scheme_t),
target,
intent(inout) :: this
169 type(mesh_t),
target,
intent(inout) :: msh
170 integer,
intent(inout) :: lx
171 type(json_file),
target,
intent(inout) :: params
172 logical,
intent(inout) :: kspv_init
173 logical,
intent(inout) :: kspp_init
174 type(user_t),
target,
intent(in) :: user
175 character(len=*),
intent(in) :: scheme
181 subroutine adjoint_fluid_init_common_intrf(this, msh, lx, params, scheme, &
187 class(adjoint_fluid_scheme_t),
target,
intent(inout) :: this
188 type(mesh_t),
target,
intent(inout) :: msh
189 integer,
intent(inout) :: lx
190 character(len=*),
intent(in) :: scheme
191 type(json_file),
target,
intent(inout) :: params
192 type(user_t),
target,
intent(in) :: user
193 logical,
intent(in) :: kspv_init
194 end subroutine adjoint_fluid_init_common_intrf
199 subroutine adjoint_fluid_free_intrf(this)
201 class(adjoint_fluid_scheme_t),
intent(inout) :: this
202 end subroutine adjoint_fluid_free_intrf
207 subroutine adjoint_fluid_scheme_init_intrf(this, msh, lx, params, user, &
214 class(adjoint_fluid_scheme_t),
target,
intent(inout) :: this
215 type(mesh_t),
target,
intent(inout) :: msh
216 integer,
intent(in) :: lx
217 type(json_file),
target,
intent(inout) :: params
218 type(user_t),
target,
intent(in) :: user
219 type(chkp_t),
target,
intent(inout) :: chkp
220 end subroutine adjoint_fluid_scheme_init_intrf
225 subroutine adjoint_fluid_scheme_free_intrf(this)
227 class(adjoint_fluid_scheme_t),
intent(inout) :: this
228 end subroutine adjoint_fluid_scheme_free_intrf
233 subroutine adjoint_fluid_scheme_step_intrf(this, time, dt_controller)
236 import time_step_controller_t
237 class(adjoint_fluid_scheme_t),
target,
intent(inout) :: this
238 type(time_state_t),
intent(in) :: time
239 type(time_step_controller_t),
intent(in) :: dt_controller
240 end subroutine adjoint_fluid_scheme_step_intrf
245 subroutine adjoint_fluid_scheme_restart_intrf(this, chkp)
248 class(adjoint_fluid_scheme_t),
target,
intent(inout) :: this
249 type(chkp_t),
intent(inout) :: chkp
250 end subroutine adjoint_fluid_scheme_restart_intrf
255 subroutine adjoint_fluid_scheme_setup_bcs_intrf(this, user, params)
257 class(adjoint_fluid_scheme_t),
intent(inout) :: this
258 type(user_t),
target,
intent(in) :: user
259 type(json_file),
intent(inout) :: params
260 end subroutine adjoint_fluid_scheme_setup_bcs_intrf
265 subroutine validate_intrf(this)
267 class(adjoint_fluid_scheme_t),
target,
intent(inout) :: this
268 end subroutine validate_intrf
273 subroutine update_material_properties(this, time)
275 class(adjoint_fluid_scheme_t),
intent(inout) :: this
276 type(time_state_t),
intent(in) :: time
277 end subroutine update_material_properties
282 function fluid_scheme_base_compute_cfl_intrf(this, dt)
result(c)
285 class(adjoint_fluid_scheme_t),
intent(in) :: this
286 real(kind=rp),
intent(in) :: dt
288 end function fluid_scheme_base_compute_cfl_intrf
293 module subroutine adjoint_fluid_scheme_factory(object, type_name)
294 class(adjoint_fluid_scheme_t),
intent(inout),
allocatable :: object
295 character(len=*) :: type_name
296 end subroutine adjoint_fluid_scheme_factory
298end module adjoint_fluid_scheme
Base type of all fluid formulations.