36 use,
intrinsic :: iso_c_binding
43 use,
intrinsic :: iso_c_binding
45 character(kind=c_char),
dimension(*) :: scheme_name
46 integer(c_int),
value :: scheme_name_len
53 use,
intrinsic :: iso_c_binding
56 type(c_ptr),
value :: msk
57 integer(c_int),
value :: msk_size
58 real(kind=c_rp),
value :: t
59 integer(c_int),
value :: tstep
67 use,
intrinsic :: iso_c_binding
70 character(kind=c_char),
dimension(*) :: scheme_name
71 integer(c_int),
value :: scheme_name_len
72 real(kind=c_rp),
value :: t
73 integer(c_int),
value :: tstep
81 use,
intrinsic :: iso_c_binding
84 real(kind=c_rp),
value :: t
85 integer(c_int),
value :: tstep
124 compute_cb, dirichlet_cb, material_cb, source_cb)
125 type(user_t),
intent(inout) ::
user
126 type(c_funptr),
value :: initial_cb, preprocess_cb, compute_cb
127 type(c_funptr),
value :: dirichlet_cb, material_cb, source_cb
145 if (c_associated(initial_cb))
then
149 call c_f_procpointer(initial_cb, tmp)
154 if (c_associated(preprocess_cb))
then
158 call c_f_procpointer(preprocess_cb, tmp)
163 if (c_associated(compute_cb))
then
167 call c_f_procpointer(compute_cb, tmp)
172 if (c_associated(dirichlet_cb))
then
176 call c_f_procpointer(dirichlet_cb, tmp)
181 if (c_associated(material_cb))
then
185 call c_f_procpointer(material_cb, tmp)
190 if (c_associated(source_cb))
then
194 call c_f_procpointer(source_cb, tmp)
203 character(len=*),
intent(in) :: scheme_name
204 type(field_list_t),
intent(inout) :: fields
209 call neko_error(
"Initial condition callback not defined")
216 type(time_state_t),
intent(in) :: time
221 call neko_error(
"Preprocessing callback not defined")
228 type(time_state_t),
intent(in) :: time
233 call neko_error(
"Compute callback not defined")
240 type(field_list_t),
intent(inout) :: fields
241 type(field_dirichlet_t),
intent(in) :: bc
242 type(time_state_t),
intent(in) :: time
243 type(c_ptr) :: bc_msk
252 call neko_error(
"Dirichlet condition callback not defined")
260 type(field_dirichlet_t),
intent(in),
target ::
bc
261 type(c_ptr) :: bc_ptr
262 bc_ptr = c_loc(
bc%msk(1))
269 character(len=*),
intent(in) :: scheme_name
270 type(field_list_t),
intent(inout) :: properties
271 type(time_state_t),
intent(in) :: time
277 len_trim(scheme_name),time%t, time%tstep)
279 call neko_error(
"Material properties callback not defined")
287 character(len=*),
intent(in) :: scheme_name
288 type(field_list_t),
intent(inout) :: rhs
289 type(time_state_t),
intent(in) :: time
295 len_trim(scheme_name),time%t, time%tstep)
297 call neko_error(
"Source term callback not defined")
305 type(field_list_t),
target,
intent(inout) :: fields
308 call neko_error(
"Callback field list already defined")
316 character(len=*),
intent(in) :: field_name
317 type(field_t),
pointer :: f
320 call neko_error(
"Callback field list not defined")
330 integer,
intent(in) :: field_idx
331 type(field_t),
pointer :: f
334 call neko_error(
"Callback field list not defined")
Abstract interface for boundary condition callbacks.
Abstract interface for callbacks requiring a field list and time Used for material properties and sou...
Abstract interface for generic callbacks requiring only time Used for preprocess and compute callback...
Abstract interface for initial condition callbacks.
Defines a boundary condition.
Defines a dirichlet boundary condition.
subroutine, public neko_api_user_cb_register(user, initial_cb, preprocess_cb, compute_cb, dirichlet_cb, material_cb, source_cb)
Register callbacks.
type(field_t) function, pointer neko_api_user_cb_get_field_by_name(field_name)
Retrive a pointer to a field for the currently active callback.
subroutine neko_api_set_cb_field_list(fields)
Set the callbacks active field list.
type(field_t) function, pointer neko_api_user_cb_get_field_by_index(field_idx)
Retrive a pointer to a field for the currently active callback.
subroutine neko_api_user_preprocess(time)
API user preprocessing callback caller.
subroutine neko_api_user_dirichlet_condition(fields, bc, time)
API user dirichlet condition callback caller.
type(api_user_cb), allocatable neko_api_user_cb
Registered callbacks in the API.
subroutine neko_api_user_compute(time)
API user compute callback caller.
subroutine neko_api_user_material_properties(scheme_name, properties, time)
API user material properties callback caller.
subroutine neko_api_user_source_term(scheme_name, rhs, time)
API user source term callback caller.
subroutine neko_api_user_initial_condition(scheme_name, fields)
API user initial condition callback caller.
type(field_list_t), pointer neko_api_cb_field_list
Pointer to an active field_list_t in a callback.
type(c_ptr) function neko_api_user_bc_msk_ptr(bc)
Helper function to extract a pointer to the mask.
Type defining all supported callbacks via the API.