... | ... | @@ -25,6 +25,7 @@ Properties of the grid that can be derived from the above basic grid properties. |
|
|
* bs - Sizes of all blocks in all directions. Ret: npa(block, dir).
|
|
|
* CD - Computational domain (calculated from bb of all blocks). Ret: npa(block, dir, LO/HI).
|
|
|
* cs - Cell sizes of all blocks. Ret: npa(block, dir).
|
|
|
* maxrl - Maximum refinement level in the grid. Ret: int.
|
|
|
* minbs - Size of the smallest block. Ret: npa(dir).
|
|
|
* mincs - Size of the smallest grid cell. Ret: npa(dir).
|
|
|
|
... | ... | @@ -45,15 +46,16 @@ Reading from file |
|
|
Block transformation
|
|
|
--------------------
|
|
|
* blkSlice(b, normal, coord) - Returns a 2d slice from 3d block at a given position. Does not interpolate, just finds the closest coordinate and copies the data. Args: b is block number, normal is direction of the normal to the slicing plane, coord is a coordinate of the slicing plane. Ret: npa(dir1, dir2).
|
|
|
* blkIntegrate(b, normal, rng) - "Integrates a block along a given direction and returns a block with dimension smaller by one. Args: b is the block number; normal is a direction of the normal vector (to the plane); and rng are ranges of integration npa(LO/HI). Ret: a block with dim smaller by one
|
|
|
* blkToRefLevel(blk, rlDiff, axes) - Converts block blk to a different resolution by changing its size by a power of 2 (both shrink and grow). The values are simply copied or deleted, no interpolation is made. Args: blk is a block (npa with appropriat dimension + 1), rlDiff is a difference in the refinement level (integer), argument axes defines along which coords the growth/shrinking should be made. Ret: new block (npa with the same dim as blk.
|
|
|
* blkIntegrate(b, normal, rng, quans, weights) - Integrates a block along a given direction and returns a block with dimension smaller by one. Only certain quantities (given by list quans) are integrated. The integrated quantities are multiplied by number/array weights. Args: b is the block number; normal is a direction of the normal vector (to the plane); rng are ranges of integration npa(LO/HI); quans is a list of quantities (strings) to be integrated; and weights are integration weights - a number or npa with the same shape (appart form the last dimension - quantities) as the original block b. Ret: a block with shape (n1, n2, len(quans)) where n1 and n2 are dimensions of the original block in non-integration dimensions.
|
|
|
* blkToRefLevel(blk, rlDiff, axes) - Converts block blk to a different resolution by changing its size by a power of 2 (both shrink and grow). The values are simply copied or deleted, no interpolation is made. Args: blk is a block (npa with appropriate dimension + 1), rlDiff is a difference in the refinement level (integer), argument axes defines along which coords the growth/shrinking should be made. Ret: new block (npa with the same dim as blk.
|
|
|
|
|
|
|
|
|
Interaction with uniform grid
|
|
|
-----------------------------
|
|
|
* createUniformGrid(dim, direction, pos, reflevel, quans, bbox) - Creates a uniform grid (class CUniformGrid) covering the AMR grid, with coordinates aligned with it, restricted with given arguments. Args: dim - dimension (1, 2 or 3); direction - normal to the plane (for 2d) or direction vector (for 1d); pos - position of the plane (2d, one coordinate) or the line segment (1d, two coma-separated coordines); reflevel - refinement level determining size of UG cells; quans - quantities to be stored in the UG, encapsulated in the CQuans object; bbox - bounding box, npa(dir,LO/HI).
|
|
|
* createUniformGrid(dim, direction, pos, reflevel, quans, bbox) - Creates a uniform grid (class CUniformGrid) covering the AMR grid, with coordinates aligned with it, restricted with given arguments. Args: dim - dimension (1, 2 or 3); direction - normal to the plane (for 2d) or direction vector (for 1d); pos - position of the plane (2d, one coordinate) or the line segment (1d, two coma-separated coordines); reflevel - refinement level determining size of UG cells; quans - quantities to be stored in the UG, encapsulated in the CQList object; bbox - bounding box, npa(dir,LO/HI).
|
|
|
* insRanges(axis, bounds, ncells) - Determines sets of indices in a block (bIdx) and in an axis (aIdx) for the situation when a block (defined with bounds and ncells) is inserted into a uniform grid (defined with axis). Args: axis - axis of a uniform grid; bounds - min & max of an inserted block along the given axis; ncells - number of cells of a block in a given direction. Ret: tuple of two npa - bIdx and aIdx.
|
|
|
* fillPlane(plane) - Fills the plane (CUniformGrid) with he block data. At first it determines which blocks and quantities will be needed (separately for slices and integrals). Then, it reads them from file, transforms them to the same rlevel as the uniform grid, and inserts them there. Args: plane is the CUniformGrid object. Ret: None.
|
|
|
* fillCuboid(cuboid) - Fills the 3d cuboid (CUniformGrid) with he block data. At first it determines which blocks and quantities will be needed depending on the grid's and plane's bbox. Then, it reads them from file, transforms them to the same rlevel as the uniform grid, and inserts them there. Args: cuboid is the 3D CUniformGrid object. Ret: None.
|
|
|
* fillPlane(plane, integr, qn, plnQSlice, wn) - Fills the plane (CUniformGrid) with the block data. At first it determines which blocks and quantities will be needed depending on the grid's and plane's bbox and whether it should integrate in the third direction or just make a slice. Then, it reads the blocks from file, makes slices or integrals, transforms them to the same rlevel as the uniform grid, and inserts them into it. Args: plane is the 2D CUniformGrid object; integr is logical determining whether integrate (True) or make slice (False); qn is list of quantity names to be read and processed; and plnQSlice sets range of indeces in the plane where the quantities will be inserted. Ret: None.
|
|
|
* ugAxis(direction, reflevel, bounds) - Creates an np array with grid cells coords along certain direction (0,1,2 = x, y, z), at a certain refinement level and restricted with bounds npa(2) - min, max).
|
|
|
|
|
|
|