91 s.max =
s.min =
s.avg;
101 s.min =
s.max =
s.avg = 0.;
103 s.speed =
s.real > 0. ?
tnc/
s.real : -1.;
118 ", %d steps, %g CPU, %.4g real, %.3g points.step/s, %d var\n",
122 "# %d procs, MPI: min %.2g (%.2g%%) "
123 "avg %.2g (%.2g%%) max %.2g (%.2g%%)\n",
125 s.min, 100.*
s.min/
s.real,
126 s.avg, 100.*
s.avg/
s.real,
127 s.max, 100.*
s.max/
s.real);
144 double avg = 0., rms = 0.,
max = 0., volume = 0.;
155 n.
avg = volume ? avg/volume : 0.;
156 n.rms = volume ?
sqrt(rms/volume) : 0.;
229 if (d2 <
d1)
d1 = d2;
234 if (d2 >
d1)
d1 = d2;
324 for (
int _s = 0;
_s < 1;
_s++)
336 for (
int _s = 0;
_s < 1;
_s++)
361 for (
int _i = -1;
_i <= 1 &&
_n < 2;
_i += 2) {
363 double a = (
p[
_n].x -
S[0].x)/
t.
x;
385 for (
int _s = 0;
_s < 1;
_s++)
389 "name",
"min",
"avg",
"stddev",
"max");
390 for (
int _s = 0;
_s < 1;
_s++) {
393 s.name,
ss.min,
ss.sum/
ss.volume,
ss.stddev,
ss.max);
vector g[]
We store the combined pressure gradient and acceleration field in g*.
define double double char Reduce reductions
define VT _attribute[s.i] v y scalar * list
static number sq(number x)
int list_len(scalar *list)
double timer_elapsed(timer t)
static number clamp(number x, number a, number b)
int vectors_len(vector *list)
scalar f[]
The primary fields are:
macro
We also redefine the "per field" (inner) traversal.
scalar omega[]
We allocate the vorticity field , the streamfunction field and a structure to store the statistics o...
The statsf() function returns the minimum, maximum, volume sum, standard deviation and volume for fie...
void timer_print(timer t, int i, size_t tnc)
This function writes timing statistics on standard output.
double sweby(double s0, double s1, double s2)
vector lookup_vector(const char *name)
scalar lookup_field(const char *name)
These functions return the scalar/vector fields called name, or -1 if they don't exist.
double change(scalar s, scalar sn)
Given two scalar fields s and sn this function returns the maximum of their absolute difference.
void gradients(scalar *f, vector *g)
Given a list of scalar fields f, this function fills the gradient fields g with the corresponding gra...
static double generic_limiter(double r, double beta)
void fields_stats(scalar *list=all)
This function returns a summary of the currently-defined fields.
double superbee(double s0, double s1, double s2)
double minmod(double s0, double s1, double s2)
void vorticity(const vector u, scalar omega)
double theta
This is the generalised minmod limiter.
void update_perf()
Performance statistics are gathered by this function, which is typically called by the run() loop.
struct @16 perf
Performance statistics are stored in this structure.
timing timer_timing(timer t, int i, size_t tnc, double *mpi)
Given a timer, iteration count i, total number of cells tnc and array of MPI timings mpi (with a size...
macro foreach_segment(coord S[2], coord p[2], Reduce reductions=None)
The macro below traverses the set of sub-segments intersecting the mesh and spanning the [A:B] segmen...
double minmod2(double s0, double s1, double s2)