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
54 use interpolation,
only: interpolator_t
55 use scratch_registry,
only : scratch_registry_t
64 character(len=:),
allocatable :: name
67 type(dofmap_t) :: dm_xh
75 type(space_t) :: xh_gl
76 type(dofmap_t) :: dm_xh_gl
77 type(gs_t) :: gs_xh_gl
78 type(coef_t) :: c_xh_gl
80 type(interpolator_t) :: gll_to_gl
82 type(scratch_registry_t) :: scratch_gl
84 type(time_scheme_controller_t),
allocatable :: ext_bdf
87 type(field_t),
pointer :: u_adj => null()
88 type(field_t),
pointer :: v_adj => null()
89 type(field_t),
pointer :: w_adj => null()
90 type(field_t),
pointer :: p_adj => null()
91 type(field_series_t) :: ulag, vlag, wlag
93 type(field_t),
pointer :: u_b => null()
94 type(field_t),
pointer :: v_b => null()
95 type(field_t),
pointer :: w_b => null()
96 type(field_t),
pointer :: p_b => null()
99 type(chkp_t),
pointer :: chkp => null()
102 type(field_t),
pointer :: f_adj_x => null()
104 type(field_t),
pointer :: f_adj_y => null()
106 type(field_t),
pointer :: f_adj_z => null()
110 type(bc_list_t) :: bcs_prs
112 type(bc_list_t) :: bcs_vel
114 type(json_file),
pointer :: params
115 type(mesh_t),
pointer :: msh => null()
118 character(len=NEKO_MSH_MAX_ZLBL_LEN),
allocatable :: bc_labels(:)
127 type(field_list_t) :: material_properties
130 logical :: freeze = .false.
133 procedure(user_material_properties_intf),
nopass,
pointer :: &
134 user_material_properties => null()
138 procedure(adjoint_fluid_scheme_init_intrf), pass(this),
deferred :: init
140 procedure(adjoint_fluid_scheme_free_intrf), pass(this),
deferred :: free
142 procedure(adjoint_fluid_scheme_step_intrf), pass(this),
deferred :: step
144 procedure(adjoint_fluid_scheme_restart_intrf), &
145 pass(this),
deferred :: restart
147 procedure(adjoint_fluid_scheme_setup_bcs_intrf), pass(this),
deferred :: &
151 procedure(validate_intrf), pass(this),
deferred :: validate
153 procedure(fluid_scheme_base_compute_cfl_intrf), pass(this),
deferred :: compute_cfl
155 procedure(update_material_properties), pass(this),
deferred :: update_material_properties
161 kspp_init, scheme, user)
166 class(adjoint_fluid_scheme_t),
target,
intent(inout) :: this
167 type(mesh_t),
target,
intent(inout) :: msh
168 integer,
intent(inout) :: lx
169 type(json_file),
target,
intent(inout) :: params
170 logical,
intent(inout) :: kspv_init
171 logical,
intent(inout) :: kspp_init
172 type(user_t),
target,
intent(in) :: user
173 character(len=*),
intent(in) :: scheme
179 subroutine adjoint_fluid_init_common_intrf(this, msh, lx, params, scheme, &
185 class(adjoint_fluid_scheme_t),
target,
intent(inout) :: this
186 type(mesh_t),
target,
intent(inout) :: msh
187 integer,
intent(inout) :: lx
188 character(len=*),
intent(in) :: scheme
189 type(json_file),
target,
intent(inout) :: params
190 type(user_t),
target,
intent(in) :: user
191 logical,
intent(in) :: kspv_init
192 end subroutine adjoint_fluid_init_common_intrf
197 subroutine adjoint_fluid_free_intrf(this)
199 class(adjoint_fluid_scheme_t),
intent(inout) :: this
200 end subroutine adjoint_fluid_free_intrf
205 subroutine adjoint_fluid_scheme_init_intrf(this, msh, lx, params, user, &
212 class(adjoint_fluid_scheme_t),
target,
intent(inout) :: this
213 type(mesh_t),
target,
intent(inout) :: msh
214 integer,
intent(in) :: lx
215 type(json_file),
target,
intent(inout) :: params
216 type(user_t),
target,
intent(in) :: user
217 type(chkp_t),
target,
intent(inout) :: chkp
218 end subroutine adjoint_fluid_scheme_init_intrf
223 subroutine adjoint_fluid_scheme_free_intrf(this)
225 class(adjoint_fluid_scheme_t),
intent(inout) :: this
226 end subroutine adjoint_fluid_scheme_free_intrf
231 subroutine adjoint_fluid_scheme_step_intrf(this, time, dt_controller)
234 import time_step_controller_t
235 class(adjoint_fluid_scheme_t),
target,
intent(inout) :: this
236 type(time_state_t),
intent(in) :: time
237 type(time_step_controller_t),
intent(in) :: dt_controller
238 end subroutine adjoint_fluid_scheme_step_intrf
243 subroutine adjoint_fluid_scheme_restart_intrf(this, chkp)
246 class(adjoint_fluid_scheme_t),
target,
intent(inout) :: this
247 type(chkp_t),
intent(inout) :: chkp
248 end subroutine adjoint_fluid_scheme_restart_intrf
253 subroutine adjoint_fluid_scheme_setup_bcs_intrf(this, user, params)
255 class(adjoint_fluid_scheme_t),
intent(inout) :: this
256 type(user_t),
target,
intent(in) :: user
257 type(json_file),
intent(inout) :: params
258 end subroutine adjoint_fluid_scheme_setup_bcs_intrf
263 subroutine validate_intrf(this)
265 class(adjoint_fluid_scheme_t),
target,
intent(inout) :: this
266 end subroutine validate_intrf
271 subroutine update_material_properties(this, time)
273 class(adjoint_fluid_scheme_t),
intent(inout) :: this
274 type(time_state_t),
intent(in) :: time
275 end subroutine update_material_properties
280 function fluid_scheme_base_compute_cfl_intrf(this, dt)
result(c)
283 class(adjoint_fluid_scheme_t),
intent(in) :: this
284 real(kind=rp),
intent(in) :: dt
286 end function fluid_scheme_base_compute_cfl_intrf
291 module subroutine adjoint_fluid_scheme_factory(object, type_name)
292 class(adjoint_fluid_scheme_t),
intent(inout),
allocatable :: object
293 character(len=*) :: type_name
294 end subroutine adjoint_fluid_scheme_factory
296end module adjoint_fluid_scheme
Base type of all fluid formulations.