The most common routines needed in nek500 are
Rescales the array x to be in the range (x0,x1). This is usually called from usrdat2 in the .usr file
Computes the error norms of a vector field variable(x1,x2,x3) defined on mesh 1, the velocity mesh. The error norms are normalized with respect to the volume, with the exception on the infinity norm, linf.
Computes the vorticity (vort) of the velocity field, (u,v,w)
Generates the Lambda-2 vortex criterion proposed by Jeong and Hussain (1995)
Computes the r-s planar average of the quantity u.
Computes torque about the point x0. Here scale is a user supplied multiplier so that the results may be scaled to any convenient non-dimensionalization. Both the drag and the torque can be printed to the screen by switching the appropriate ifdout(drag) or iftout(torque) logical.
Defines objects for surface integrals by changing the value of hcode for future calculations. Typically called once within userchk (for istep = 0) and used for calculating torque. (see above)
subroutine avg1(avg,f, alpha,beta,n,name,ifverbose)
subroutine avg2(avg,f, alpha,beta,n,name,ifverbose)
subroutine avg3(avg,f,g, alpha,beta,n,name,ifverbose)
These three subroutines calculate the (weighted) average of f. Depending on the value of the logical, ifverbose, the results will be printed to standard output along with name. In avg2, the f component is squared. In avg3, vector g also contributes to the average calculation.
subroutine outpost(x,vy,vz,pr,tz,’ ’)
Dumps the current data of x,vy,vz,pr,tz to an .fld or .f0???? file for post processing.
Runs the battery of timing tests for matrix-matrix products,contention-free processor-to-processor ping-pong tests, and mpi_all_reduce times. Allows one to check the performance of the communication routines used on specific platforms.
Moves the mesh to allow user affine motion.
Computes,stores, and (for ipostep!0) prints runtime averages of j-quantity y (along w/ y itself unless ipostep<0) with j + ’rtavg_’ + (unique) s5 every ipostep for istep>=istep1. s5 is a string to append to rtavg_ for storage file naming.
Compute Lagrangian interpolant for uo
Copies b1 to a1, b2 to a2, and b3 to a3, when ndim = 3,
Adds const to vector a of size n.
For n entries, calculates a=a*b.
For n entries, calculates a=b*c.
function glmax(a,n) function glamax(a,n) function iglmax(a,n) Calculates the (absolute) max of a vector that is size n. Prefix i implies integer type. function i8glmax(a,n) Calculates the max of an integer*8 vector that is size n. function glmin(a,n) function glamin(a,n) function iglmin(a,n) Calculates the (absolute) min of a vector that is size n. Prefix i implies integer type.
function glsc2(a,b,n) function glsc3(a,b,mult,n) function glsc23(z,y,z,n) Performs the inner product in double precision. glsc3 uses a multiplier, mult and glsc23 performs x*x*y*z.
function glsum(x,n) function iglsum(x,n) function i8glsum(x,n) Computes the global sum of x, where the prefix, i specifies type integer, and i8 specifies type integer*8.
This example will load a list of field files (filenames are read from a file) into the solver using the load_fld() function. After the data is loaded, the user is free to compute other postprocessing quantities. At the end the results are dumped onto a regular (uniform) mesh by a subsequent call to prepost().
Note: The regular grid data (field files) cannot be used as a restart file (uniform->GLL interpolation is unstable)!
Check intpts(). Monitor Points
Multiple monitor points can be defined in the file hpts.in to examine the field data at every timestep.
To interpolate an existing field file (e.g. base.fld) onto a new mesh do the following:
The interpolation tool can be used for Lagrangian particle tracking (the particles are the interpolation points).
Workflow: Set initial particle positions (e.g. reading a file particle.pos0) x_part <- x_pos0