|
Neko-TOP
A portable framework for high-order spectral element flow toplogy optimization.
|
CPU backend for the steepest-descent optimizer kernels. More...
Functions/Subroutines | |
| subroutine, public | sd_direction_cpu (s, x, xmin, xmax, n) |
| Bound-projected steepest-descent direction on CPU (Eq. D22). | |
| subroutine, public | sd_update_move_limits_cpu (delta, x, x1, x2, dec, inc, dmin, dmax, n) |
| Adapt the move limits on CPU (Eq. D23). | |
| subroutine, public | sd_update_design_cpu (x_new, x, s, delta, psi, smax, xmin, xmax, n) |
| Move-limited, box-constrained design update on CPU (Eq. D24). | |
Elementwise kernels of the steepest descent method with move limits, Appendix D of da Silva, Aage, Beck & Sigmund (2021), Eqs. D22-D24. The device backends in bcknd/device implement the same formulas.
| subroutine, public steepest_descent_cpu::sd_direction_cpu | ( | real(kind=rp), dimension(n), intent(inout) | s, |
| real(kind=rp), dimension(n), intent(in) | x, | ||
| real(kind=rp), intent(in) | xmin, | ||
| real(kind=rp), intent(in) | xmax, | ||
| integer, intent(in) | n | ||
| ) |
On entry s holds the gradient G. On exit it holds S = -G, with every component that points out of the box at an active bound set to zero.
| [in,out] | s | Gradient on entry, projected direction on exit. |
| [in] | x | Design variables. |
| [in] | xmin | Lower bound of the design variables. |
| [in] | xmax | Upper bound of the design variables. |
| [in] | n | Number of design variables. |
Definition at line 58 of file steepest_descent_cpu.f90.

| subroutine, public steepest_descent_cpu::sd_update_design_cpu | ( | real(kind=rp), dimension(n), intent(out) | x_new, |
| real(kind=rp), dimension(n), intent(in) | x, | ||
| real(kind=rp), dimension(n), intent(in) | s, | ||
| real(kind=rp), dimension(n), intent(in) | delta, | ||
| real(kind=rp), intent(in) | psi, | ||
| real(kind=rp), intent(in) | smax, | ||
| real(kind=rp), intent(in) | xmin, | ||
| real(kind=rp), intent(in) | xmax, | ||
| integer, intent(in) | n | ||
| ) |
Computes x_new = min(xmax, max(xmin, min(x + delta, max(x - delta, x + psi * (s / smax))))), i.e. the move limit first and the box second. This equals Eq. D24 whenever x lies in [xmin, xmax], and stays well defined for infeasible x.
| [out] | x_new | Updated design variables. |
| [in] | x | Current design variables. |
| [in] | s | Bound-projected steepest-descent direction. |
| [in] | delta | Move limits. |
| [in] | psi | Step length. |
| [in] | smax | Global maximum of the absolute value of s. |
| [in] | xmin | Lower bound of the design variables. |
| [in] | xmax | Upper bound of the design variables. |
| [in] | n | Number of design variables. |
Definition at line 124 of file steepest_descent_cpu.f90.

| subroutine, public steepest_descent_cpu::sd_update_move_limits_cpu | ( | real(kind=rp), dimension(n), intent(inout) | delta, |
| real(kind=rp), dimension(n), intent(in) | x, | ||
| real(kind=rp), dimension(n), intent(in) | x1, | ||
| real(kind=rp), dimension(n), intent(in) | x2, | ||
| real(kind=rp), intent(in) | dec, | ||
| real(kind=rp), intent(in) | inc, | ||
| real(kind=rp), intent(in) | dmin, | ||
| real(kind=rp), intent(in) | dmax, | ||
| integer, intent(in) | n | ||
| ) |
The move limit of a variable shrinks when its last two changes have opposite signs, grows when they have the same sign, and is then clamped to [dmin, dmax].
| [in,out] | delta | Move limits. |
| [in] | x | Design variables at the current iteration. |
| [in] | x1 | Design variables one iteration back. |
| [in] | x2 | Design variables two iterations back. |
| [in] | dec | Factor applied on oscillation. |
| [in] | inc | Factor applied on monotone progress. |
| [in] | dmin | Smallest allowed move limit. |
| [in] | dmax | Largest allowed move limit. |
| [in] | n | Number of design variables. |
Definition at line 88 of file steepest_descent_cpu.f90.
