Neko-TOP
A portable framework for high-order spectral element flow toplogy optimization.
Loading...
Searching...
No Matches
hip_mma_math.f90
Go to the documentation of this file.
1
34!
35module hip_mma_math
36 use num_types, only: rp, c_rp
37 use, intrinsic :: iso_c_binding, only: c_int, c_ptr
38
39 implicit none
40 public
41
42 interface
43 subroutine mma_update_hessian_z_hip(Hess_d, a_d, m) &
44 bind(C, name="mma_update_hessian_z_hip")
45 use iso_c_binding
46 type(c_ptr), value :: Hess_d
47 type(c_ptr), value :: a_d
48 integer(c_int), value :: m
49 end subroutine mma_update_hessian_z_hip
50
51 subroutine hipsolver_wrapper(A_d, b_d, n, info) &
52 bind(c, name = 'hipSOLVER_wrapper')
53 import c_int, c_ptr
54 type(c_ptr), value :: A_d, b_d
55 integer(c_int), value :: n
56 integer(c_int) :: info
57 end subroutine hipsolver_wrapper
58
59 subroutine hip_custom_solver(A_d, b_d, n, info) &
60 bind(c, name = 'hip_custom_solver')
61 import c_int, c_ptr
62 type(c_ptr), value :: A_d, b_d
63 integer(c_int), value :: n
64 integer(c_int) :: info
65 end subroutine hip_custom_solver
66
67 subroutine mma_prepare_hessian_hip(Hess_d, y_d, mu_d, lambda_d, m) &
68 bind(c, name = 'mma_prepare_hessian_hip')
69 import c_int, c_ptr
70 type(c_ptr), value :: Hess_d, y_d, mu_d, lambda_d
71 integer(c_int), value :: m
72 end subroutine mma_prepare_hessian_hip
73
74 subroutine mma_prepare_aa_matrix_hip(AA_d, s_d, lambda_d, d_d, mu_d, y_d, &
75 a_d, zeta, z, m) bind(c, name = 'mma_prepare_aa_matrix_hip')
76 import c_rp, c_int, c_ptr
77 type(c_ptr), value :: AA_d, s_d, lambda_d, d_d, mu_d, y_d, a_d
78 real(c_rp), value :: zeta, z
79 integer(c_int), value :: m
80 end subroutine mma_prepare_aa_matrix_hip
81
82 subroutine delta_1dbeam_hip(Delta_d, L_total, Le, offset, n) &
83 bind(c, name = 'delta_1dbeam_hip')
84 import c_rp, c_int, c_ptr
85 type(c_ptr), value :: Delta_d
86 real(c_rp) :: L_total, Le
87 integer(c_int) :: offset, n
88 end subroutine delta_1dbeam_hip
89
90 subroutine hip_hess(Hess_d, hijx_d, Ljjxinv_d, n, m) bind(c, name = 'hip_Hess')
91 import c_int, c_ptr
92 type(c_ptr), value :: Hess_d, hijx_d, Ljjxinv_d
93 integer(c_int) :: n, m
94 end subroutine hip_hess
95
96 subroutine mma_ljjxinv_hip(Ljjxinv_d,pjlambda_d, qjlambda_d, x_d, &
97 low_d, upp_d, alpha_d, beta_d, n) bind(c, name = 'mma_Ljjxinv_hip')
98 import c_int, c_ptr
99 type(c_ptr), value :: Ljjxinv_d, x_d, pjlambda_d, qjlambda_d, low_d, &
100 upp_d, alpha_d, beta_d
101 integer(c_int) :: n
102 end subroutine mma_ljjxinv_hip
103
104 subroutine mma_dipsolvesub1_hip(x_d, pjlambda_d, qjlambda_d, low_d, &
105 upp_d, alpha_d, beta_d, n) bind(c, name = 'mma_dipsolvesub1_hip')
106 import c_int, c_ptr
107 type(c_ptr), value :: x_d, pjlambda_d, qjlambda_d, low_d, &
108 upp_d, alpha_d, beta_d
109 integer(c_int) :: n
110 end subroutine mma_dipsolvesub1_hip
111
112 subroutine mattrans_v_mul_hip(output_d, pij_d, lambda_d, m, n) &
113 bind(c, name = 'mattrans_v_mul_hip')
114 import c_rp, c_int, c_ptr
115 type(c_ptr), value :: output_d, pij_d, lambda_d
116 integer(c_int) :: m, n
117 end subroutine mattrans_v_mul_hip
118 subroutine mma_gensub1_hip(low_d, upp_d, x_d, xmin_d, xmax_d, asyinit, n)&
119 bind(c, name = 'mma_gensub1_hip')
120 import c_rp, c_int, c_ptr
121 type(c_ptr), value :: low_d, upp_d, x_d, xmin_d, xmax_d
122 real(c_rp) :: asyinit
123 integer(c_int) :: n
124 end subroutine mma_gensub1_hip
125
126 subroutine mma_gensub2_hip(low_d, upp_d, x_d, xold1_d, xold2_d, xdiff_d, &
127 asydecr, asyincr, n) bind(c, name = 'mma_gensub2_hip')
128 import c_rp, c_int, c_ptr
129 type(c_ptr), value :: low_d, upp_d, x_d, xold1_d, xold2_d, xdiff_d
130 real(c_rp) :: asydecr, asyincr
131 integer(c_int) :: n
132 end subroutine mma_gensub2_hip
133
134 subroutine mma_gensub3_hip(x_d, df0dx_d, dfdx_d, low_d, upp_d, min_d, &
135 max_d, alpha_d, beta_d, p0j_d, q0j_d, pij_d, qij_d, n, m) &
136 bind(c, name = 'mma_gensub3_hip')
137 import c_int, c_ptr
138 type(c_ptr), value :: x_d, df0dx_d, dfdx_d, low_d, upp_d, min_d, max_d, &
139 alpha_d, beta_d, p0j_d, q0j_d, pij_d, qij_d
140 integer(c_int) :: n, m
141 end subroutine mma_gensub3_hip
142
144 subroutine mma_gensub3_dip_hip(x_d, df0dx_d, dfdx_d, low_d, upp_d, &
145 min_d, max_d, alpha_d, beta_d, p0j_d, q0j_d, pij_d, qij_d, n, m) &
146 bind(c, name = 'mma_gensub3_dip_hip')
147 import c_int, c_ptr
148 type(c_ptr), value :: x_d, df0dx_d, dfdx_d, low_d, upp_d, min_d, max_d, &
149 alpha_d, beta_d, p0j_d, q0j_d, pij_d, qij_d
150 integer(c_int) :: n, m
151 end subroutine mma_gensub3_dip_hip
152
153 subroutine mma_gensub4_hip(x_d, low_d, upp_d, pij_d, qij_d, n, m, bi_d) &
154 bind(c, name = 'mma_gensub4_hip')
155 import c_int, c_ptr
156 type(c_ptr), value :: x_d, low_d, upp_d, pij_d, qij_d, bi_d
157 integer(c_int) :: n, m
158 end subroutine mma_gensub4_hip
159
160 subroutine hip_mma_max(xsi_d, x_d, alpha_d, n) &
161 bind(c, name = 'hip_mma_max')
162 import c_int, c_ptr
163 type(c_ptr), value :: xsi_d, x_d, alpha_d
164 integer(c_int) :: n
165 end subroutine hip_mma_max
166
167 subroutine hip_rex(rex_d, x_d, low_d, upp_d, pij_d, p0j_d, qij_d, q0j_d, &
168 lambda_d, xsi_d, eta_d, n, m) bind(c, name = 'hip_rex')
169 import c_int, c_ptr
170 type(c_ptr), value :: rex_d, x_d, low_d, upp_d, pij_d, p0j_d, qij_d, &
171 q0j_d, lambda_d, xsi_d, eta_d
172 integer(c_int) :: n, m
173 end subroutine hip_rex
174
175 subroutine hip_relambda(relambda_d, x_d, upp_d, low_d, pij_d, qij_d, n, &
176 m) bind(c, name = 'hip_relambda')
177 import c_int, c_ptr
178 type(c_ptr), value :: relambda_d, x_d, upp_d, low_d, pij_d, qij_d
179 integer(c_int) :: n, m
180 end subroutine hip_relambda
181
182 subroutine hip_sub2cons2(rexsi_d, xsi_d, x_d, alpha_d, epsi, n) &
183 bind(c, name = 'hip_sub2cons2')
184 import c_rp, c_int, c_ptr
185 type(c_ptr), value :: rexsi_d, xsi_d, x_d, alpha_d
186 real(c_rp) :: epsi
187 integer(c_int) :: n
188 end subroutine hip_sub2cons2
189
190 real(c_rp) function hip_maxval(rex_d, n) bind(c, name = 'hip_maxval')
191 import c_rp, c_int, c_ptr
192 type(c_ptr), value :: rex_d
193 integer(c_int) :: n
194 end function hip_maxval
195
196 real(c_rp) function hip_norm(rex_d, n) bind(c, name = 'hip_norm')
197 import c_rp, c_int, c_ptr
198 type(c_ptr), value :: rex_d
199 integer(c_int) :: n
200 end function hip_norm
201
202 subroutine hip_delx(delx_d, x_d, low_d, upp_d, pij_d, qij_d, p0j_d, &
203 q0j_d, alpha_d, beta_d, lambda_d, epsi, n, m) &
204 bind(c, name = 'hip_delx')
205 import c_rp, c_int, c_ptr
206 type(c_ptr), value :: delx_d, x_d, low_d, upp_d, pij_d, qij_d, p0j_d, &
207 q0j_d, alpha_d, beta_d, lambda_d
208 real(c_rp) :: epsi
209 integer(c_int) :: n, m
210 end subroutine hip_delx
211
212
213
214 subroutine hip_gg(GG_d, x_d, low_d, upp_d, pij_d, qij_d, n, m) &
215 bind(c, name = 'hip_GG')
216 import c_int, c_ptr
217 type(c_ptr), value :: GG_d, x_d, low_d, upp_d, pij_d, qij_d
218 integer(c_int) :: n, m
219 end subroutine hip_gg
220
221 subroutine hip_diagx(diagx_d, x_d, xsi_d, low_d, upp_d, p0j_d, q0j_d, &
222 pij_d, qij_d, alpha_d, beta_d, eta_d, lambda_d, n, m) &
223 bind(c, name = 'hip_diagx')
224 import c_int, c_ptr
225 type(c_ptr), value :: diagx_d, x_d, xsi_d, low_d, upp_d, p0j_d, q0j_d, &
226 pij_d, qij_d, alpha_d, beta_d, eta_d, lambda_d
227 integer(c_int) :: n, m
228 end subroutine hip_diagx
229
230 subroutine hip_bb(bb_d, GG_d, delx_d, diagx_d, n, m) &
231 bind(c, name = 'hip_bb')
232 import c_int, c_ptr
233 type(c_ptr), value :: bb_d, GG_d, delx_d, diagx_d
234 integer(c_int) :: n, m
235 end subroutine hip_bb
236
237 subroutine hip_aa(AA_d, GG_d, diagx_d, n, m) bind(c, name = 'hip_AA')
238 import c_int, c_ptr
239 type(c_ptr), value :: AA_d, GG_d, diagx_d
240 integer(c_int) :: n, m
241 end subroutine hip_aa
242
243 subroutine hip_dx(dx_d, delx_d, diagx_d, GG_d, dlambda_d, n, m) &
244 bind(c, name = 'hip_dx')
245 import c_int, c_ptr
246 type(c_ptr), value :: dx_d, delx_d, diagx_d, GG_d, dlambda_d
247 integer(c_int) :: n, m
248 end subroutine hip_dx
249
250 subroutine hip_dxsi(dxsi_d, xsi_d, dx_d, x_d, alpha_d, epsi, n) &
251 bind(c, name = 'hip_dxsi')
252 import c_rp, c_int, c_ptr
253 type(c_ptr), value :: dxsi_d, xsi_d, dx_d, x_d, alpha_d
254 real(c_rp) :: epsi
255 integer(c_int) :: n
256 end subroutine hip_dxsi
257
258 subroutine hip_deta(deta_d, eta_d, dx_d, x_d, beta_d, epsi, n) &
259 bind(c, name = 'hip_deta')
260 import c_rp, c_int, c_ptr
261 type(c_ptr), value :: deta_d, eta_d, dx_d, x_d, beta_d
262 real(c_rp) :: epsi
263 integer(c_int) :: n
264 end subroutine hip_deta
265
266 real(c_rp) function hip_maxval2(dxx_d, xx_d, cons, n) &
267 bind(c, name = 'hip_maxval2')
268 import c_rp, c_int, c_ptr
269 type(c_ptr), value :: dxx_d, xx_d
270 real(c_rp) :: cons
271 integer(c_int) :: n
272 end function hip_maxval2
273
274 real(c_rp) function hip_maxval3(dx_d, x_d, alpha_d, cons, n) &
275 bind(c, name = 'hip_maxval3')
276 import c_rp, c_int, c_ptr
277 type(c_ptr), value :: dx_d, x_d, alpha_d
278 real(c_rp) :: cons
279 integer(c_int) :: n
280 end function hip_maxval3
281
282 subroutine hip_kkt_rex(rex_d, df0dx_d, dfdx_d, xsi_d, eta_d, lambda_d, &
283 n, m) bind(c, name = 'hip_kkt_rex')
284 import c_int, c_ptr
285 type(c_ptr), value :: rex_d, df0dx_d, dfdx_d, xsi_d, eta_d, lambda_d
286 integer(c_int) :: n, m
287 end subroutine hip_kkt_rex
288
290 subroutine mma_dip_kkt_hip(res_d, x_d, df0dx_d, dfdx_d, xmin_d, xmax_d, &
291 lambda_d, n, m) bind(c, name = 'mma_dip_kkt_hip')
292 import c_int, c_ptr
293 type(c_ptr), value :: res_d, x_d, df0dx_d, dfdx_d, xmin_d, xmax_d, &
294 lambda_d
295 integer(c_int) :: n, m
296 end subroutine mma_dip_kkt_hip
297
298
299 subroutine hip_maxcons(a_d, b, c, d_d, n) bind(c, name = 'hip_maxcons')
300 import c_rp, c_int, c_ptr
301 type(c_ptr), value :: a_d, d_d
302 real(c_rp) :: b, c
303 integer(c_int) :: n
304 end subroutine hip_maxcons
305
306
307 real(c_rp) function hip_lcsc2(a_d, b_d, n) bind(c, name = 'hip_lcsc2')
308 import c_rp, c_int, c_ptr
309 type(c_ptr), value :: a_d, b_d
310 integer(c_int) :: n
311 end function hip_lcsc2
312
313 subroutine hip_mpisum(a_d, n) bind(c, name = 'hip_mpisum')
314 import c_int, c_ptr
315 type(c_ptr), value :: a_d
316 integer(c_int) :: n
317 end subroutine hip_mpisum
318
319 subroutine hip_add2inv2(a_d, b_d, c, n) bind(c, name = 'hip_add2inv2')
320 import c_rp, c_int, c_ptr
321 type(c_ptr), value :: a_d, b_d
322 integer(c_int) :: n
323 real(c_rp) :: c
324 end subroutine hip_add2inv2
325
326 subroutine hip_max2(a_d, b, c_d, d, n) bind(c, name = 'hip_max2')
327 import c_rp, c_int, c_ptr
328 type(c_ptr), value :: a_d, c_d
329 integer(c_int) :: n
330 real(c_rp) :: b, d
331 end subroutine hip_max2
332
333 subroutine hip_updatebb(bb_d, dellambda_d, dely_d, d_d, mu_d, y_d, delz, &
334 m) bind(c, name = 'hip_updatebb')
335 import c_rp, c_int, c_ptr
336 type(c_ptr), value :: bb_d, dellambda_d, dely_d, d_d, mu_d, y_d
337 integer(c_int) :: m
338 real(c_rp) :: delz
339 end subroutine hip_updatebb
340
341 subroutine hip_updateaa(AA_d, globaltmp_mm_d, s_d, lambda_d, d_d, mu_d, &
342 y_d, a_d, zeta, z, m) bind(c, name = 'hip_updateAA')
343 import c_rp, c_int, c_ptr
344 type(c_ptr), value :: AA_d, globaltmp_mm_d, s_d, lambda_d, d_d, mu_d, &
345 y_d, a_d
346 integer(c_int) :: m
347 real(c_rp) :: zeta, z
348 end subroutine hip_updateaa
349
350 subroutine hip_dy(dy_d, dely_d, dlambda_d, d_d, mu_d, y_d, n) &
351 bind(c, name = 'hip_dy')
352 import c_int, c_ptr
353 type(c_ptr), value :: dy_d, dely_d, dlambda_d, d_d, mu_d, y_d
354 integer(c_int) :: n
355 end subroutine hip_dy
356
357 end interface
358
359end module hip_mma_math
Binding of mma_dip_kkt_hip, see device_mma_dip_kkt.
Binding of mma_gensub3_dip_hip, see device_mma_gensub3_dip.