Neko 1.99.9
A portable framework for high-order spectral element flow simulations
Loading...
Searching...
No Matches
lpt_periodic_params.h
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
35#ifndef __LPT_PERIODIC_PARAMS_H__
36#define __LPT_PERIODIC_PARAMS_H__
37
39
51typedef struct {
52 real dir[9];
53 real pmin[3];
54 real pmax[3];
55 real shift[9];
56 real len[3];
58
60static inline void lpt_periodic_params_pack(
62 const real *dir_x1, const real *dir_y1, const real *dir_z1,
63 const real *dir_x2, const real *dir_y2, const real *dir_z2,
64 const real *dir_x3, const real *dir_y3, const real *dir_z3,
65 const real *min1, const real *min2, const real *min3,
66 const real *max1, const real *max2, const real *max3,
67 const real *shift_x1, const real *shift_y1, const real *shift_z1,
68 const real *shift_x2, const real *shift_y2, const real *shift_z2,
69 const real *shift_x3, const real *shift_y3, const real *shift_z3,
70 const real *len1, const real *len2, const real *len3) {
71 prm->dir[0] = *dir_x1;
72 prm->dir[1] = *dir_y1;
73 prm->dir[2] = *dir_z1;
74 prm->dir[3] = *dir_x2;
75 prm->dir[4] = *dir_y2;
76 prm->dir[5] = *dir_z2;
77 prm->dir[6] = *dir_x3;
78 prm->dir[7] = *dir_y3;
79 prm->dir[8] = *dir_z3;
80
81 prm->pmin[0] = *min1;
82 prm->pmin[1] = *min2;
83 prm->pmin[2] = *min3;
84
85 prm->pmax[0] = *max1;
86 prm->pmax[1] = *max2;
87 prm->pmax[2] = *max3;
88
89 prm->shift[0] = *shift_x1;
90 prm->shift[1] = *shift_y1;
91 prm->shift[2] = *shift_z1;
92 prm->shift[3] = *shift_x2;
93 prm->shift[4] = *shift_y2;
94 prm->shift[5] = *shift_z2;
95 prm->shift[6] = *shift_x3;
96 prm->shift[7] = *shift_y3;
97 prm->shift[8] = *shift_z3;
98
99 prm->len[0] = *len1;
100 prm->len[1] = *len2;
101 prm->len[2] = *len3;
102}
103
104#endif /* __LPT_PERIODIC_PARAMS_H__ */
__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)
double real
static void lpt_periodic_params_pack(lpt_periodic_params *prm, const real *dir_x1, const real *dir_y1, const real *dir_z1, const real *dir_x2, const real *dir_y2, const real *dir_z2, const real *dir_x3, const real *dir_y3, const real *dir_z3, const real *min1, const real *min2, const real *min3, const real *max1, const real *max2, const real *max3, const real *shift_x1, const real *shift_y1, const real *shift_z1, const real *shift_x2, const real *shift_y2, const real *shift_z2, const real *shift_x3, const real *shift_y3, const real *shift_z3, const real *len1, const real *len2, const real *len3)