Neko 1.99.11
A portable framework for high-order spectral element flow simulations
Loading...
Searching...
No Matches
lpt_wall_collision.cu
Go to the documentation of this file.
1/*
2 Copyright (c) 2026, The Neko Authors
3 All rights reserved.
4
5 Redistribution and use in source and binary forms, with or without
6 modification, are permitted provided that the following conditions
7 are met:
8
9 * Redistributions of source code must retain the above copyright
10 notice, this list of conditions and the following disclaimer.
11
12 * Redistributions in binary form must reproduce the above
13 copyright notice, this list of conditions and the following
14 disclaimer in the documentation and/or other materials provided
15 with the distribution.
16
17 * Neither the name of the authors nor the names of its
18 contributors may be used to endorse or promote products derived
19 from this software without specific prior written permission.
20
21 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
24 FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
25 COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
26 INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
27 BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28 LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
29 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30 LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
31 ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32 POSSIBILITY OF SUCH DAMAGE.
33*/
34
36#include <device/cuda/check.h>
38
39extern "C" {
40
42 void *wall_facet_mask, void *el_list,
43 void *x_old, void *y_old, void *z_old,
44 void *x, void *y, void *z,
45 void *d, void *u, void *v, void *w,
46 void *u_lag, void *v_lag, void *w_lag,
47 void *u_laglag, void *v_laglag, void *w_laglag,
48 void *acc_xlag, void *acc_ylag, void *acc_zlag,
49 void *acc_xlaglag, void *acc_ylaglag, void *acc_zlaglag,
50 void *u_old, void *v_old, void *w_old,
51 void *acc_x, void *acc_y, void *acc_z,
52 void *dm_x, void *dm_y, void *dm_z,
53 void *nx, void *ny, void *nz,
54 int *n, int *gdim, int *nelv,
55 int *lx, int *ly, int *lz, int *lag_len, cudaStream_t strm) {
56
57 if (*n <= 0) {
58 return;
59 }
60
61 const dim3 nthrds(256, 1, 1);
62 const dim3 nblcks(((*n) + 256 - 1) / 256, 1, 1);
63
65 <<<nblcks, nthrds, 0, strm>>>(
66 (int *) wall_facet_mask, (int *) el_list,
67 (real *) x_old, (real *) y_old, (real *) z_old,
68 (real *) x, (real *) y, (real *) z,
69 (real *) d, (real *) u, (real *) v, (real *) w,
70 (real *) u_lag, (real *) v_lag, (real *) w_lag,
71 (real *) u_laglag, (real *) v_laglag, (real *) w_laglag,
72 (real *) acc_xlag, (real *) acc_ylag, (real *) acc_zlag,
73 (real *) acc_xlaglag, (real *) acc_ylaglag, (real *) acc_zlaglag,
74 (real *) u_old, (real *) v_old, (real *) w_old,
75 (real *) acc_x, (real *) acc_y, (real *) acc_z,
76 (real *) dm_x, (real *) dm_y, (real *) dm_z,
77 (real *) nx, (real *) ny, (real *) nz,
78 *n, *gdim, *nelv, *lx, *ly, *lz, *lag_len);
79 CUDA_CHECK(cudaGetLastError());
80 }
81
82}
__global__ void T *__restrict__ T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ w
__global__ void const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const int *__restrict__ const int nelv
__global__ void const T *__restrict__ u
__global__ void T *__restrict__ T *__restrict__ const T *__restrict__ const T *__restrict__ v
__global__ void const T *__restrict__ x
#define CUDA_CHECK(err)
Definition check.h:6
__global__ void lpt_handle_elastic_wall_collisions_kernel(const int *__restrict__ wall_facet_mask, const int *__restrict__ el_list, const T *__restrict__ x_old, const T *__restrict__ y_old, const T *__restrict__ z_old, T *__restrict__ x, T *__restrict__ y, T *__restrict__ z, const T *__restrict__ d, T *__restrict__ u, T *__restrict__ v, T *__restrict__ w, T *__restrict__ u_lag, T *__restrict__ v_lag, T *__restrict__ w_lag, T *__restrict__ u_laglag, T *__restrict__ v_laglag, T *__restrict__ w_laglag, T *__restrict__ acc_xlag, T *__restrict__ acc_ylag, T *__restrict__ acc_zlag, T *__restrict__ acc_xlaglag, T *__restrict__ acc_ylaglag, T *__restrict__ acc_zlaglag, T *__restrict__ u_old, T *__restrict__ v_old, T *__restrict__ w_old, T *__restrict__ acc_x, T *__restrict__ acc_y, T *__restrict__ acc_z, const T *__restrict__ dm_x, const T *__restrict__ dm_y, const T *__restrict__ dm_z, const T *__restrict__ nx, const T *__restrict__ ny, const T *__restrict__ nz, const int n, const int gdim, const int nelv, const int lx, const int ly, const int lz, const int lag_len)
double real
void cuda_lpt_handle_elastic_wall_collisions(void *wall_facet_mask, void *el_list, void *x_old, void *y_old, void *z_old, void *x, void *y, void *z, void *d, void *u, void *v, void *w, void *u_lag, void *v_lag, void *w_lag, void *u_laglag, void *v_laglag, void *w_laglag, void *acc_xlag, void *acc_ylag, void *acc_zlag, void *acc_xlaglag, void *acc_ylaglag, void *acc_zlaglag, void *u_old, void *v_old, void *w_old, void *acc_x, void *acc_y, void *acc_z, void *dm_x, void *dm_y, void *dm_z, void *nx, void *ny, void *nz, int *n, int *gdim, int *nelv, int *lx, int *ly, int *lz, int *lag_len, cudaStream_t strm)