IBAMR  IBAMR version 0.19.
Static Public Member Functions | List of all members
SAMRAI::hier::BoxGraphUtilities< DIM > Struct Template Reference

#include <BoxGraphUtilities.h>

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. More...
 
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. More...
 
static int countPeriodicBoxes (const tbox::Array< tbox::List< IntVector< DIM > > > &shifts)
 Returns the sum of shifts[j].getNumberOfItems(). More...
 
static int qsortIntCompare (const void *v, const void *w)
 Compare function for use with qsort when sorting integers in ascending order. More...
 

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

◆ makeBoxesPlusPeriodicBoxes() [1/2]

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

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_boxescontains all items in the in_boxes array, and contains one or more additional items for any box that touches a periodic boundary.
in_boxesarray of input boxes.
shiftsshift information for each of the input boxes.

◆ makeBoxesPlusPeriodicBoxes() [2/2]

template<int DIM>
static 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

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_boxescontains all items in the in_boxes array, and contains one or more additional items for any box that touches a periodic boundary.
out_indicescontains 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_boxesarray of input boxes.
shiftsshift information for each of the input boxes.

◆ countPeriodicBoxes()

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

This function is called by makeBoxesPlusPeriodicBoxes().

Parameters
shiftsperiodic shift information for each box.

◆ qsortIntCompare()

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

Sample usage:

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

The documentation for this struct was generated from the following file: