A Rectangular Domain on an Integer Lattice
A Box is an abstraction for defining discrete rectangular regions of SpaceDim-dimensioned indexing space. Boxes have an IndexType, which defines IndexType::CELL or IndexType::NODE based points for each direction and a low and high IntVect which defines the lower and upper corners of the Box. Boxes can exist in positive and negative indexing space.There is a set of canonical Empty Boxes, once for each centering type. The cell-centered Empty Box can be accessed as Box::Empty.
Box is a dimension dependent class, so SpaceDim must be defined as either 1, 2, or 3 when compiling.
type CELL -> NODE : increase coordinate by one on high end.
type NODE -> CELL : reduce coordinate by one on high end.
other type mappings make no change.
type CELL -> NODE : increase coordinate by one on high end.
type NODE -> CELL : reduce coordinate by one on high end.
Other type mappings make no change. Directions are zero-based. It is an error if not 0 <= dir < SpaceDim.
NOTE: len >= 1.
NOTE: Box retval = adjCellLo(b,dir,len) is equivalent to the
following set of operations:
Box retval(b);
retval.convert(dir,Box::CELL);
retval.setrange(dir,retval.smallEnd(dir)-len,len);
Directions are zero-based. It is an error if not 0 <= dir < SpaceDim. The neighbor of an Empty Box is an Empty Box of the appropriate type.
NOTE: len >= 1.
NOTE: Box retval = adjCellHi(b,dir,len) is equivalent to the
following set of operations:
Box retval(b);
retval.convert(dir,Box::CELL);
retval.setrange(dir,retval.bigEnd(dir)+1,len);
Directions are zero-based. It is an error if not 0 <= dir < SpaceDim. The neighbor of an Empty Box is an Empty Box of the appropriate type.
NOTE: if type(dir) = CELL centered: lo <- lo*ratio and hi <-
(hi+1)*ratio - 1.
NOTE: if type(dir) = NODE centered: lo <- lo*ratio and hi <- hi*ratio.
NOTE: if type(dir) = CELL centered: lo <- lo*ratio and hi <-
(hi+1)*ratio - 1.
NOTE: if type(dir) = NODE centered: lo <- lo*ratio and hi <- hi*ratio.
NOTE: if type(dir) = CELL centered: lo <- lo*ratio and hi <-
(hi+1)*ratio - 1.
NOTE: if type(dir) = NODE centered: lo <- lo*ratio and hi <- hi*ratio.
NOTE: if type(dir) = CELL centered: lo <- lo*ratio and hi <-
(hi+1)*ratio - 1.
NOTE: if type(dir) = NODE centered: lo <- lo*ratio and hi <- hi*ratio.
NOTE: if type(dir) = CELL centered: lo <- lo/ratio and hi <-
hi/ratio.
NOTE: if type(dir) = NODE centered: lo <- lo/ratio and hi <-
hi/ratio + ((hi%ratio)==0 ? 0 : 1).
That is, refinement of coarsened Box must contain the original Box.
NOTE: if type(dir) = CELL centered: lo <- lo/ratio and hi <-
hi/ratio.
NOTE: if type(dir) = NODE centered: lo <- lo/ratio and hi <-
hi/ratio + ((hi%ratio)==0 ? 0 : 1).
That is, refinement of coarsened Box must contain the original Box.
NOTE: if type(dir) = CELL centered: lo <- lo/ratio and hi <-
hi/ratio.
NOTE: if type(dir) = NODE centered: lo <- lo/ratio and hi <-
hi/ratio + ((hi%ratio)==0 ? 0 : 1).
That is, refinement of coarsened Box must contain the original Box.
NOTE: if type(dir) = CELL centered: lo <- lo/ratio and hi <-
hi/ratio.
NOTE: if type(dir) = NODE centered: lo <- lo/ratio and hi <-
hi/ratio + ((hi%ratio)==0 ? 0 : 1).
That is, refinement of coarsened Box must contain the original Box.
This software is copyright (C) by the Lawrence Berkeley National Laboratory. Permission is granted to reproduce this software for non-commercial purposes provided that this notice is left intact.
It is acknowledged that the U.S. Government has rights to this software under Contract DE-AC03-765F00098 between the U.S. Department of Energy and the University of California.
This software is provided as a professional and academic contribution for joint exchange. Thus it is experimental, is provided ``as is'', with no warranties of any kind whatsoever, no support, no promise of updates, or printed documentation. By using this software, you acknowledge that the Lawrence Berkeley National Laboratory and Regents of the University of California shall have no liability with respect to the infringement of other copyrights by any part of this software.