51 for (
int _c = 0;
_c < 4;
_c++)
66 for (
int _c = 0;
_c < 4;
_c++) {
67 static const coord a = {0.,0.,0.},
b = {.5,.5,.5};
93 for (
int _c = 0;
_c < 4;
_c++) {
236 n.
x =
p.y[] -
p.y[1];
260 double alpha = 0., ni = 0.;
261 for (
int i = 0;
i <= 1;
i++)
263 if (
p.
x[0,
i] > 0. &&
p.
x[0,
i] < 1.) {
282 s_z[] = (
p.x[] +
p.x[0,1] +
p.y[] +
p.y[1] > 2.);
318 double alpha = 0., ni = 0.;
319 for (
int i = 0;
i <= 1;
i++)
320 for (
int j = 0;
j <= 1;
j++)
387#define intersection(a,b) min(a,b)
388#define union(a,b) max(a,b)
389#define difference(a,b) min(a,-(b))
409 n.x = (
c[-1,1] + 2.*
c[-1,0] +
c[-1,-1] -
410 c[+1,1] - 2.*
c[+1,0] -
c[+1,-1]);
432 n.
x =
s.x[] -
s.x[1];
462 if (
c[] <= 0. ||
c[] >= 1.) {
521 if (
c[] > 1
e-6 &&
c[] < 1. - 1
e-6) {
535 for (
int i = 0;
i <
m;
i++)
557 if (
c[] > 1
e-6 &&
c[] < 1. - 1
e-6) {
592 return right ? (
m.x < 0. ? 1. : 0.)
593 : (
m.x > 0. ? 1. : 0.);
604 return right ? (
m.x < 0. ? 1. : 0.)
605 : (
m.
x > 0. ? 1. : 0.);
609 double j =
right ? 0.5 : -0.5;
652 else if (
f[-1] > 1. -
tol &&
f[] > 1. -
tol)
661 if (
f[] < 1. -
tol) {
673 if (
f[-1] < 1. -
tol) {
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 m((k)==0 &&(l)==0 &&(m)==0) macro2 foreach_point(double _x=0.
static int sign(number x)
scalar f[]
The primary fields are:
define sysmalloc malloc define syscalloc calloc define sysrealloc realloc define sysfree free define systrdup strdup define func
return hxx pow(1.+sq(hx), 3/2.)
scalar phi[]
The electric potential and the volume charge density are scalars while the permittivity and conductiv...
scalar cs[]
The volume and area fractions are stored in these fields.
*cs[i, 0, 0] a *[i -1, 0, 0] j
return clamp((alpha - m.x *xo)/m.y, 0., 1.)
coord youngs_normal(Point point, scalar c)
macro fraction(scalar f, double func)
The convenience macros below can be used to define volume and surface fraction fields directly from a...
void fraction_refine(Point point, scalar c)
trace double interface_area(scalar c)
macro solid(scalar cs, vector fs, double func)
trace void reconstruction(const scalar c, vector n, scalar alpha)
attribute
Finally, we also need to prolongate the reconstructed value of .
trace void output_facets(scalar c, FILE *fp=stdout, vector s={{-1}})
trace void face_fraction(scalar f, vector s, double tol=1.e-6)
This function calculates a single surface fraction value in a given face.
for(int _d=0;_d< 2;_d++) static double interface_fraction_x(coord m
static void alpha_refine(Point point, scalar alpha)
coord facet_normal(Point point, scalar c, vector s)
trace void fractions(scalar Phi, scalar c, vector s={0}, double val=0.)
auto macro coord interface_normal(Point p, scalar c)
By default the interface normal is computed using the MYC approximation.
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 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)
macro
We also redefine the "per field" (inner) traversal.
static void refine_injection(Point point, scalar v)
coord mycs(Point point, scalar c)