16 double k = 0.,
s = 0.;
17 for (
int _c = 0;
_c < 4;
_c++)
31 for (
int _c = 0;
_c < 4;
_c++) {
32 double sk = 0.,
s = 0.;
33 for (
int i = 0;
i <= 1;
i++)
35 for (
int j = 0;
j <= 1;
j++)
38 for (
int k = 0;
k <= 1;
k++)
77 for (
int i = -1;
i <= 1;
i++)
94 n.x = (
h.
y[-1] -
h.
y[1])/2.;
96 n.x =
h.
y[-1] -
h.
y[];
112 for (
int i = -1;
i <= 1;
i++)
113 for (
int j = -1;
j <= 1;
j++)
116 double hx = (
h.z[1] -
h.z[-1])/2.;
117 double hy = (
h.z[0,1] -
h.z[0,-1])/2.;
126 double hxx = (
filter*(
h.z[1,1] +
h.z[-1,1] - 2.*
h.z[0,1]) +
127 (
h.z[1] +
h.z[-1] - 2.*
h.z[]) +
128 filter*(
h.z[1,-1] +
h.z[-1,-1] - 2.*
h.z[0,-1]))/
130 double hyy = (
filter*(
h.z[1,1] +
h.z[1,-1] - 2.*
h.z[1]) +
131 (
h.z[0,1] +
h.z[0,-1] - 2.*
h.z[]) +
132 filter*(
h.z[-1,1] +
h.z[-1,-1] - 2.*
h.z[-1]))/
134 double hxy = (
h.z[1,1] +
h.z[-1,-1] -
h.z[1,-1] -
h.z[-1,1])/(4.*
Delta);
146 double a =
ori ? -1. : 1.;
238 double nr, r =
y,
hx;
346 for (
int j = 1;
j <
n;
j++) {
347 bool depends =
false;
348 for (
int i = 0;
i <
j && !depends;
i++) {
352 depends = (d2 <
sq(0.5));
385 for (
int i = -1;
i <= 1;
i++)
390 for (
int i = -1;
i <= 1;
i++)
391 for (
int j = -1;
j <= 1;
j++)
404 for (
int i = -1;
i <= 1;
i++)
408 for (
int i = -1;
i <= 1;
i++)
409 for (
int j = -1;
j <= 1;
j++)
442 for (
int i = 0;
i <
n;
i++)
475 for (
int _n = 0;
_n < 1;
_n++)
476 if (
c[] > 0. &&
c[] < 1.) {
509 for (
int i = -1;
i <= 1;
i += 2)
514 else if (
c[] <= 0.) {
515 for (
int i = -1;
i <= 1;
i += 2)
544 double sigma = 1.[0],
bool add =
false)
603 double sk = 0.,
a = 0.;
604 for (
int _n = 0;
_n < 1;
_n++)
636 double p = r > 0. ? - 2.*
sigma/r : 0.;
define m((k)==0 &&(l)==0 &&(m)==0) macro2 foreach_point(double _x=0.
void(* scalar_clone)(scalar, scalar)
static number sq(number x)
static number clamp(number x, number a, number b)
static int sign(number x)
scalar f[]
The primary fields are:
return hxx pow(1.+sq(hx), 3/2.)
trace cstats curvature(scalar c, scalar kappa, double sigma=1.[0], bool add=false)
static double height_curvature_fit(Point point, scalar c, vector h)
Given a volume fraction field c and a height function field h, this function returns the "mixed heigh...
static double height_position(Point point, scalar f, vector h, coord *G, coord *Z)
We now need to choose one of the , or height functions to compute the position.
static bool interfacial(Point point, scalar c)
coord height_normal(Point point, scalar c, vector h)
The function below works in a similar manner to return the normal estimated using height-functions (o...
static int independents(coord *p, int n)
In three dimensions, these functions return the (two) components of the normal projected onto the $(x...
static double height_curvature(Point point, scalar c, vector h)
We now need to choose one of the , or height functions to compute the curvature.
static void curvature_prolongation(Point point, scalar kappa)
The prolongation function performs a similar averaging, but using the same stencil as that used for b...
static double centroids_curvature_fit(Point point, scalar c)
static void curvature_restriction(Point point, scalar kappa)
*cs[i, 0, 0] a *[i -1, 0, 0] j
#define plane_area_center(m, a, p)
trace void heights(scalar c, vector h)
The heights() function implementation is similar to the multigrid case, but the construction of the s...
static int orientation(double H)
static double height(double H)
static float area(const KdtRect rect)
coord mycs(Point point, scalar c)
static double parabola_fit_curvature(ParabolaFit *p, double kappamax, double *kmax)
static void parabola_fit_add(ParabolaFit *p, coord m, double w)
static void parabola_fit_init(ParabolaFit *p, coord o, coord m)
#define PARABOLA_FIT_CENTER_WEIGHT
static double parabola_fit_solve(ParabolaFit *p)
The function below computes the mean curvature kappa of the interface defined by the volume fraction ...
define n n define coarse(a, k, p, n)((double *)(PARENT(k
def allocated(k, l, n)(mem_allocated(((Tree *) grid) -> L[point.level]->m, point.i+k, point.j+l)) @ @def NEIGHBOR(k, l, n)(((((Tree *) grid) ->L[point.level]->m) ->b[point.i+k][point.j+l])) @ @def PARENT(k, l, n)(((((Tree *) grid) ->L[point.level-1]->m) ->b[(point.i+2)/2+k][(point.j+2)/2+l])) @ @def allocated_child(k, l, n)(level< depth() &&mem_allocated(((Tree *) grid) ->L[point.level+1]->m, 2 *point.i- 2+k, 2 *point.j- 2+l)) @ @def CHILD(k, l, n)(((((Tree *) grid) ->L[point.level+1]->m) ->b[2 *point.i- 2+k][2 *point.j- 2+l])) @ @define CELL(m)(*((Cell *)(m))) @define depth()(grid->depth) @define aparent(k, l, n) CELL(PARENT(k, l, n)) @define child(k, l, n) CELL(CHILD(k, l, n)) @define cell CELL(NEIGHBOR(0, 0, 0)) @define neighbor(k, l, n) CELL(NEIGHBOR(k, l, n)) @def neighborp(l, m, n)(Point)
#define sf
We have the option of using some "smearing" of the density/viscosity jump.