29 constexpr
size_t YBF = 16;
30 #pragma omp parallel for collapse(2)
31 for (
size_t yy = 0; yy < ny; yy += YBF) {
32 for (
size_t z = 0; z < nz; z++) {
33 size_t ymax = yy + YBF;
37 for (
size_t y = yy; y < ymax; y++) {
44 c = x + y * nx + z * nx * ny;
46 for (x = 1; x < nx - 1; x++) {
49 if (y == 0 || y == (ny - 1) || z == 0 || z == (nz - 1)) {
78 constexpr
size_t YBF = 16;
79 #pragma omp parallel for collapse(2)
80 for (
size_t yy = 0; yy < ny; yy += YBF) {
81 for (
size_t z = 0; z < nz; z++) {
82 size_t ymax = yy + YBF;
86 for (
size_t y = yy; y < ymax; y++) {
93 c = x + y * nx + z * nx * ny;
130 for (x = 1; x < nx - 1; x++) {
138 (d * dt * ibl2) * (
c1_[c - 1] - 2 *
c1_[c] +
c1_[c + 1] +
139 l[0] *
c1_[s] - 2 *
c1_[c] + l[1] *
c1_[n] +
140 l[2] *
c1_[b] - 2 *
c1_[c] + l[3] *
c1_[t]);
167 constexpr
size_t YBF = 16;
168 #pragma omp parallel for collapse(2)
169 for (
size_t yy = 0; yy < ny; yy += YBF) {
170 for (
size_t z = 0; z < nz; z++) {
171 size_t ymax = yy + YBF;
175 for (
size_t y = yy; y < ymax; y++) {
182 c = x + y * nx + z * nx * ny;
184 for (x = 0; x < nx; x++) {
185 if (x == 0 || x == (nx - 1) || y == 0 || y == (ny - 1) || z == 0 ||
217 const size_t num_boxes = nx * ny * nz;
224 constexpr
size_t YBF = 16;
225 #pragma omp parallel for collapse(2)
226 for (
size_t yy = 0; yy < ny; yy += YBF) {
227 for (
size_t z = 0; z < nz; z++) {
228 size_t ymax = yy + YBF;
232 for (
size_t y = yy; y < ymax; y++) {
239 c = x + y * nx + z * nx * ny;
241 for (x = 0; x < nx; x++) {
250 real_t left{
c1_[std::clamp(c - 1,
size_t{0}, num_boxes - 1)]};
251 real_t right{
c1_[std::clamp(c + 1,
size_t{0}, num_boxes - 1)]};
252 real_t bottom{
c1_[std::clamp(b,
size_t{0}, num_boxes - 1)]};
253 real_t top{
c1_[std::clamp(t,
size_t{0}, num_boxes - 1)]};
254 real_t north{
c1_[std::clamp(n,
size_t{0}, num_boxes - 1)]};
255 real_t south{
c1_[std::clamp(s,
size_t{0}, num_boxes - 1)]};
256 real_t center_factor{6.0};
258 if (x == 0 || x == (nx - 1) || y == 0 || y == (ny - 1) || z == 0 ||
268 left = boundary_value;
269 center_factor -= 1.0;
270 }
else if (x == (nx - 1)) {
271 right = boundary_value;
272 center_factor -= 1.0;
276 north = boundary_value;
277 center_factor -= 1.0;
278 }
else if (y == (ny - 1)) {
279 south = boundary_value;
280 center_factor -= 1.0;
284 bottom = boundary_value;
285 center_factor -= 1.0;
286 }
else if (z == (nz - 1)) {
287 top = boundary_value;
288 center_factor -= 1.0;
293 (d * dt * ibl2) * (left + right + south + north + top +
294 bottom - center_factor *
c1_[c]);
312 constexpr
size_t YBF = 16;
313 #pragma omp parallel for collapse(2)
314 for (
size_t yy = 0; yy < ny; yy += YBF) {
315 for (
size_t z = 0; z < nz; z++) {
316 size_t ymax = yy + YBF;
320 for (
size_t y = yy; y < ymax; y++) {
327 size_t c = y * nx + z * nx * ny;
329 for (
size_t x = 0; x < nx; x++) {
339 l = nx - 1 + y * nx + z * nx * ny;
340 }
else if (x == (nx - 1)) {
341 r = 0 + y * nx + z * nx * ny;
345 n = x + (ny - 1) * nx + z * nx * ny;
346 }
else if (y == (ny - 1)) {
347 s = x + 0 * nx + z * nx * ny;
351 b = x + y * nx + (nz - 1) * nx * ny;
352 }
else if (z == (nz - 1)) {
353 t = x + y * nx + 0 * nx * ny;
358 ((d * dt / (dx * dx)) * (
c1_[l] +
c1_[r] +
c1_[n] +
c1_[s] +