Neko 1.99.9
A portable framework for high-order spectral element flow simulations
Loading...
Searching...
No Matches
compressible_res.cu
Go to the documentation of this file.
1/*
2 Copyright (c) 2025, 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>
37
39
40extern "C" {
41
43 void *rhs_m_y, void *rhs_m_z, void *rhs_E,
44 void *visc_rho, void *visc_m_x, void *visc_m_y,
45 void *visc_m_z, void *visc_E,
46 void *Binv, void *h1, int *n) {
47
48 const dim3 nthrds(1024, 1, 1);
49 const dim3 nblcks(((*n) + 1024 - 1) / 1024, 1, 1);
50 const cudaStream_t stream = (cudaStream_t) glb_cmd_queue;
51
53 <<<nblcks, nthrds, 0, stream>>>((real *) rhs_rho, (real *) rhs_m_x,
54 (real *) rhs_m_y, (real *) rhs_m_z,
55 (real *) rhs_E, (real *) visc_rho,
56 (real *) visc_m_x, (real *) visc_m_y,
57 (real *) visc_m_z, (real *) visc_E,
58 (real *) Binv, (real *) h1, *n);
60 }
61
62 void inviscid_res_part_mx_flux_cuda(void *f_x, void *f_y, void *f_z,
63 void *m_x, void *m_y, void *m_z,
64 void *rho_field, void *p, int *n) {
65
66 const dim3 nthrds(1024, 1, 1);
67 const dim3 nblcks(((*n) + 1024 - 1) / 1024, 1, 1);
68 const cudaStream_t stream = (cudaStream_t) glb_cmd_queue;
69
71 <<<nblcks, nthrds, 0, stream>>>((real *) f_x, (real *) f_y, (real *) f_z,
72 (real *) m_x, (real *) m_y, (real *) m_z,
73 (real *) rho_field, (real *) p, *n);
75 }
76
77 void inviscid_res_part_my_flux_cuda(void *f_x, void *f_y, void *f_z,
78 void *m_x, void *m_y, void *m_z,
79 void *rho_field, void *p, int *n) {
80
81 const dim3 nthrds(1024, 1, 1);
82 const dim3 nblcks(((*n) + 1024 - 1) / 1024, 1, 1);
83 const cudaStream_t stream = (cudaStream_t) glb_cmd_queue;
84
86 <<<nblcks, nthrds, 0, stream>>>((real *) f_x, (real *) f_y, (real *) f_z,
87 (real *) m_x, (real *) m_y, (real *) m_z,
88 (real *) rho_field, (real *) p, *n);
90 }
91
92 void inviscid_res_part_mz_flux_cuda(void *f_x, void *f_y, void *f_z,
93 void *m_x, void *m_y, void *m_z,
94 void *rho_field, void *p, int *n) {
95
96 const dim3 nthrds(1024, 1, 1);
97 const dim3 nblcks(((*n) + 1024 - 1) / 1024, 1, 1);
98 const cudaStream_t stream = (cudaStream_t) glb_cmd_queue;
99
101 <<<nblcks, nthrds, 0, stream>>>((real *) f_x, (real *) f_y, (real *) f_z,
102 (real *) m_x, (real *) m_y, (real *) m_z,
103 (real *) rho_field, (real *) p, *n);
105 }
106
107 void inviscid_res_part_E_flux_cuda(void *f_x, void *f_y, void *f_z,
108 void *m_x, void *m_y, void *m_z,
109 void *rho_field, void *p, void *E,
110 int *n) {
111
112 const dim3 nthrds(1024, 1, 1);
113 const dim3 nblcks(((*n) + 1024 - 1) / 1024, 1, 1);
114 const cudaStream_t stream = (cudaStream_t) glb_cmd_queue;
115
117 <<<nblcks, nthrds, 0, stream>>>((real *) f_x, (real *) f_y, (real *) f_z,
118 (real *) m_x, (real *) m_y, (real *) m_z,
119 (real *) rho_field, (real *) p, (real *) E, *n);
121 }
122
124 void *rhs_m_y, void *rhs_m_z,
125 void *rhs_E, void *mult, int *n) {
126
127 const dim3 nthrds(1024, 1, 1);
128 const dim3 nblcks(((*n) + 1024 - 1) / 1024, 1, 1);
129 const cudaStream_t stream = (cudaStream_t) glb_cmd_queue;
130
132 <<<nblcks, nthrds, 0, stream>>>((real *) rhs_rho, (real *) rhs_m_x,
133 (real *) rhs_m_y, (real *) rhs_m_z,
134 (real *) rhs_E, (real *) mult, *n);
136 }
137
138 void compressible_res_part_rk_sum_cuda(void *rho, void *m_x, void *m_y,
139 void *m_z, void *E,
140 void *k_rho_i, void *k_m_x_i, void *k_m_y_i,
141 void *k_m_z_i, void *k_E_i,
142 real *dt, real *c, int *n) {
143 const dim3 nthrds(1024, 1, 1);
144 const dim3 nblcks(((*n) + 1024 - 1) / 1024, 1, 1);
145 const cudaStream_t stream = (cudaStream_t) glb_cmd_queue;
146
148 <<<nblcks, nthrds, 0, stream>>>((real *) rho, (real *) m_x, (real *) m_y,
149 (real *) m_z, (real *) E,
150 (real *) k_rho_i, (real *) k_m_x_i, (real *) k_m_y_i,
151 (real *) k_m_z_i, (real *) k_E_i,
152 *dt, *c, *n);
154 }
155}
156
void inviscid_res_part_my_flux_cuda(void *f_x, void *f_y, void *f_z, void *m_x, void *m_y, void *m_z, void *rho_field, void *p, int *n)
void compressible_res_part_coef_mult_cuda(void *rhs_rho, void *rhs_m_x, void *rhs_m_y, void *rhs_m_z, void *rhs_E, void *mult, int *n)
void compressible_res_part_visc_cuda(void *rhs_rho, void *rhs_m_x, void *rhs_m_y, void *rhs_m_z, void *rhs_E, void *visc_rho, void *visc_m_x, void *visc_m_y, void *visc_m_z, void *visc_E, void *Binv, void *h1, int *n)
void inviscid_res_part_E_flux_cuda(void *f_x, void *f_y, void *f_z, void *m_x, void *m_y, void *m_z, void *rho_field, void *p, void *E, int *n)
void compressible_res_part_rk_sum_cuda(void *rho, void *m_x, void *m_y, void *m_z, void *E, void *k_rho_i, void *k_m_x_i, void *k_m_y_i, void *k_m_z_i, void *k_E_i, real *dt, real *c, int *n)
void inviscid_res_part_mz_flux_cuda(void *f_x, void *f_y, void *f_z, void *m_x, void *m_y, void *m_z, void *rho_field, void *p, int *n)
void inviscid_res_part_mx_flux_cuda(void *f_x, void *f_y, void *f_z, void *m_x, void *m_y, void *m_z, void *rho_field, void *p, int *n)
__global__ void ale_add_kinematics_kernel(const int n, T *__restrict__ wx, T *__restrict__ wy, T *__restrict__ wz, const T *__restrict__ x_ref, const T *__restrict__ y_ref, const T *__restrict__ z_ref, const T *__restrict__ phi, const T *__restrict__ x, const T *__restrict__ y, const T *__restrict__ z, const kinematics_params_t kin_params)
__global__ void T *__restrict__ T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ h1
__global__ void const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ dt
#define CUDA_CHECK(err)
Definition check.h:6
double real