Average each data block of size 'packing' into single values thus reducing the former grid to grid/packing.
> averageDown options ASCII table(s)
--coordinates [ pos ]
- column label of coordinates
-p / =--packing=[ 2 2 2 ]
- size of packed group
- =--shift=[ 0 0 0 ]
- shift vector of packing stencil
- grid in x,y,z (optional)
- size in x,y,z (optional)
| Figure 1: Packing stencil concept exemplified in two dimensions.|
For a periodic and regular grid stored in an ASCII table
with x as fastest and z as slowest varying coordinate, calculate the average per block of given size.
Grid resolution is reduced by the factor resulting from the chosen size of the packing stencil.
illustrates the concept in two dimensions with a 2 by 2 packing stencil.
The original 4 by 4 grid is shown in light gray and might result from a 2 by 2 finite element mesh (black lines) with linear interpolation functions, thus containing four integration points each.
During averaging, the stencil is moved across the whole grid in steps of 2 grid points along x and 2 grid points along y, i.e., in a non-overlapping fashion.
The (black) points of the resulting 4/2 by 4/2 = 2 by 2 grid fall into the center of the finite elements since a stencil shift of (0, 0) was employed in this example.
Using a stencil shift of either (-1,-1), (-1,1), (1,1), or (1,-1) in the example of Figure 1
would result in the new grid coinciding with the nodes of the finite elements and averaged from their four neighboring integration points (light gray; periodicity of the original data is always implied).