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