|
Neko-TOP
A portable framework for high-order spectral element flow toplogy optimization.
|
CUDA kernels of the steepest-descent optimizer. More...

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) |
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:
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.
| __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.
| s | Gradient on entry, projected direction on exit. |
| x | Design variables. |
| xmin | Lower bound of the design variables. |
| xmax | Upper bound of the design variables. |
| n | Number of design variables. |
Definition at line 55 of file steepest_descent_kernel.h.

| __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))))).
| x_new | Updated design variables. |
| x | Current design variables. |
| s | Bound-projected steepest-descent direction. |
| delta | Move limits. |
| psi | Step length. |
| smax | Global maximum of the absolute value of s. |
| xmin | Lower bound of the design variables. |
| xmax | Upper bound of the design variables. |
| n | Number of design variables. |
Definition at line 122 of file steepest_descent_kernel.h.

| __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].
| delta | Move limits, updated in place. |
| x | Design variables at the current iteration. |
| x1 | Design variables one iteration back. |
| x2 | Design variables two iterations back. |
| dec | Factor applied on oscillation. |
| inc | Factor applied on monotone progress. |
| dmin | Smallest allowed move limit. |
| dmax | Largest allowed move limit. |
| n | Number of design variables. |
Definition at line 87 of file steepest_descent_kernel.h.
