62 double dz = (
a->max -
a->min)/(
a->n - 1);
64 int i2 = (
z2 -
a->min)/(
a->max -
a->min)*(
a->n - 1);
90 i1 = (
z1 -
a->min)/(
a->max -
a->min)*(
a->n - 1);
114 for (
int i =
i1 + 1;
i <
i2;
i++) {
126 double zm =
z1,
z2 =
z1 + 10.*(
a->max -
a->min);
130 double z = (
zm +
z2)/2.;
141 double max = 0.,
double min = 0.)
145 for (
int i = 0;
i <
n;
i++) {
151 A[
i] =
sf.volume -
sf.sum;
157 double x =
a/(
a -
b);
170 double max = 0.,
double min = 0.)
174 for (
int i = 0;
i <
n;
i++) {
175 double dz = (
s.max -
s.min)/(
n - 1);
184 if (volume <= 0.)
return s.min;
185 if (volume >=
s.V[
s.n-1])
return s.max;
186 int a = 0,
b =
s.n - 1;
189 if (
s.V[
i] > volume)
b =
i;
192 double c = (
s.V[
a] - volume)/(
s.V[
a] -
s.V[
b]);
193 double dz = (
s.max -
s.min)/(
s.n - 1);
194 return (
s.min +
a*
dz)*(1. -
c) + (
s.min +
b*
dz)*
c;
199 double dz = (
s.max -
s.min)/(
s.n - 1);
200 int j = (
z -
s.min)/
dz;
206 return s.A[
j] + (
z -
s.min)/
dz*(
s.A[
j+1] -
s.A[
j]);
216 for (
int i = 0;
i <
n;
i++) {
231 return p1->rho >
p2->rho ? -1 : 1;
236 double vPE = 0.,
vKE = 0.;
260 int (*
compar)(
const void *,
const void *))
306 for (
int i = 0;
i <
vol.n;
i++) {
311 for (
double volume = 0.; volume <= V[
vol.n-1]; volume += V[
vol.n-1]/35.)
334 for (
int i = 0;
i <
nb;
i++)
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)
static number sq(number x)
static number cube(number x)
scalar f[]
The primary fields are:
*cs[i, 0, 0] a *[i -1, 0, 0] j
trace void fractions(scalar Phi, scalar c, vector s={0}, double val=0.)
static float area(const KdtRect rect)
#define rho(f)
The density and viscosity are defined using arithmetic averages by default.
int heavier_than(const void *a, const void *b)
size_t psort(void **base, size_t nmemb, size_t size, int(*compar)(const void *, const void *))
Zarea zvolume(scalar zb, double *A, double *V, int n, double max=0., double min=0.)
double barycenter(Zarea s, double z1, double z2)
double area_z2(Zarea *a, double z1, double dv, double *Az)
Zarea zarea(scalar zb, double *A, double *V, int n, double max=0., double min=0.)
double volumez(Zarea s, double volume)
double zareaval(Zarea s, double z)
double area_integral(Zarea *a, double z1, double z2, double *Az)
trace double RPE(int n=100)
double energy(double *PE=NULL, double *KE=NULL)
The statsf() function returns the minimum, maximum, volume sum, standard deviation and volume for fie...
#define sf
We have the option of using some "smearing" of the density/viscosity jump.