|
IBAMR
IBAMR version 0.19.
|
#include <BoxUtilities.h>
Static Public Member Functions | |
| static void | checkBoxConstraints (const Box< DIM > &box, const IntVector< DIM > &min_size, const IntVector< DIM > &cut_factor, const IntVector< DIM > &bad_interval, const BoxArray< DIM > &physical_boxes) |
| static void | chopBoxes (BoxList< DIM > &boxes, const IntVector< DIM > &max_size, const IntVector< DIM > &min_size, const IntVector< DIM > &cut_factor, const IntVector< DIM > &bad_interval, const BoxArray< DIM > &physical_boxes) |
| static void | chopBox (BoxList< DIM > &boxes, const Box< DIM > &box, const tbox::Array< tbox::List< int > > cut_points) |
| static bool | extendBoxToDomainBoundary (Box< DIM > &box, const BoxList< DIM > &domain, const IntVector< DIM > &ext_ghosts) |
| static bool | extendBoxesToDomainBoundary (BoxList< DIM > &boxes, const BoxList< DIM > &domain, const IntVector< DIM > &ext_ghosts) |
| static void | growBoxesWithinDomain (BoxList< DIM > &boxes, const BoxList< DIM > &domain, const IntVector< DIM > &min_size) |
| static bool | findBestCutPointsGivenMax (tbox::Array< tbox::List< int > > &cut_points, const Box< DIM > &box, const IntVector< DIM > &max_size, const IntVector< DIM > &min_size, const IntVector< DIM > &cut_factor) |
| static bool | findBestCutPointsForDirectionGivenMax (const int idir, tbox::List< int > &cut_points, const Box< DIM > &box, const int max_size, const int min_size, const int cut_factor) |
| static bool | findBestCutPointsGivenNumber (tbox::Array< tbox::List< int > > &cut_points, const Box< DIM > &box, const IntVector< DIM > &number_boxes, const IntVector< DIM > &min_size, const IntVector< DIM > &cut_factor) |
| static bool | findBestCutPointsForDirectionGivenNumber (const int idir, tbox::List< int > &cut_points, const Box< DIM > &box, const int num_boxes, const int min_size, const int cut_factor) |
| static bool | checkBoxForBadCutPoints (IntVector< DIM > &bad_cut_information, const Box< DIM > &box, const BoxArray< DIM > &physical_boxes, const IntVector< DIM > &bad_interval) |
| static bool | checkBoxForBadCutPointsInDirection (const int dir, const Box< DIM > &box, const BoxArray< DIM > &physical_boxes, const IntVector< DIM > &bad_interval) |
| static void | findBadCutPoints (tbox::Array< tbox::Array< bool > > &bad_cuts, const Box< DIM > &box, const BoxArray< DIM > &physical_boxes, const IntVector< DIM > &bad_interval) |
| static void | findBadCutPointsForDirection (const int dir, tbox::Array< bool > &bad_cuts, const Box< DIM > &box, const BoxArray< DIM > &physical_boxes, const IntVector< DIM > &bad_interval) |
| static void | fixBadCutPoints (tbox::Array< tbox::List< int > > &cuts, const tbox::Array< tbox::Array< bool > > &bad_cuts, const Box< DIM > &box, const IntVector< DIM > &min_size, const IntVector< DIM > &cut_factor) |
| static void | fixBadCutPointsForDirection (const int dir, tbox::List< int > &cuts, const tbox::Array< bool > &bad_cuts, const Box< DIM > &box, const int min_size, const int cut_factor) |
| static void | findBadCutPointsForBorderAndDirection (const int id, tbox::Array< bool > &bad_cuts, const Box< DIM > &box, const Box< DIM > &border, const int bad_interval) |
| static void | makeNonOverlappingBoxLists (tbox::Array< BoxList< DIM > > &box_list_array, const BoxArray< DIM > &boxes) |
Class BoxUtilities<DIM> provides several utility routines for processing boxes or collections of boxes. Many of these operations require information about the location of the input boxes within some region of index space (domain) or are used to compute this sort of information. Often these routines are used in load balancing and communication routines to determine the relationship of a box or set of boxes to some domain boundary, where the domain is specified by a list of box regions.
The following provides an explanation some of the concepts common to many of the functions in this class.
- \b cut point A cut point for a coordinate direction is an integer that specifies the index value of the cell immediately to the right of the boundary along which a box will be cut. For instance, if we have a cut point value of 12 in the y-coordinate direction for box [(0,0,0), (5,15,10)], then the box will be cut into [(0,0,0),(5,11,10)] and [(0,12,0),(5,15,10)]. That is, the box has been cut along the boundary between the y = 11 and y = 12 cells. - \b bad cut point If a box is cut at a "bad cut point", the resulting boxes will violate some of the box constraints. For example, a cut point that does not satify the cut factor restriction or violates the bad_interval constraint (see below) is a bad cut point. - \b irregular boundary An irregular boundary results when the domain cannot be described by a single box and the domain is non-convex.
The following provides an explanation some of the arguments common to many of the functions in this class.
max_size max_size is a IntVector that specifies the maximum allowable box length in each dimension. For example, if max_size = (10,40,50), then the maximum box length in the x, y, and z dimensions are 10, 40, and 50 respectively.
It should be noted that the max_size constraint has lower priority than the other constraints. In instances where all constraints cannot be simultaneously satisfied, the max_size constraint is sacrificed.
cut_factor cut_factor is a IntVector that constrains the dimensions of a box to be multiples of the components of the cut_factor. For instance, if cut_factor = (2,4,5), then the x, y, and z dimensions of a 8 box that satisfies the cut_factor constraint would be multiples of 2, 4, and 5 respectively.
This constraint is usually enforced with the cut_factor equal to a multiple of the refinement ratio between levels to ensure that if the box is coarsened, the resulting box is aligned with the coarse grid (it is assumed that the boundary of the fine box is aligned with a coarse cell boundary).
bad_interval bad_interval is a IntVector that limits the distance a box can be from the boundary of the box list domain so that the outer boundaries of the box and the box list domain which are perpendicular to the i-th direction are no closer than the i-th component of bad_interval. Another way to think of this is that the boundary of the box list domain in the i-th direction is not allowed to lie strictly within the interior of the box after it has been grown in the i-th direction by the i-th component of bad_interval. For example, if bad_interval = (2,3,4), then the x, y, and z boundaries of the box must be at least 2, 3, and 4 cells away from the x, y, and z boundaries of the box list domain.
The bad_interval constraint is enforced to avoid the situation where the ghost region for a box resides partially inside and partially outside the box list domain which complicates ghost cell filling. In addition, this constraint avoids complicated issues with respect to the numerical accuracy of the solution.
Typically, bad_interval is based on the maximum ghost cell width over all patch data objects and some coarsen ratio.
Note that all member functions of this class are static. The main intent of the class is to group the functions into one name space. Thus, you should never attempt to instantiate a class of type BoxUtilities<DIM>; simply call the functions as static functions; e.g., BoxUtilities<DIM>::function(...). These routines are placed here rather than in the box, box list, box array classes to avoid circular dependencies among these classes.
|
static |
Check the given box for violation of minimum size, cut factor, and box list domain constraints. If a patch is generated from a box that violates any of these constraints, then some other routine (e.g., ghost cell filling, or inter-patch communication) may fail.
Thus, this routine prints an error message describing the violation and executes a program abort.
Arguments:
bad_interval (input) See class header for description.
If there is no constraint on the box location within the box list domain, pass in an empty box array for the physical_boxes argument.
Assertion checks:
|
static |
Replace each box in the list that is too large with a list of non- overlapping smaller boxes whose union covers the same region of index space as the original box.
Arguments:
Notes:
|
static |
Chop the box into a collection of boxes according to the collection of cut points specified along each coordinate direction. Cut points that do not reside within the range of box indices are ignored.
Arguments:
Assertion checks:
Notes:
|
static |
Extend the box in the list to domain boundary as needed so that the domain boundary does not intersect the ghost cell region around the box in an inappropriate manner. Intersections that are disallowed are those in which a portion of the domain boundary is parallel to a box face and lies strictly in the interior of the ghost cell layer adjacent to that face. In other words, we eliminate ghost cell regions residing outside of a given domain and which are narrower than the specified ghost width. The boolean return value is true if the input box was extended to the boundary and thus is changed by the routine. Otherwise, the return value is false.
See description of bad_interval in the class header comments for more details.
Arguments:
Assertion checks:
Notes:
|
static |
Same function as extendBoxToDomainBoundary() above except that it extends each box in a list of boxes to the domain boundary specified by the box list argument as needed. The boolean return value is true if any box in the input box list was extended to the boundary and thus is changed by the routine. Otherwise, the return value is false.
|
static |
Grow each box in the list that is smaller than the specified minimum size.
Arguments:
Assertion checks:
Notes:
There exist some bizarre domain configurations for which it is impossible to grow a box sufficiently within the domain.
For instance if the domain is given by [(0,0),(2,10)], [(0,3),(1,4)], [(0,5),(10,10)] and the box is given by [(4,1),(6,2)] with a minimum size of (4,4), there is no way the box can be grown to the minimum size without have to "cross" the gap in the box list domain.
This routine will grow each box as far as it can, but will not remedy these situations, generally.
|
static |
Determine whether the box may be chopped according to specified min_size, max_size and cut_factor constraints. For those directions along which the box may be chopped, the cut points are computed. The cut points for the j-th coordinate direction are placed into a list of integers corresponding to the j-th component of the cut_point array.
Return value:
Arguments:
Assertion checks:
|
static |
Determine whether the box may be chopped according to specified min_size, max_size and cut_factor constraints along given coordinate direction. If the box may be chopped, the cut points are computed and placed into a list of integers.
Return value:
Arguments:
Assertion checks:
|
static |
Determine whether the box may be chopped into the specified number of boxes along each coordinate direction. For those directions along which the box may be chopped, the cut points are computed. The cut points for the j-th coordinate direction are placed into a list of integers corresponding to the j-th component of the cut_point array.
Return value:
Arguments:
Important note: By convention, each integer cut point that is computed corresponds to the cell index to the right of cut point.
Assertion checks:
|
static |
Determine whether the box may be chopped into the specified number of boxes along along given coordinate direction. If the box may be chopped, the cut points are computed and placed into a list of integers.
Return value:
Arguments:
Assertion checks:
|
static |
Determine whether box has any bad cut points based on its position within the box list domain. Information about the potentially bad directions is returned in the IntVector bad_cut_information. An entry of zero indicates that there are no bad cut points for the box along that coordinate direction. An entry of one indicates that there may be a bad cut point along that direction.
Return value:
Arguments:
Assertion checks:
|
static |
Determine whether box may have any bad cut points along the specified coordinate direction based on its position within the box array domain.
Return value:
Arguments:
Assertion checks:
|
static |
Determine bad cut points for box based on the specified box array domain and bad interval.
The cut information is returned as an array (size = DIM) of arrays (size = number of cells along edge of box) of boolean values. A false value indicates a good cut point, a true value indicates that the box should not be cut at that point.
Arguments:
Assertion checks:
|
static |
Find bad cut points for a box given a single coordinate direction. The cut information is returned as an array of boolean values (size = number of cells along specified edge of box). A false value indicates a good cut point, a true value indicates that the box should not be cut at that point.
Arguments:
Assertion checks:
|
static |
Given a set of potential cut points and a set of bad cut points for a box, adjust the cut points so that they do not coincide with bad cut points. Typically, the cuts are generated using either of the findBestCutPoints...() functions, and the bad cut points are generated using the findBadCutPoints() function.
Arguments:
Assertion checks:
|
static |
Given a set of potential cut points and a set of bad cut points for a box, adjust the cut points in the specified coordinate direction so that they do not coincide with bad cut points. Typically, the cuts are generated using either of the findBestCutPoints...() functions, and the bad cut points are generated using the findBadCutPoints() function.
Arguments:
Assertion checks:
|
static |
This static private member function is called by findBadCutPoints(),
and the findBadCutPointsForDirection() member functions. It sets bad cut points near the lower and upper ends of the border box in the
given coordinate direction.
|
static |
Construct an array of box lists so that each list contains a non-overlapping set of boxes covering some portion of the box at the same array location in the box array. The regions of index space formed by composing the union of boxes on each box list are mutually disjoint and the union of all boxes in the box lists exactly covers the union of boxes in the original box array. In other words, this routine partitions the boxes in the "boxes" argument into a set of non-overlapping box collections.
If none of the boxes in this box array overlap then each box list in the resulting array has a single box equal to the corresponding box in the box array. This routine is especially useful for determining a unique set of index points given an array of boxes in some index space.
Arguments:
1.8.17