35#ifndef __BC_NEUMANN_KERNEL__
36#define __BC_NEUMANN_KERNEL__
45#define coef_normal_area_idx(i, j, k, l, lx, nf) \
46 (((i) + (lx) * (((j) - 1) + (lx) * (((k) - 1) + (nf) * (((l) - 1))))) - 1)
55 const int * __restrict__ facet,
57 const T * __restrict__ flux,
58 const T * __restrict__ area,
62 const int idx = blockIdx.x * blockDim.x + threadIdx.x;
63 const int str = blockDim.x * gridDim.x;
65 for (
int i = (idx + 1);
i < m;
i += str) {
66 const int k = (msk[
i] - 1);
67 const int f = (facet[
i]);
76 x[k] += flux[
i-1] * area[na_idx];
84 x[k] += flux[
i-1] * area[na_idx];
92 x[k] += flux[
i-1] * area[na_idx];
102template<
typename T >
105 const int * __restrict__ facet,
109 const T * __restrict__ flux_x,
110 const T * __restrict__ flux_y,
111 const T * __restrict__ flux_z,
112 const T * __restrict__ area,
116 const int idx = blockIdx.x * blockDim.x + threadIdx.x;
117 const int str = blockDim.x * gridDim.x;
119 for (
int i = (idx + 1);
i < m;
i += str) {
120 const int k = msk[
i] - 1;
121 const int f = facet[
i];
130 x[k] += flux_x[
i-1] * area[na_idx];
131 y[k] += flux_y[
i-1] * area[na_idx];
132 z[k] += flux_z[
i-1] * area[na_idx];
140 x[k] += flux_x[
i-1] * area[na_idx];
141 y[k] += flux_y[
i-1] * area[na_idx];
142 z[k] += flux_z[
i-1] * area[na_idx];
150 x[k] += flux_x[
i-1] * area[na_idx];
151 y[k] += flux_y[
i-1] * area[na_idx];
152 z[k] += flux_z[
i-1] * area[na_idx];
__inline__ __device__ void nonlinear_index(const int idx, const int lx, int *index)
__global__ void const T *__restrict__ x
__global__ void neumann_apply_vector_kernel(const int *__restrict__ msk, const int *__restrict__ facet, T *__restrict__ x, T *__restrict__ y, T *__restrict__ z, const T *__restrict__ flux_x, const T *__restrict__ flux_y, const T *__restrict__ flux_z, const T *__restrict__ area, const int lx, const int m)
__global__ void neumann_apply_scalar_kernel(const int *__restrict__ msk, const int *__restrict__ facet, T *__restrict__ x, const T *__restrict__ flux, const T *__restrict__ area, const int lx, const int m)
#define coef_normal_area_idx(i, j, k, l, lx, nf)