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
143 subroutine mma_gensub4_hip(x_d, low_d, upp_d, pij_d, qij_d, n, m, bi_d) &
144 bind(c, name = 'mma_gensub4_hip')
145 import c_int, c_ptr
146 type(c_ptr), value :: x_d, low_d, upp_d, pij_d, qij_d, bi_d
147 integer(c_int) :: n, m
148 end subroutine mma_gensub4_hip
149
150 subroutine hip_mma_max(xsi_d, x_d, alpha_d, n) &
151 bind(c, name = 'hip_mma_max')
152 import c_int, c_ptr
153 type(c_ptr), value :: xsi_d, x_d, alpha_d
154 integer(c_int) :: n
155 end subroutine hip_mma_max
156
157 subroutine hip_rex(rex_d, x_d, low_d, upp_d, pij_d, p0j_d, qij_d, q0j_d, &
158 lambda_d, xsi_d, eta_d, n, m) bind(c, name = 'hip_rex')
159 import c_int, c_ptr
160 type(c_ptr), value :: rex_d, x_d, low_d, upp_d, pij_d, p0j_d, qij_d, &
161 q0j_d, lambda_d, xsi_d, eta_d
162 integer(c_int) :: n, m
163 end subroutine hip_rex
164
165 subroutine hip_relambda(relambda_d, x_d, upp_d, low_d, pij_d, qij_d, n, &
166 m) bind(c, name = 'hip_relambda')
167 import c_int, c_ptr
168 type(c_ptr), value :: relambda_d, x_d, upp_d, low_d, pij_d, qij_d
169 integer(c_int) :: n, m
170 end subroutine hip_relambda
171
172 subroutine hip_sub2cons2(rexsi_d, xsi_d, x_d, alpha_d, epsi, n) &
173 bind(c, name = 'hip_sub2cons2')
174 import c_rp, c_int, c_ptr
175 type(c_ptr), value :: rexsi_d, xsi_d, x_d, alpha_d
176 real(c_rp) :: epsi
177 integer(c_int) :: n
178 end subroutine hip_sub2cons2
179
180 real(c_rp) function hip_maxval(rex_d, n) bind(c, name = 'hip_maxval')
181 import c_rp, c_int, c_ptr
182 type(c_ptr), value :: rex_d
183 integer(c_int) :: n
184 end function hip_maxval
185
186 real(c_rp) function hip_norm(rex_d, n) bind(c, name = 'hip_norm')
187 import c_rp, c_int, c_ptr
188 type(c_ptr), value :: rex_d
189 integer(c_int) :: n
190 end function hip_norm
191
192 subroutine hip_delx(delx_d, x_d, low_d, upp_d, pij_d, qij_d, p0j_d, &
193 q0j_d, alpha_d, beta_d, lambda_d, epsi, n, m) &
194 bind(c, name = 'hip_delx')
195 import c_rp, c_int, c_ptr
196 type(c_ptr), value :: delx_d, x_d, low_d, upp_d, pij_d, qij_d, p0j_d, &
197 q0j_d, alpha_d, beta_d, lambda_d
198 real(c_rp) :: epsi
199 integer(c_int) :: n, m
200 end subroutine hip_delx
201
202
203
204 subroutine hip_gg(GG_d, x_d, low_d, upp_d, pij_d, qij_d, n, m) &
205 bind(c, name = 'hip_GG')
206 import c_int, c_ptr
207 type(c_ptr), value :: GG_d, x_d, low_d, upp_d, pij_d, qij_d
208 integer(c_int) :: n, m
209 end subroutine hip_gg
210
211 subroutine hip_diagx(diagx_d, x_d, xsi_d, low_d, upp_d, p0j_d, q0j_d, &
212 pij_d, qij_d, alpha_d, beta_d, eta_d, lambda_d, n, m) &
213 bind(c, name = 'hip_diagx')
214 import c_int, c_ptr
215 type(c_ptr), value :: diagx_d, x_d, xsi_d, low_d, upp_d, p0j_d, q0j_d, &
216 pij_d, qij_d, alpha_d, beta_d, eta_d, lambda_d
217 integer(c_int) :: n, m
218 end subroutine hip_diagx
219
220 subroutine hip_bb(bb_d, GG_d, delx_d, diagx_d, n, m) &
221 bind(c, name = 'hip_bb')
222 import c_int, c_ptr
223 type(c_ptr), value :: bb_d, GG_d, delx_d, diagx_d
224 integer(c_int) :: n, m
225 end subroutine hip_bb
226
227 subroutine hip_aa(AA_d, GG_d, diagx_d, n, m) bind(c, name = 'hip_AA')
228 import c_int, c_ptr
229 type(c_ptr), value :: AA_d, GG_d, diagx_d
230 integer(c_int) :: n, m
231 end subroutine hip_aa
232
233 subroutine hip_dx(dx_d, delx_d, diagx_d, GG_d, dlambda_d, n, m) &
234 bind(c, name = 'hip_dx')
235 import c_int, c_ptr
236 type(c_ptr), value :: dx_d, delx_d, diagx_d, GG_d, dlambda_d
237 integer(c_int) :: n, m
238 end subroutine hip_dx
239
240 subroutine hip_dxsi(dxsi_d, xsi_d, dx_d, x_d, alpha_d, epsi, n) &
241 bind(c, name = 'hip_dxsi')
242 import c_rp, c_int, c_ptr
243 type(c_ptr), value :: dxsi_d, xsi_d, dx_d, x_d, alpha_d
244 real(c_rp) :: epsi
245 integer(c_int) :: n
246 end subroutine hip_dxsi
247
248 subroutine hip_deta(deta_d, eta_d, dx_d, x_d, beta_d, epsi, n) &
249 bind(c, name = 'hip_deta')
250 import c_rp, c_int, c_ptr
251 type(c_ptr), value :: deta_d, eta_d, dx_d, x_d, beta_d
252 real(c_rp) :: epsi
253 integer(c_int) :: n
254 end subroutine hip_deta
255
256 real(c_rp) function hip_maxval2(dxx_d, xx_d, cons, n) &
257 bind(c, name = 'hip_maxval2')
258 import c_rp, c_int, c_ptr
259 type(c_ptr), value :: dxx_d, xx_d
260 real(c_rp) :: cons
261 integer(c_int) :: n
262 end function hip_maxval2
263
264 real(c_rp) function hip_maxval3(dx_d, x_d, alpha_d, cons, n) &
265 bind(c, name = 'hip_maxval3')
266 import c_rp, c_int, c_ptr
267 type(c_ptr), value :: dx_d, x_d, alpha_d
268 real(c_rp) :: cons
269 integer(c_int) :: n
270 end function hip_maxval3
271
272 subroutine hip_kkt_rex(rex_d, df0dx_d, dfdx_d, xsi_d, eta_d, lambda_d, &
273 n, m) bind(c, name = 'hip_kkt_rex')
274 import c_int, c_ptr
275 type(c_ptr), value :: rex_d, df0dx_d, dfdx_d, xsi_d, eta_d, lambda_d
276 integer(c_int) :: n, m
277 end subroutine hip_kkt_rex
278
279
280 subroutine hip_maxcons(a_d, b, c, d_d, n) bind(c, name = 'hip_maxcons')
281 import c_rp, c_int, c_ptr
282 type(c_ptr), value :: a_d, d_d
283 real(c_rp) :: b, c
284 integer(c_int) :: n
285 end subroutine hip_maxcons
286
287
288 real(c_rp) function hip_lcsc2(a_d, b_d, n) bind(c, name = 'hip_lcsc2')
289 import c_rp, c_int, c_ptr
290 type(c_ptr), value :: a_d, b_d
291 integer(c_int) :: n
292 end function hip_lcsc2
293
294 subroutine hip_mpisum(a_d, n) bind(c, name = 'hip_mpisum')
295 import c_int, c_ptr
296 type(c_ptr), value :: a_d
297 integer(c_int) :: n
298 end subroutine hip_mpisum
299
300 subroutine hip_add2inv2(a_d, b_d, c, n) bind(c, name = 'hip_add2inv2')
301 import c_rp, c_int, c_ptr
302 type(c_ptr), value :: a_d, b_d
303 integer(c_int) :: n
304 real(c_rp) :: c
305 end subroutine hip_add2inv2
306
307 subroutine hip_max2(a_d, b, c_d, d, n) bind(c, name = 'hip_max2')
308 import c_rp, c_int, c_ptr
309 type(c_ptr), value :: a_d, c_d
310 integer(c_int) :: n
311 real(c_rp) :: b, d
312 end subroutine hip_max2
313
314 subroutine hip_updatebb(bb_d, dellambda_d, dely_d, d_d, mu_d, y_d, delz, &
315 m) bind(c, name = 'hip_updatebb')
316 import c_rp, c_int, c_ptr
317 type(c_ptr), value :: bb_d, dellambda_d, dely_d, d_d, mu_d, y_d
318 integer(c_int) :: m
319 real(c_rp) :: delz
320 end subroutine hip_updatebb
321
322 subroutine hip_updateaa(AA_d, globaltmp_mm_d, s_d, lambda_d, d_d, mu_d, &
323 y_d, a_d, zeta, z, m) bind(c, name = 'hip_updateAA')
324 import c_rp, c_int, c_ptr
325 type(c_ptr), value :: AA_d, globaltmp_mm_d, s_d, lambda_d, d_d, mu_d, &
326 y_d, a_d
327 integer(c_int) :: m
328 real(c_rp) :: zeta, z
329 end subroutine hip_updateaa
330
331 subroutine hip_dy(dy_d, dely_d, dlambda_d, d_d, mu_d, y_d, n) &
332 bind(c, name = 'hip_dy')
333 import c_int, c_ptr
334 type(c_ptr), value :: dy_d, dely_d, dlambda_d, d_d, mu_d, y_d
335 integer(c_int) :: n
336 end subroutine hip_dy
337
338 end interface
339
340end module hip_mma_math