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

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).
 

Detailed Description

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.

Function/Subroutine Documentation

◆ sd_direction()

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.

Parameters
[in,out]sGradient on entry, projected direction on exit.
[in]xDesign variables.
[in]xminLower bound of the design variables.
[in]xmaxUpper bound of the design variables.
[in]nNumber of entries to process, the size of s by default.

Definition at line 65 of file steepest_descent_math.f90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ sd_update_design()

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.

Parameters
[in,out]x_newUpdated design variables.
[in]xCurrent design variables.
[in]sBound-projected steepest-descent direction.
[in]deltaMove limits.
[in]psiStep length.
[in]smaxGlobal maximum of the absolute value of s, which must be positive.
[in]xminLower bound of the design variables.
[in]xmaxUpper bound of the design variables.
[in]nNumber of entries to process, the size of x_new by default.

Definition at line 145 of file steepest_descent_math.f90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ sd_update_move_limits()

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].

Parameters
[in,out]deltaMove limits.
[in]xDesign variables at the current iteration.
[in]x1Design variables one iteration back.
[in]x2Design variables two iterations back.
[in]decFactor applied on oscillation.
[in]incFactor applied on monotone progress.
[in]dminSmallest allowed move limit.
[in]dmaxLargest allowed move limit.
[in]nNumber of entries to process, the size of delta by default.

Definition at line 103 of file steepest_descent_math.f90.

Here is the call graph for this function:
Here is the caller graph for this function: