Neko-TOP
A portable framework for high-order spectral element flow toplogy optimization.
Loading...
Searching...
No Matches
device_mma_math.f90 File Reference

Go to the source code of this file.

Functions/Subroutines

subroutine, public device_mma_math::device_prepare_aa_matrix (aa_d, s_d, lambda_d, d_d, mu_d, y_d, a_d, zeta, z, m)
 Prepare AA matrix for dual-primal solver on device.
 
subroutine, public device_mma_math::device_prepare_hessian (hess_d, y_d, d_d, mu_d, lambda_d, m)
 Solve linear system Ax = b on device.
 
subroutine, public device_mma_math::device_solve_linear_system (a_d, b_d, n, info)
 
subroutine, public device_mma_math::device_delta_1dbeam (delta_d, l_total, le, offset, n)
 A device support to do the following calculation for 1D beam elements: Delta(k) = ((L_total - Le*(offset+k-1))**3 - & (L_total - Le*(offset+k))**3) / 3.0_rp Where k ranges from 1 to n.
 
subroutine, public device_mma_math::device_hess (hess_d, hijx_d, ljjxinv_d, n, m)
 
subroutine, public device_mma_math::device_mma_ljjxinv (ljjxinv_d, pjlambda_d, qjlambda_d, x_d, low_d, upp_d, alpha_d, beta_d, n)
 A device support to do the following calculation needed for the dualsubsolve for MMA: Ljjxinv= - 1 / ( (2*pjlambda/(upp - x)**3) + & (2*qjlambda/(x - low)**3))
 
subroutine, public device_mma_math::device_mma_dipsolvesub1 (x_d, pjlambda_d, qjlambda_d, low_d, upp_d, alpha_d, beta_d, n)
 A device support to do the following calculation needed for the dualsubsolve for MMA: x = (sqrt(pjlambda) * low + sqrt(qjlambda) * upp) / & (sqrt(pjlambda) + sqrt(qjlambda))
 
subroutine, public device_mma_math::device_mattrans_v_mul (output_d, pij_d, lambda_d, m, n)
 A device support to do the following matrix multiplication output = matmul(transpose(pij), lambda) where matrix pij is mxn, vector lambda is of size m and the output vector is of size n.
 
subroutine, public device_mma_math::device_mma_gensub1 (low_d, upp_d, x_d, xmin_d, xmax_d, asyinit, n)
 
subroutine, public device_mma_math::device_mma_gensub2 (low_d, upp_d, x_d, xold1_d, xold2_d, xdiff_d, asydecr, asyincr, n)
 
subroutine, public device_mma_math::device_mma_gensub3 (x_d, df0dx_d, dfdx_d, low_d, upp_d, min_d, max_d, alpha_d, beta_d, p0j_d, q0j_d, pij_d, qij_d, n, m)
 
subroutine, public device_mma_math::device_mma_gensub4 (x_d, low_d, upp_d, pij_d, qij_d, n, m, bi_d)
 
subroutine, public device_mma_math::device_mma_max (xsi_d, x_d, alpha_d, n)
 
subroutine, public device_mma_math::device_max2 (a_d, b, c_d, d, n)
 
subroutine, public device_mma_math::device_rex (rex_d, x_d, low_d, upp_d, pij_d, p0j_d, qij_d, q0j_d, lambda_d, xsi_d, eta_d, n, m)
 
real(kind=rp) function, public device_mma_math::device_lcsc2 (a_d, b_d, n)
 
subroutine, public device_mma_math::device_relambda (relambda_d, x_d, upp_d, low_d, pij_d, qij_d, n, m)
 
subroutine, public device_mma_math::device_sub2cons2 (rexsi_d, xsi_d, x_d, alpha_d, epsi, n)
 
real(kind=rp) function, public device_mma_math::device_maxval (rex_d, n)
 
real(kind=rp) function, public device_mma_math::device_norm (rex_d, n)
 
subroutine, public device_mma_math::device_delx (delx_d, x_d, low_d, upp_d, pij_d, qij_d, p0j_d, q0j_d, alpha_d, beta_d, lambda_d, epsi, n, m)
 
subroutine, public device_mma_math::device_add2inv2 (a_d, b_d, c, n)
 
subroutine, public device_mma_math::device_gg (gg_d, x_d, low_d, upp_d, pij_d, qij_d, n, m)
 
subroutine, public device_mma_math::device_diagx (diagx_d, x_d, xsi_d, low_d, upp_d, p0j_d, q0j_d, pij_d, qij_d, alpha_d, beta_d, eta_d, lambda_d, n, m)
 
subroutine, public device_mma_math::device_bb (bb_d, gg_d, delx_d, diagx_d, n, m)
 
subroutine, public device_mma_math::device_updatebb (bb_d, dellambda_d, dely_d, d_d, mu_d, y_d, delz, m)
 
subroutine, public device_mma_math::device_aa (aa_d, gg_d, diagx_d, n, m)
 
subroutine, public device_mma_math::device_updateaa (aa_d, globaltmp_mm_d, s_d, lambda_d, d_d, mu_d, y_d, a_d, zeta, z, m)
 
subroutine, public device_mma_math::device_dx (dx_d, delx_d, diagx_d, gg_d, dlambda_d, n, m)
 
subroutine, public device_mma_math::device_dy (dy_d, dely_d, dlambda_d, d_d, mu_d, y_d, n)
 
subroutine, public device_mma_math::device_dxsi (dxsi_d, xsi_d, dx_d, x_d, alpha_d, epsi, n)
 
subroutine, public device_mma_math::device_deta (deta_d, eta_d, dx_d, x_d, beta_d, epsi, n)
 
real(kind=rp) function, public device_mma_math::device_maxval2 (dxx_d, xx_d, cons, n)
 
real(kind=rp) function, public device_mma_math::device_maxval3 (dx_d, x_d, alpha_d, cons, n)
 
subroutine, public device_mma_math::device_kkt_rex (rex_d, df0dx_d, dfdx_d, xsi_d, eta_d, lambda_d, n, m)
 

Detailed Description

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  • Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  • Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  • Neither the name of the authors nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Definition in file device_mma_math.f90.

Function/Subroutine Documentation

◆ device_aa()

subroutine, public device_mma_math::device_aa ( type(c_ptr aa_d,
type(c_ptr gg_d,
type(c_ptr diagx_d,
integer(c_int n,
integer(c_int m 
)

Definition at line 526 of file device_mma_math.f90.

◆ device_add2inv2()

subroutine, public device_mma_math::device_add2inv2 ( type(c_ptr a_d,
type(c_ptr b_d,
real(kind=rp)  c,
integer(c_int n 
)

Definition at line 447 of file device_mma_math.f90.

◆ device_bb()

subroutine, public device_mma_math::device_bb ( type(c_ptr bb_d,
type(c_ptr gg_d,
type(c_ptr delx_d,
type(c_ptr diagx_d,
integer(c_int n,
integer(c_int m 
)

Definition at line 497 of file device_mma_math.f90.

◆ device_delta_1dbeam()

subroutine, public device_mma_math::device_delta_1dbeam ( type(c_ptr delta_d,
real(c_rp)  l_total,
real(c_rp)  le,
integer(c_int), value  offset,
integer(c_int), value  n 
)

Definition at line 132 of file device_mma_math.f90.

◆ device_delx()

subroutine, public device_mma_math::device_delx ( type(c_ptr delx_d,
type(c_ptr x_d,
type(c_ptr low_d,
type(c_ptr upp_d,
type(c_ptr pij_d,
type(c_ptr qij_d,
type(c_ptr p0j_d,
type(c_ptr q0j_d,
type(c_ptr alpha_d,
type(c_ptr beta_d,
type(c_ptr lambda_d,
real(kind=rp)  epsi,
integer(c_int n,
integer(c_int m 
)

Definition at line 428 of file device_mma_math.f90.

◆ device_deta()

subroutine, public device_mma_math::device_deta ( type(c_ptr deta_d,
type(c_ptr eta_d,
type(c_ptr dx_d,
type(c_ptr x_d,
type(c_ptr beta_d,
real(c_rp)  epsi,
integer(c_int n 
)

Definition at line 601 of file device_mma_math.f90.

◆ device_diagx()

subroutine, public device_mma_math::device_diagx ( type(c_ptr diagx_d,
type(c_ptr x_d,
type(c_ptr xsi_d,
type(c_ptr low_d,
type(c_ptr upp_d,
type(c_ptr p0j_d,
type(c_ptr q0j_d,
type(c_ptr pij_d,
type(c_ptr qij_d,
type(c_ptr alpha_d,
type(c_ptr beta_d,
type(c_ptr eta_d,
type(c_ptr lambda_d,
integer(c_int n,
integer(c_int m 
)

Definition at line 477 of file device_mma_math.f90.

◆ device_dx()

subroutine, public device_mma_math::device_dx ( type(c_ptr dx_d,
type(c_ptr delx_d,
type(c_ptr diagx_d,
type(c_ptr gg_d,
type(c_ptr dlambda_d,
integer(c_int n,
integer(c_int m 
)

Definition at line 558 of file device_mma_math.f90.

◆ device_dxsi()

subroutine, public device_mma_math::device_dxsi ( type(c_ptr dxsi_d,
type(c_ptr xsi_d,
type(c_ptr dx_d,
type(c_ptr x_d,
type(c_ptr alpha_d,
real(c_rp)  epsi,
integer(c_int n 
)

Definition at line 586 of file device_mma_math.f90.

◆ device_dy()

subroutine, public device_mma_math::device_dy ( type(c_ptr dy_d,
type(c_ptr dely_d,
type(c_ptr dlambda_d,
type(c_ptr d_d,
type(c_ptr mu_d,
type(c_ptr y_d,
integer(c_int n 
)

Definition at line 572 of file device_mma_math.f90.

◆ device_gg()

subroutine, public device_mma_math::device_gg ( type(c_ptr gg_d,
type(c_ptr x_d,
type(c_ptr low_d,
type(c_ptr upp_d,
type(c_ptr pij_d,
type(c_ptr qij_d,
integer(c_int n,
integer(c_int m 
)

Definition at line 463 of file device_mma_math.f90.

◆ device_hess()

subroutine, public device_mma_math::device_hess ( type(c_ptr hess_d,
type(c_ptr hijx_d,
type(c_ptr ljjxinv_d,
integer(c_int n,
integer(c_int m 
)

Definition at line 148 of file device_mma_math.f90.

◆ device_kkt_rex()

subroutine, public device_mma_math::device_kkt_rex ( type(c_ptr rex_d,
type(c_ptr df0dx_d,
type(c_ptr dfdx_d,
type(c_ptr xsi_d,
type(c_ptr eta_d,
type(c_ptr lambda_d,
integer(c_int n,
integer(c_int m 
)

Definition at line 655 of file device_mma_math.f90.

◆ device_lcsc2()

real(kind=rp) function, public device_mma_math::device_lcsc2 ( type(c_ptr a_d,
type(c_ptr b_d,
integer(c_int n 
)

Definition at line 348 of file device_mma_math.f90.

◆ device_mattrans_v_mul()

subroutine, public device_mma_math::device_mattrans_v_mul ( type(c_ptr output_d,
type(c_ptr pij_d,
type(c_ptr lambda_d,
integer  m,
integer  n 
)

Definition at line 217 of file device_mma_math.f90.

◆ device_max2()

subroutine, public device_mma_math::device_max2 ( type(c_ptr a_d,
real(c_rp)  b,
type(c_ptr c_d,
real(c_rp)  d,
integer  n 
)

Definition at line 313 of file device_mma_math.f90.

◆ device_maxval()

real(kind=rp) function, public device_mma_math::device_maxval ( type(c_ptr rex_d,
integer(c_int n 
)

Definition at line 394 of file device_mma_math.f90.

◆ device_maxval2()

real(kind=rp) function, public device_mma_math::device_maxval2 ( type(c_ptr dxx_d,
type(c_ptr xx_d,
real(kind=rp), intent(in cons,
integer  n 
)

Definition at line 616 of file device_mma_math.f90.

◆ device_maxval3()

real(kind=rp) function, public device_mma_math::device_maxval3 ( type(c_ptr dx_d,
type(c_ptr x_d,
type(c_ptr alpha_d,
real(kind=rp), intent(in cons,
integer(c_int n 
)

Definition at line 635 of file device_mma_math.f90.

◆ device_mma_dipsolvesub1()

subroutine, public device_mma_math::device_mma_dipsolvesub1 ( type(c_ptr x_d,
type(c_ptr pjlambda_d,
type(c_ptr qjlambda_d,
type(c_ptr low_d,
type(c_ptr upp_d,
type(c_ptr alpha_d,
type(c_ptr beta_d,
integer(c_int n 
)

Definition at line 194 of file device_mma_math.f90.

◆ device_mma_gensub1()

subroutine, public device_mma_math::device_mma_gensub1 ( type(c_ptr low_d,
type(c_ptr upp_d,
type(c_ptr x_d,
type(c_ptr xmin_d,
type(c_ptr xmax_d,
real(c_rp)  asyinit,
integer  n 
)

Definition at line 233 of file device_mma_math.f90.

◆ device_mma_gensub2()

subroutine, public device_mma_math::device_mma_gensub2 ( type(c_ptr low_d,
type(c_ptr upp_d,
type(c_ptr x_d,
type(c_ptr xold1_d,
type(c_ptr xold2_d,
type(c_ptr xdiff_d,
real(c_rp)  asydecr,
real(c_rp)  asyincr,
integer  n 
)

Definition at line 249 of file device_mma_math.f90.

◆ device_mma_gensub3()

subroutine, public device_mma_math::device_mma_gensub3 ( type(c_ptr x_d,
type(c_ptr df0dx_d,
type(c_ptr dfdx_d,
type(c_ptr low_d,
type(c_ptr upp_d,
type(c_ptr min_d,
type(c_ptr max_d,
type(c_ptr alpha_d,
type(c_ptr beta_d,
type(c_ptr p0j_d,
type(c_ptr q0j_d,
type(c_ptr pij_d,
type(c_ptr qij_d,
integer  n,
integer  m 
)

Definition at line 267 of file device_mma_math.f90.

◆ device_mma_gensub4()

subroutine, public device_mma_math::device_mma_gensub4 ( type(c_ptr x_d,
type(c_ptr low_d,
type(c_ptr upp_d,
type(c_ptr pij_d,
type(c_ptr qij_d,
integer  n,
integer  m,
type(c_ptr bi_d 
)

Definition at line 285 of file device_mma_math.f90.

◆ device_mma_ljjxinv()

subroutine, public device_mma_math::device_mma_ljjxinv ( type(c_ptr ljjxinv_d,
type(c_ptr pjlambda_d,
type(c_ptr qjlambda_d,
type(c_ptr x_d,
type(c_ptr low_d,
type(c_ptr upp_d,
type(c_ptr alpha_d,
type(c_ptr beta_d,
integer(c_int n 
)

And then remove the sensitivity for the active primal constraints Ljjxinv = merge(0.0_rp, Ljjxinv, x .eq. alpha) Ljjxinv = merge(0.0_rp, Ljjxinv, x .eq. beta)

Definition at line 171 of file device_mma_math.f90.

◆ device_mma_max()

subroutine, public device_mma_math::device_mma_max ( type(c_ptr xsi_d,
type(c_ptr x_d,
type(c_ptr alpha_d,
integer  n 
)

Definition at line 299 of file device_mma_math.f90.

◆ device_norm()

real(kind=rp) function, public device_mma_math::device_norm ( type(c_ptr rex_d,
integer(c_int n 
)

Definition at line 411 of file device_mma_math.f90.

◆ device_prepare_aa_matrix()

subroutine, public device_mma_math::device_prepare_aa_matrix ( type(c_ptr aa_d,
type(c_ptr s_d,
type(c_ptr lambda_d,
type(c_ptr d_d,
type(c_ptr mu_d,
type(c_ptr y_d,
type(c_ptr a_d,
real(c_rp)  zeta,
real(c_rp)  z,
integer, value  m 
)

Definition at line 77 of file device_mma_math.f90.

◆ device_prepare_hessian()

subroutine, public device_mma_math::device_prepare_hessian ( type(c_ptr hess_d,
type(c_ptr y_d,
type(c_ptr d_d,
type(c_ptr mu_d,
type(c_ptr lambda_d,
integer, value  m 
)

Definition at line 96 of file device_mma_math.f90.

◆ device_relambda()

subroutine, public device_mma_math::device_relambda ( type(c_ptr relambda_d,
type(c_ptr x_d,
type(c_ptr upp_d,
type(c_ptr low_d,
type(c_ptr pij_d,
type(c_ptr qij_d,
integer(c_int n,
integer(c_int m 
)

Definition at line 365 of file device_mma_math.f90.

◆ device_rex()

subroutine, public device_mma_math::device_rex ( type(c_ptr rex_d,
type(c_ptr x_d,
type(c_ptr low_d,
type(c_ptr upp_d,
type(c_ptr pij_d,
type(c_ptr p0j_d,
type(c_ptr qij_d,
type(c_ptr q0j_d,
type(c_ptr lambda_d,
type(c_ptr xsi_d,
type(c_ptr eta_d,
integer(c_int n,
integer(c_int m 
)

Definition at line 330 of file device_mma_math.f90.

◆ device_solve_linear_system()

subroutine, public device_mma_math::device_solve_linear_system ( type(c_ptr a_d,
type(c_ptr b_d,
integer(c_int), value  n,
integer(c_int info 
)

Definition at line 110 of file device_mma_math.f90.

◆ device_sub2cons2()

subroutine, public device_mma_math::device_sub2cons2 ( type(c_ptr rexsi_d,
type(c_ptr xsi_d,
type(c_ptr x_d,
type(c_ptr alpha_d,
real(kind=rp)  epsi,
integer(c_int n 
)

Definition at line 379 of file device_mma_math.f90.

◆ device_updateaa()

subroutine, public device_mma_math::device_updateaa ( type(c_ptr aa_d,
type(c_ptr globaltmp_mm_d,
type(c_ptr s_d,
type(c_ptr lambda_d,
type(c_ptr d_d,
type(c_ptr mu_d,
type(c_ptr y_d,
type(c_ptr a_d,
real(c_rp)  zeta,
real(c_rp)  z,
integer(c_int m 
)

Definition at line 540 of file device_mma_math.f90.

◆ device_updatebb()

subroutine, public device_mma_math::device_updatebb ( type(c_ptr bb_d,
type(c_ptr dellambda_d,
type(c_ptr dely_d,
type(c_ptr d_d,
type(c_ptr mu_d,
type(c_ptr y_d,
real(c_rp)  delz,
integer(c_int m 
)

Definition at line 511 of file device_mma_math.f90.