32 return clamp (
c, 0., 1.) - 0.5;
49 else if (
c <= 1. -
v1/
n2)
130 return alpha - (
n.x +
n.y +
n.z)/2.;;
133# define plane_alpha line_alpha
161#define plane_volume(n, alpha) line_area(n.x, alpha)
253 double volume =
al <= 0.5 ?
tmp : 1. -
tmp;
254 return clamp (volume, 0., 1.);
257# define plane_volume(n, alpha) line_area(n.x, n.y, alpha)
274 n1.
x =
n.x*(
b.x -
a.
x);
297 for (
double s = -0.5;
s <= 0.5;
s += 1.)
299 if (
fabs (
n.y) > 1
e-4 &&
i < 2) {
301 if (
a >= -0.5 &&
a <= 0.5) {
310 {{0.,0.,0.},{1.,0.,0.}},{{0.,0.,1.},{1.,0.,1.}},
311 {{0.,1.,1.},{1.,1.,1.}},{{0.,1.,0.},{1.,1.,0.}},
312 {{0.,0.,0.},{0.,1.,0.}},{{0.,0.,1.},{0.,1.,1.}},
313 {{1.,0.,1.},{1.,1.,1.}},{{1.,0.,0.},{1.,1.,0.}},
314 {{0.,0.,0.},{0.,0.,1.}},{{1.,0.,0.},{1.,0.,1.}},
315 {{1.,1.,0.},{1.,1.,1.}},{{0.,1.,0.},{0.,1.,1.}}
322 {{9, 1, 8}, {4, 3, 7}},
323 {{6, 2, 5}, {8, 0, 9}},
324 {{10, 3, 11}, {5, 1, 6}},
325 {{7, 0, 4}, {11, 2, 10}},
326 {{3, 7, 0}, {8, 5, 11}},
327 {{11, 4, 8}, {1, 6, 2}},
328 {{2, 5, 1}, {9, 7, 10}},
329 {{10, 6, 9}, {0, 4, 3}},
330 {{5, 11, 4}, {0, 9, 1}},
331 {{1, 8, 0}, {7, 10, 6}},
332 {{6, 9, 7}, {3, 11, 2}},
333 {{2, 10, 3}, {4, 8, 5}}
341 for (
int i = 0;
i < 12;
i++) {
353 if (
t >= 0. &&
t < 1.) {
364 for (
int i = 0;
i < 12;
i++) {
395 p->x =
p->y =
p->z = 0.;
414 double ax =
p->x,
ay =
p->y;
438#define plane_area_center(m,a,p) line_length_center(m,a,p)
445 ((
double *)&
n)[0] =
m.
y;
446 ((
double *)&
n)[1] =
m.z;
449 p->y = ((
double *)&
q)[0];
450 p->z = ((
double *)&
q)[1];
464 p->x =
p->y =
p->z = 0.;
500 if (
m.x < 0.)
p->x = 1. -
p->x;
564#define plane_center(m,alpha,a,p) line_center(m,alpha,a,p)
571 ((
double *)&
n)[0] =
m.
y;
572 ((
double *)&
n)[1] =
m.z;
575 p->y = ((
double *)&
q)[0];
576 p->z = ((
double *)&
q)[1];
588 if (
alpha <= 0. ||
a == 0.) {
589 p->x =
p->y =
p->z = -0.5;
594 p->x =
p->y =
p->z = 0.;
618 double b = 24.*
n.x*
n.y*
n.z*
a;
vector q[]
The primitive variables are the momentum , pressure , density , (face) specific volume ,...
define m((k)==0 &&(l)==0 &&(m)==0) macro2 foreach_point(double _x=0.
static number sq(number x)
static number clamp(number x, number a, number b)
static int sign(number x)
static number cube(number x)
return hxx pow(1.+sq(hx), 3/2.)
scalar cs[]
The volume and area fractions are stored in these fields.
double line_length_center(coord m, double alpha, coord *p)
This function fills the coordinates p of the centroid of the interface fragment and returns the lengt...
#define plane_center(m, alpha, a, p)
This function fills the coordinates p of the centroid of the fraction a of a cubic cell lying under t...
double line_alpha(double c, coord n)
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...
void line_center(coord m, double alpha, double a, coord *p)
This function fills the coordinates p of the centroid of the fraction a of a square cell lying under ...
#define plane_area_center(m, a, p)
int facets(coord n, double alpha, coord p[2])
From the interface definition, it is also possible to compute the coordinates of the segment in 2D,...
#define plane_volume(n, alpha)
double line_area(double nx, double ny, double alpha)
Conversely there is a unique function computing as a function of and .
static float area(const KdtRect rect)
static float length(const KdtRect rect)