|
Neko-TOP
A portable framework for high-order spectral element flow toplogy optimization.
|
Vector-level kernels of the steepest-descent optimizer. More...
Functions/Subroutines | |
| subroutine, public | sd_direction (s, x, xmin, xmax, n) |
| Bound-projected steepest-descent direction (Eq. D22). | |
| subroutine, public | sd_update_move_limits (delta, x, x1, x2, dec, inc, dmin, dmax, n) |
| Adapt the move limits (Eq. D23). | |
| subroutine, public | sd_update_design (x_new, x, s, delta, psi, smax, xmin, xmax, n) |
| Move-limited, box-constrained design update (Eq. D24). | |
Elementwise kernels of the steepest descent method with move limits, Appendix D of da Silva, Aage, Beck & Sigmund (2021), Eqs. D22-D24. Each routine operates on vector_t objects and runs on the device backend when one is configured, and on the CPU otherwise. All three are local operations; the global reduction of the direction is left to the caller.
| subroutine, public steepest_descent_math::sd_direction | ( | type(vector_t), intent(inout) | s, |
| type(vector_t), intent(in) | x, | ||
| real(kind=rp), intent(in) | xmin, | ||
| real(kind=rp), intent(in) | xmax, | ||
| integer, intent(in), optional | n | ||
| ) |
On entry s holds the gradient G. On exit it holds S = -G, with S_e = 0 where x_e >= xmax and S_e > 0, or x_e <= xmin and S_e < 0.
| [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 entries to process, the size of s by default. |
Definition at line 65 of file steepest_descent_math.f90.


| subroutine, public steepest_descent_math::sd_update_design | ( | type(vector_t), intent(inout) | x_new, |
| type(vector_t), intent(in) | x, | ||
| type(vector_t), intent(in) | s, | ||
| type(vector_t), 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), optional | n | ||
| ) |
Computes x_new = min(xmax, max(xmin, min(x + delta, max(x - delta, x + psi * (s / smax))))). This equals Eq. D24 whenever x lies in [xmin, xmax], and stays well defined for infeasible x.
| [in,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, which must be positive. |
| [in] | xmin | Lower bound of the design variables. |
| [in] | xmax | Upper bound of the design variables. |
| [in] | n | Number of entries to process, the size of x_new by default. |
Definition at line 145 of file steepest_descent_math.f90.


| subroutine, public steepest_descent_math::sd_update_move_limits | ( | type(vector_t), intent(inout) | delta, |
| type(vector_t), intent(in) | x, | ||
| type(vector_t), intent(in) | x1, | ||
| type(vector_t), 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), optional | n | ||
| ) |
With d_e = (x_e - x1_e) * (x1_e - x2_e), the move limit is scaled by dec where d_e < 0, by inc where d_e > 0, left unchanged where d_e = 0, and 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 entries to process, the size of delta by default. |
Definition at line 103 of file steepest_descent_math.f90.

