Buoyancy¶
\[\dmombuo\]
332static int buoyancy (
333 const domain_t * domain,
334 const double * restrict t,
335 double * restrict src
336) {
337 // impose it only when desired
338 if (!param_add_buoyancy) {
339 return 0;
340 }
341 const int isize = domain->mysizes[0];
342 const int jsize = domain->mysizes[1];
343#if NDIMS == 3
344 const int ksize = domain->mysizes[2];
345#endif
346#if NDIMS == 2
347 BEGIN
348 src[cnt] +=
349 + 0.5 * T(i-1, j )
350 + 0.5 * T(i , j );
351 END
352#else
353 BEGIN
354 src[cnt] +=
355 + 0.5 * T(i-1, j , k )
356 + 0.5 * T(i , j , k );
357 END
358#endif
359 return 0;
360}