166 for (
int _s = 0;
_s < 1;
_s++) {
199 if (
sq(
A->x.y) < 1
e-15) {
200 R->
x.
x =
R->y.y = 1.;
201 R->y.x =
R->x.y = 0.;
206 double T =
A->x.x +
A->y.y;
207 double D =
A->
x.x*
A->y.y -
sq(
A->x.y);
213 R->x.x =
R->x.y =
A->x.y;
214 R->y.x =
R->y.y = -
A->x.x;
220 double *
Rx = (
double *) &
R->x;
221 double *
Ry = (
double *) &
R->y;
291 double eta = 1.,
nu = 1.;
341 B.
x.
y = (
u.y[1,0] -
u.y[-1,0] +
342 u.x[0,1] -
u.x[0,-1])/(4.*
Delta);
344 B.x.x = (
u.x[1,0] -
u.x[-1,0])/(2.*
Delta);
349 M.
x.
x = (
sq(
R.x.x)*(
u.x[1] -
u.x[-1]) +
350 sq(
R.y.x)*(
u.y[0,1] -
u.y[0,-1]) +
351 R.x.x*
R.y.x*(
u.x[0,1] -
u.x[0,-1] +
353 M.
x.
y = (
R.x.x*
R.x.y*(
u.x[1] -
u.x[-1]) +
354 R.x.y*
R.y.x*(
u.y[1] -
u.y[-1]) +
355 R.x.x*
R.y.y*(
u.x[0,1] -
u.x[0,-1]) +
356 R.y.x*
R.y.y*(
u.y[0,1] -
u.y[0,-1]))/(2.*
Delta);
361 B.x.y = M.
x.
x*
R.x.x*
R.y.x + M.
y.
y*
R.y.y*
R.x.y;
370 double s = -
Psi.x.y[];
421 u.x[0,1] -
u.x[0,-1])/(2.*
Delta);
455 double eta = 1.,
nu = 1.;
530 if (
fm.
x[] > 1
e-20) {
vector uf[]
We allocate the (face) velocity field.
trace void advection(scalar *tracers, vector u, double dt, scalar *src=NULL)
The function below uses the tracer_fluxes function to integrate the advection equation,...
static double periodic_bc(Point point, Point neighbor, scalar s, bool *data)
static number sq(number x)
vector D[]
The linear system can be inverted with the multigrid Poisson solver.
scalar omega[]
We allocate the vorticity field , the streamfunction field and a structure to store the statistics o...