35 use,
intrinsic :: iso_c_binding, only: c_ptr, c_int
44 S_d, S_lag1_d, S_lag2_d, S_lag3_d, &
45 bdf1, bdf2, bdf3, bdf4, dt, n) &
46 bind(c, name =
'hip_entropy_visc_compute_residual')
47 use,
intrinsic :: iso_c_binding
49 type(c_ptr),
value :: entropy_residual_d
50 type(c_ptr),
value :: S_d, S_lag1_d, S_lag2_d, S_lag3_d
51 real(c_rp) :: bdf1, bdf2, bdf3, bdf4, dt
58 entropy_residual_d, h_d, c_avisc_entropy, n_S, n) &
59 bind(c, name =
'hip_entropy_visc_compute_viscosity')
60 use,
intrinsic :: iso_c_binding
62 type(c_ptr),
value :: reg_coeff_d, entropy_residual_d, h_d
63 real(c_rp) :: c_avisc_entropy, n_S
70 bind(c, name =
'hip_entropy_visc_apply_element_max')
71 use,
intrinsic :: iso_c_binding
72 type(c_ptr),
value :: reg_coeff_d
73 integer(c_int) :: lx, nelv
79 h_d, max_wave_speed_d, c_avisc_low, n) &
80 bind(c, name =
'hip_entropy_visc_clamp_to_low_order')
81 use,
intrinsic :: iso_c_binding
83 type(c_ptr),
value :: reg_coeff_d, h_d, max_wave_speed_d
84 real(c_rp) :: c_avisc_low
91 temp_field_d, mult_field_d, n) &
92 bind(c, name =
'hip_entropy_visc_smooth_divide')
93 use,
intrinsic :: iso_c_binding
94 type(c_ptr),
value :: reg_coeff_d, temp_field_d, mult_field_d
102 S_d, S_lag1_d, S_lag2_d, S_lag3_d, &
103 bdf1, bdf2, bdf3, bdf4, dt, n) &
104 bind(c, name =
'cuda_entropy_visc_compute_residual')
105 use,
intrinsic :: iso_c_binding
107 type(c_ptr),
value :: entropy_residual_d
108 type(c_ptr),
value :: S_d, S_lag1_d, S_lag2_d, S_lag3_d
109 real(c_rp) :: bdf1, bdf2, bdf3, bdf4, dt
116 entropy_residual_d, h_d, c_avisc_entropy, n_S, n) &
117 bind(c, name =
'cuda_entropy_visc_compute_viscosity')
118 use,
intrinsic :: iso_c_binding
120 type(c_ptr),
value :: reg_coeff_d, entropy_residual_d, h_d
121 real(c_rp) :: c_avisc_entropy, n_S
128 bind(c, name =
'cuda_entropy_visc_apply_element_max')
129 use,
intrinsic :: iso_c_binding
130 type(c_ptr),
value :: reg_coeff_d
131 integer(c_int) :: lx, nelv
137 h_d, max_wave_speed_d, c_avisc_low, n) &
138 bind(c, name =
'cuda_entropy_visc_clamp_to_low_order')
139 use,
intrinsic :: iso_c_binding
141 type(c_ptr),
value :: reg_coeff_d, h_d, max_wave_speed_d
142 real(c_rp) :: c_avisc_low
149 temp_field_d, mult_field_d, n) &
150 bind(c, name =
'cuda_entropy_visc_smooth_divide')
151 use,
intrinsic :: iso_c_binding
152 type(c_ptr),
value :: reg_coeff_d, temp_field_d, mult_field_d
160 S_d, S_lag1_d, S_lag2_d, S_lag3_d, &
161 bdf1, bdf2, bdf3, bdf4, dt, n) &
162 bind(c, name =
'opencl_entropy_visc_compute_residual')
163 use,
intrinsic :: iso_c_binding
165 type(c_ptr),
value :: entropy_residual_d
166 type(c_ptr),
value :: S_d, S_lag1_d, S_lag2_d, S_lag3_d
167 real(c_rp),
value :: bdf1, bdf2, bdf3, bdf4, dt
168 integer(c_int),
value :: n
174 entropy_residual_d, h_d, c_avisc_entropy, n_S, n) &
175 bind(c, name =
'opencl_entropy_visc_compute_viscosity')
176 use,
intrinsic :: iso_c_binding
178 type(c_ptr),
value :: reg_coeff_d, entropy_residual_d, h_d
179 real(c_rp),
value :: c_avisc_entropy, n_S
180 integer(c_int),
value :: n
186 bind(c, name =
'opencl_entropy_visc_apply_element_max')
187 use,
intrinsic :: iso_c_binding
188 type(c_ptr),
value :: reg_coeff_d
189 integer(c_int),
value :: lx, nelv
195 h_d, max_wave_speed_d, c_avisc_low, n) &
196 bind(c, name =
'opencl_entropy_visc_clamp_to_low_order')
197 use,
intrinsic :: iso_c_binding
199 type(c_ptr),
value :: reg_coeff_d, h_d, max_wave_speed_d
200 real(c_rp),
value :: c_avisc_low
201 integer(c_int),
value :: n
207 temp_field_d, mult_field_d, n) &
208 bind(c, name =
'opencl_entropy_visc_smooth_divide')
209 use,
intrinsic :: iso_c_binding
210 type(c_ptr),
value :: reg_coeff_d, temp_field_d, mult_field_d
211 integer(c_int),
value :: n
216 subroutine metal_entropy_visc_compute_residual(entropy_residual_d, &
217 S_d, S_lag1_d, S_lag2_d, S_lag3_d, &
218 bdf1, bdf2, bdf3, bdf4, dt, n) &
219 bind(c, name =
'metal_entropy_visc_compute_residual')
220 use,
intrinsic :: iso_c_binding
222 type(c_ptr),
value :: entropy_residual_d
223 type(c_ptr),
value :: S_d, S_lag1_d, S_lag2_d, S_lag3_d
224 real(c_rp),
value :: bdf1, bdf2, bdf3, bdf4, dt
225 integer(c_int),
value :: n
226 end subroutine metal_entropy_visc_compute_residual
230 subroutine metal_entropy_visc_compute_viscosity(reg_coeff_d, &
231 entropy_residual_d, h_d, c_avisc_entropy, n_S, n) &
232 bind(c, name =
'metal_entropy_visc_compute_viscosity')
233 use,
intrinsic :: iso_c_binding
235 type(c_ptr),
value :: reg_coeff_d, entropy_residual_d, h_d
236 real(c_rp),
value :: c_avisc_entropy, n_S
237 integer(c_int),
value :: n
238 end subroutine metal_entropy_visc_compute_viscosity
242 subroutine metal_entropy_visc_apply_element_max(reg_coeff_d, lx, nelv) &
243 bind(c, name =
'metal_entropy_visc_apply_element_max')
244 use,
intrinsic :: iso_c_binding
245 type(c_ptr),
value :: reg_coeff_d
246 integer(c_int),
value :: lx, nelv
247 end subroutine metal_entropy_visc_apply_element_max
251 subroutine metal_entropy_visc_clamp_to_low_order(reg_coeff_d, &
252 h_d, max_wave_speed_d, c_avisc_low, n) &
253 bind(c, name =
'metal_entropy_visc_clamp_to_low_order')
254 use,
intrinsic :: iso_c_binding
256 type(c_ptr),
value :: reg_coeff_d, h_d, max_wave_speed_d
257 real(c_rp),
value :: c_avisc_low
258 integer(c_int),
value :: n
259 end subroutine metal_entropy_visc_clamp_to_low_order
263 subroutine metal_entropy_visc_smooth_divide(reg_coeff_d, &
264 temp_field_d, mult_field_d, n) &
265 bind(c, name =
'metal_entropy_visc_smooth_divide')
266 use,
intrinsic :: iso_c_binding
267 type(c_ptr),
value :: reg_coeff_d, temp_field_d, mult_field_d
268 integer(c_int),
value :: n
269 end subroutine metal_entropy_visc_smooth_divide
283 S_d, S_lag1_d, S_lag2_d, S_lag3_d, bdf_coeffs, dt, n)
284 type(c_ptr),
intent(in) :: entropy_residual_d
285 type(c_ptr),
intent(in) :: s_d, s_lag1_d, s_lag2_d, s_lag3_d
286 real(kind=
rp),
intent(in) :: bdf_coeffs(4)
287 real(kind=
rp),
intent(in) :: dt
288 integer,
intent(in) :: n
292 s_d, s_lag1_d, s_lag2_d, s_lag3_d, &
293 bdf_coeffs(1), bdf_coeffs(2), bdf_coeffs(3), bdf_coeffs(4), dt, n)
296 s_d, s_lag1_d, s_lag2_d, s_lag3_d, &
297 bdf_coeffs(1), bdf_coeffs(2), bdf_coeffs(3), bdf_coeffs(4), dt, n)
300 s_d, s_lag1_d, s_lag2_d, s_lag3_d, &
301 bdf_coeffs(1), bdf_coeffs(2), bdf_coeffs(3), bdf_coeffs(4), dt, n)
303 call metal_entropy_visc_compute_residual(entropy_residual_d, &
304 s_d, s_lag1_d, s_lag2_d, s_lag3_d, &
305 bdf_coeffs(1), bdf_coeffs(2), bdf_coeffs(3), bdf_coeffs(4), dt, n)
307 call neko_error(
'No device backend configured')
313 entropy_residual_d, h_d, c_avisc_entropy, n_S, n)
314 type(c_ptr),
intent(in) :: reg_coeff_d, entropy_residual_d, h_d
315 real(kind=
rp),
intent(in) :: c_avisc_entropy, n_s
316 integer,
intent(in) :: n
320 entropy_residual_d, h_d, c_avisc_entropy, n_s, n)
323 entropy_residual_d, h_d, c_avisc_entropy, n_s, n)
326 entropy_residual_d, h_d, c_avisc_entropy, n_s, n)
328 call metal_entropy_visc_compute_viscosity(reg_coeff_d, &
329 entropy_residual_d, h_d, c_avisc_entropy, n_s, n)
331 call neko_error(
'No device backend configured')
337 type(c_ptr),
intent(in) :: reg_coeff_d
338 integer,
intent(in) :: lx, nelv
347 call metal_entropy_visc_apply_element_max(reg_coeff_d, lx, nelv)
349 call neko_error(
'No device backend configured')
355 h_d, max_wave_speed_d, c_avisc_low, n)
356 type(c_ptr),
intent(in) :: reg_coeff_d, h_d, max_wave_speed_d
357 real(kind=
rp),
intent(in) :: c_avisc_low
358 integer,
intent(in) :: n
362 h_d, max_wave_speed_d, c_avisc_low, n)
365 h_d, max_wave_speed_d, c_avisc_low, n)
368 h_d, max_wave_speed_d, c_avisc_low, n)
370 call metal_entropy_visc_clamp_to_low_order(reg_coeff_d, &
371 h_d, max_wave_speed_d, c_avisc_low, n)
373 call neko_error(
'No device backend configured')
379 temp_field_d, mult_field_d, n)
380 type(c_ptr),
intent(in) :: reg_coeff_d, temp_field_d, mult_field_d
381 integer,
intent(in) :: n
385 temp_field_d, mult_field_d, n)
388 temp_field_d, mult_field_d, n)
391 temp_field_d, mult_field_d, n)
393 call metal_entropy_visc_smooth_divide(reg_coeff_d, &
394 temp_field_d, mult_field_d, n)
396 call neko_error(
'No device backend configured')
void opencl_entropy_visc_compute_viscosity(void *reg_coeff, void *entropy_residual, void *h, real c_avisc_entropy, real n_S, int n)
void opencl_entropy_visc_compute_residual(void *entropy_residual, void *S, void *S_lag1, void *S_lag2, void *S_lag3, real bdf1, real bdf2, real bdf3, real bdf4, real dt, int n)
void opencl_entropy_visc_smooth_divide(void *reg_coeff, void *temp_field, void *mult_field, int n)
void opencl_entropy_visc_clamp_to_low_order(void *reg_coeff, void *h, void *max_wave_speed, real c_avisc_low, int n)
void opencl_entropy_visc_apply_element_max(void *reg_coeff, int lx, int nelv)
void cuda_entropy_visc_apply_element_max(void *reg_coeff, int *lx, int *nelv)
void cuda_entropy_visc_smooth_divide(void *reg_coeff, void *temp_field, void *mult_field, int *n)
void cuda_entropy_visc_compute_residual(void *entropy_residual, void *S, void *S_lag1, void *S_lag2, void *S_lag3, real *bdf1, real *bdf2, real *bdf3, real *bdf4, real *dt, int *n)
void cuda_entropy_visc_clamp_to_low_order(void *reg_coeff, void *h, void *max_wave_speed, real *c_avisc_low, int *n)
void cuda_entropy_visc_compute_viscosity(void *reg_coeff, void *entropy_residual, void *h, real *c_avisc_entropy, real *n_S, int *n)
Device backend for entropy viscosity regularization.
subroutine, public entropy_viscosity_smooth_divide_device(reg_coeff_d, temp_field_d, mult_field_d, n)
Divide by multiplicity for smoothing on device.
subroutine, public entropy_viscosity_clamp_to_low_order_device(reg_coeff_d, h_d, max_wave_speed_d, c_avisc_low, n)
Clamp regularization coefficient to low-order viscosity on device.
subroutine, public entropy_viscosity_apply_element_max_device(reg_coeff_d, lx, nelv)
Apply element-wise maximum on device.
subroutine, public entropy_viscosity_compute_residual_device(entropy_residual_d, s_d, s_lag1_d, s_lag2_d, s_lag3_d, bdf_coeffs, dt, n)
Compute entropy residual on device.
subroutine, public entropy_viscosity_compute_viscosity_device(reg_coeff_d, entropy_residual_d, h_d, c_avisc_entropy, n_s, n)
Compute viscosity from entropy residual on device.
integer, parameter, public c_rp
integer, parameter, public rp
Global precision used in computations.