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

CUDA kernels of the steepest-descent optimizer. More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

template<typename T >
__global__ void sd_direction_kernel (T *__restrict__ s, const T *__restrict__ x, const T xmin, const T xmax, const int n)
 
template<typename T >
__global__ void sd_update_move_limits_kernel (T *__restrict__ delta, const T *__restrict__ x, const T *__restrict__ x1, const T *__restrict__ x2, const T dec, const T inc, const T dmin, const T dmax, const int n)
 
template<typename T >
__global__ void sd_update_design_kernel (T *__restrict__ x_new, const T *__restrict__ x, const T *__restrict__ s, const T *__restrict__ delta, const T psi, const T smax, const T xmin, const T xmax, const int n)
 

Detailed Description

Elementwise kernels of the steepest descent method with move limits, Appendix D of da Silva, Aage, Beck & Sigmund (2021), Eqs. D22-D24. They implement the same formulas as steepest_descent_cpu.f90.

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 steepest_descent_kernel.h.

Function Documentation

◆ sd_direction_kernel()

template<typename T >
__global__ void sd_direction_kernel ( T *__restrict__  s,
const T *__restrict__  x,
const T  xmin,
const T  xmax,
const int  n 
)

Device kernel for the bound-projected steepest-descent direction (D22). On entry s holds the gradient G, on exit S = -G with every component that points out of the box at an active bound set to zero.

Parameters
sGradient on entry, projected direction on exit.
xDesign variables.
xminLower bound of the design variables.
xmaxUpper bound of the design variables.
nNumber of design variables.

Definition at line 55 of file steepest_descent_kernel.h.

Here is the call graph for this function:

◆ sd_update_design_kernel()

template<typename T >
__global__ void sd_update_design_kernel ( T *__restrict__  x_new,
const T *__restrict__  x,
const T *__restrict__  s,
const T *__restrict__  delta,
const T  psi,
const T  smax,
const T  xmin,
const T  xmax,
const int  n 
)

Device kernel for the move-limited, box-constrained update (D24). x_new = min(xmax, max(xmin, min(x + delta, max(x - delta, x + psi * (s / smax))))).

Parameters
x_newUpdated design variables.
xCurrent design variables.
sBound-projected steepest-descent direction.
deltaMove limits.
psiStep length.
smaxGlobal maximum of the absolute value of s.
xminLower bound of the design variables.
xmaxUpper bound of the design variables.
nNumber of design variables.

Definition at line 122 of file steepest_descent_kernel.h.

Here is the call graph for this function:

◆ sd_update_move_limits_kernel()

template<typename T >
__global__ void sd_update_move_limits_kernel ( T *__restrict__  delta,
const T *__restrict__  x,
const T *__restrict__  x1,
const T *__restrict__  x2,
const T  dec,
const T  inc,
const T  dmin,
const T  dmax,
const int  n 
)

Device kernel for the move-limit adaptation (D23). With d = (x - x1) * (x1 - x2), delta is scaled by dec where d < 0, by inc where d > 0, left unchanged where d = 0, and then clamped to [dmin, dmax].

Parameters
deltaMove limits, updated in place.
xDesign variables at the current iteration.
x1Design variables one iteration back.
x2Design variables two iterations back.
decFactor applied on oscillation.
incFactor applied on monotone progress.
dminSmallest allowed move limit.
dmaxLargest allowed move limit.
nNumber of design variables.

Definition at line 87 of file steepest_descent_kernel.h.

Here is the call graph for this function: