25 for (
int _c = 0;
_c < 4;
_c++)
38 for (
int _c = 0;
_c < 4;
_c++) {
39 static const coord a = {0.,0.,0.},
b = {.5,.5,.5};
63 if (
cs[] <= 0. ||
cs[] >= 1.) {
69 for (
int j = 0;
j <= 1;
j++)
70 for (
int k = 0;
k <= 1;
k++)
72 for (
int i = 0;
i <= 1;
i++)
75 for (
int j = 0;
j <= 1;
j++)
76 for (
int k = 0;
k <= 1;
k++)
116 for (
int j = 0;
j <= 1;
j++)
117 for (
int k = 0;
k <= 1;
k++)
121 static const coord a = {0.,0.,0.},
b = {.5,.5,.5};
123 nc.
x = 0.,
nc.y = (2.*
j - 1.)*
n.y,
nc.z = (2.*
k - 1.)*
n.z;
134 for (
int i = 0;
i <= 1;
i++)
139 for (
int j = 0;
j <= 1;
j++)
140 for (
int k = 0;
k <= 1;
k++)
149 double a =
fs.
y[0,1] <= 0. ||
fs.
y[2*
i-1,1] <= 0. ||
150 fs.
y[] >= 1. ||
fs.
y[2*
i-1] >= 1.;
151 if ((2.*
a - 1)*(
fs.
x[
i] - 0.5) > 0.) {
166 for (
int j = 0;
j <= 1;
j++)
167 for (
int k = 0;
k <= 1;
k++) {
168 static const coord a = {0.,0.,0.},
b = {.5,.5,.5};
170 nc.
x = 0.,
nc.y = (2.*
j - 1.)*
n.y,
nc.z = (2.*
k - 1.)*
n.z;
182 for (
int j = 0;
j <= 1;
j++)
184 for (
int k = 0;
k <= 1;
k++)
225 double val = 0.,
nv = 0.;
226 for (
int i = 0;
i <= 1;
i++)
228 for (
int j = 0;
j <= 1;
j++)
242 for (
int _c = 0;
_c < 4;
_c++)
253 if (
s.embed_gradient &&
s.boundary[0] !=
s.boundary_homogeneous[0]) {
272 for (
int _c = 0;
_c < 4;
_c++) {
375 for (
int i = 0;
i <= 1;
i++)
381 (
v.x[
i,0,+1]/
fs.
x[
i,0,+1] -
v.x[
i,0,-1]/
fs.
x[
i,0,-1])/8. : 0.;
382 for (
int j = 0;
j <= 1;
j++)
383 for (
int k = 0;
k <= 1;
k++)
386 (2*
j - 1)*
g1 + (2*
k - 1)*
g2) : 0.;
389 double g1 = (
fs.
x[0,+1] +
fs.
x[1,+1]) && (
fs.
x[0,-1] +
fs.
x[1,-1]) ?
390 ((
v.x[0,+1] +
v.x[1,+1])/(
fs.
x[0,+1] +
fs.
x[1,+1]) -
391 (
v.x[0,-1] +
v.x[1,-1])/(
fs.
x[0,-1] +
fs.
x[1,-1]))/8. : 0.;
392 double g2 = (
fs.
x[1,0,+1] +
fs.
x[0,0,+1]) && (
fs.
x[1,0,-1] +
fs.
x[0,0,-1]) ?
393 ((
v.x[0,0,+1] +
v.x[1,0,+1])/(
fs.
x[1,0,+1] +
fs.
x[0,0,+1]) -
394 (
v.x[0,0,-1] +
v.x[1,0,-1])/(
fs.
x[1,0,-1] +
fs.
x[0,0,-1]))/8. : 0.;
395 for (
int j = 0;
j <= 1;
j++)
396 for (
int k = 0;
k <= 1;
k++)
399 (2*
j - 1)*
g1 + (2*
k - 1)*
g2) : 0.;
vector g[]
We store the combined pressure gradient and acceleration field in g*.
if TRASH define &&NewPid *& val(newpid, 0, 0, 0)) -> pid > 0) @else @ define is_newpid()(((NewPid *)&val(newpid, 0, 0, 0)) ->pid > 0) @endif Array *linear_tree(size_t size, scalar newpid)
define neighbor(o, p, q)((Point)
static void embed_fraction_refine(Point point, scalar cs)
static void restriction_embed_linear(Point point, scalar s)
static void refine_embed_linear(Point point, scalar s)
scalar cs[]
The volume and area fractions are stored in these fields.
static coord embed_gradient(Point point, vector u, coord p, coord n)
*cs[i, 0, 0] a *[i -1, 0, 0] j
coord facet_normal(Point point, scalar c, vector s)
double rectangle_fraction(coord n, double alpha, coord a, coord b)
VOF algorithms require the computation of volume fractions on (rectangular) parts of the initial squa...
define is_active() cell(true) @define is_leaf(cell)(point.level
define n n define coarse(a, k, p, n)((double *)(PARENT(k