SAMRAI::hier::BoxGraphUtilities< DIM > Struct Template Reference

#include <source/hierarchy/boxes/BoxGraphUtilities.h>

List of all members.

Static Public Member Functions

static void makeBoxesPlusPeriodicBoxes (BoxArray< DIM > &out_boxes, const BoxArray< DIM > &in_boxes, const tbox::Array< tbox::List< IntVector< DIM > > > &shifts)
 Returns an array of boxes that includes entries for each box that touches a periodic boundary.
static void makeBoxesPlusPeriodicBoxes (BoxArray< DIM > &out_boxes, tbox::Array< int > &out_indices, const BoxArray< DIM > &in_boxes, const tbox::Array< tbox::List< IntVector< DIM > > > &shifts)
 Returns an array of boxes that includes entries for each box that touches a periodic boundary.
static int countPeriodicBoxes (const tbox::Array< tbox::List< IntVector< DIM > > > &shifts)
 Returns the sum of shifts[j].getNumberOfItems().
static int qsortIntCompare (const void *v, const void *w)
 Compare function for use with qsort when sorting integers in ascending order.


Detailed Description

template<int DIM>
struct SAMRAI::hier::BoxGraphUtilities< DIM >

Class BoxGraphUtilities is a utility class that provides methods for "expanding" an array of boxes when some of the boxes touch periodic boundaries. If a box touches a periodic boundary, then there are one or more "virtual" boxes that "wrap around" to the opposite side(s) of the domain:

 * 
 *         ---------------------------
 *         |                         |
 *         |                         |
 *         |                         |
 *         |-------------            |-------------
 *         | this       |            | the virtual|
 *         | box touches|            | wrap around|
 *         | a periodic |            | box        |
 *         | boundary   |            |            |
 *         |-------------            |-------------
 *         |                         |
 *         |       domain            |
 *         |        box              |
 *         ---------------------------
 * 
 * 

The BoxTop, BoxGraph, and possibly other classes require as input arrays of boxes in which the "virtual" boxes are explicitly represented.


Member Function Documentation

template<int DIM>
void SAMRAI::hier::BoxGraphUtilities< DIM >::makeBoxesPlusPeriodicBoxes ( BoxArray< DIM > &  out_boxes,
const BoxArray< DIM > &  in_boxes,
const tbox::Array< tbox::List< IntVector< DIM > > > &  shifts 
) [static]

Returns an array of boxes that includes entries for each box that touches a periodic boundary.

The shift array must either have zero length, or have the same length as in_boxes, otherwise an unrecoverable error will be thrown.

Parameters:
out_boxes contains all items in the in_boxes array, and contains one or more additional items for any box that touches a periodic boundary.
in_boxes array of input boxes.
shifts shift information for each of the input boxes.

template<int DIM>
void SAMRAI::hier::BoxGraphUtilities< DIM >::makeBoxesPlusPeriodicBoxes ( BoxArray< DIM > &  out_boxes,
tbox::Array< int > &  out_indices,
const BoxArray< DIM > &  in_boxes,
const tbox::Array< tbox::List< IntVector< DIM > > > &  shifts 
) [static]

Returns an array of boxes that includes entries for each box that touches a periodic boundary.

The shift array must either have zero length, or have the same length as in_boxes, otherwise an unrecoverable error will be thrown.

Parameters:
out_boxes contains all items in the in_boxes array, and contains one or more additional items for any box that touches a periodic boundary.
out_indices contains an entry for each box in out_boxes; the entry indicates the box, w.r.t in_boxes, from which the box was derived.
in_boxes array of input boxes.
shifts shift information for each of the input boxes.

template<int DIM>
int SAMRAI::hier::BoxGraphUtilities< DIM >::countPeriodicBoxes ( const tbox::Array< tbox::List< IntVector< DIM > > > &  shifts  )  [static]

Returns the sum of shifts[j].getNumberOfItems().

This function is called by makeBoxesPlusPeriodicBoxes().

Parameters:
shifts periodic shift information for each box.

template<int DIM>
int SAMRAI::hier::BoxGraphUtilities< DIM >::qsortIntCompare ( const void *  v,
const void *  w 
) [static]

Compare function for use with qsort when sorting integers in ascending order.

Sample usage:

    *   intarray[len];
    *   ...
    *   qsort(array, len, sizeof(int), qsortIntCompare);
    * 


The documentation for this struct was generated from the following files:
Generated on Thu Jun 18 11:28:27 2009 for SAMRAI by  doxygen 1.5.1