class ProblemDomain

A class to facilitate interaction with physical boundary conditions

Inheritance:

ProblemDomain


public members:

Constructors
ProblemDomain ()
ProblemDomain(const Box& a_domBox)
ProblemDomain(const Box& a_domBox, const bool* a_isPeriodic)
ProblemDomain (const IntVect& small, const IntVect& big)
ProblemDomain (const IntVect& small, const IntVect& big, const bool* a_isPeriodic)
ProblemDomain (const IntVect& small, const int* vec_len)
ProblemDomain (const IntVect& small, const int* vec_len, const bool* a_isPeriodic)
ProblemDomain (const ProblemDomain & a_src)

Accessors
const Box& domainBox() const
bool isPeriodic(int a_dir) const
bool isPeriodic() const
ShiftIterator shiftIterator() const
bool isEmpty () const
bool contains (const IntVect& p) const
bool image (IntVect& p) const
bool contains (const Box& b) const
bool intersects (const Box& a_box) const
bool intersectsNotEmpty (const Box& a_box) const
bool intersects(const Box& box1, const Box& box2) const
friend void operator &=(Box& a_box, const ProblemDomain & a_probomain)
friend Box operator & (const Box& a_box, const ProblemDomain & a_probdomain)

Modification Functions
ProblemDomain & operator= (const ProblemDomain & b)
void setPeriodic(int a_dir, bool a_isPeriodic)
inline ProblemDomain & grow (int i)
friend inline ProblemDomain grow(const ProblemDomain & pd, int i)
inline ProblemDomain & grow(const IntVect& v)
friend inline ProblemDomain grow (const ProblemDomain & pd, const IntVect& v)
inline ProblemDomain & grow(int idir, int n_cell)
inline ProblemDomain & growLo(int idir, int n_cell=1)
inline ProblemDomain & growHi(int idir, int n_cell=1)
friend Box bdryLo (const ProblemDomain & a_pd, int a_dir, int a_len=1)
friend Box bdryHi (const ProblemDomain & a_pd, int a_dir, int a_len=1)
friend Box adjCellLo (const ProblemDomain & a_pd, int a_dir, int a_len=1)
friend Box adjCellHi (const ProblemDomain & a_pd, int a_dir, int a_len=1)

intersection functions
Box operator& (const Box& a_b) const

refinement
ProblemDomain & refine (int a_refinement_ratio)
friend ProblemDomain refine (const ProblemDomain & a_probdomain, int a_refinement_ratio)
ProblemDomain & refine (const IntVect& a_refinement_ratio)
friend ProblemDomain refine (const ProblemDomain & a_probdomain, const IntVect& a_refinement_ratio)

coarsening
ProblemDomain & coarsen (int a_refinement_ratio)
friend ProblemDomain coarsen (const ProblemDomain & a_probdomain, int a_refinement_ratio)
ProblemDomain & coarsen (const IntVect& refinement_ratio)
friend ProblemDomain coarsen (const ProblemDomain & a_probdomain, const IntVect& a_refinement_ratio)

I/O Functions
friend std::ostream& operator<< (std::ostream& os, const ProblemDomain & bx)
friend std::istream& operator>> (std::istream& is, ProblemDomain & bx)
void dumpOn (std::ostream& strm) const

Documentation

ProblemDomain is a class which facilitates the application of physical boundary conditions, both periodic and non-periodic. This class contains much of the functionality of the Box class, since logically the computational domain is generally a Box.

Intersection with a ProblemDomain object will result in only removing regions which are outside the physical domain in non-periodic directions. Regions outside the logical computational domain in periodic directions will be treated as ghost cells which can be filled with an exchange() function or through suitable interpolation from a coarser domain.

Since ProblemDomain will contain a Box, it is a dimension dependent class, so SpaceDim must be defined as either 1, 2, or 3 when compiling.

Note that this implementation of ProblemDomain is inherently cell-centered.

ProblemDomain ()
The default constructor. The constructed domain box is empty.

ProblemDomain (const Box& a_domBox)
Construct ProblemDomain with a_domBox as computational domain This constructor defaults to non-periodic domain

ProblemDomain (const Box& a_domBox, const bool* a_isPeriodic)
Construct ProblemDomain with a_domBox as computational domain. a_isPeriodic is a SpaceDim array of bools, true is the physical boundary condition is periodic in the coordinate direction

ProblemDomain (const IntVect& small, const IntVect& big)
Construct a ProblemDomain. It is an error if small is greater than big.

ProblemDomain (const IntVect& small, const IntVect& big, const bool* a_isPeriodic)
Construct a ProblemDomain. It is an error if small is greater than big. a_isPeriodic is a SpaceDim array of bools, true is the physical boundary condition is periodic in the coordinate direction

ProblemDomain (const IntVect& small, const int* vec_len)
Construct ProblemDomain with specified lengths. It is an error if the lengths are negative.

ProblemDomain (const IntVect& small, const int* vec_len, const bool* a_isPeriodic)
Construct ProblemDomain with specified lengths. It is an error if the lengths are negative. a_isPeriodic is a SpaceDim array of bools, true is the physical boundary condition is periodic in the coordinate direction

ProblemDomain (const ProblemDomain & a_src)
The copy constructor.

const Box& domainBox () const
Returns the logical computational domain

bool isPeriodic (int a_dir) const
returns true if BC is periodic in direction a_dir

bool isPeriodic () const
returns true is BC is periodic in _any_ direction

ShiftIterator shiftIterator () const
returns the shiftIterator for this ProblemDomain

bool isEmpty () const
Returns true if this ProblemDomain is empty or undefined.

bool contains (const IntVect& p) const
Returns true if argument is contained within this ProblemDomain. An empty ProblemDomain does not contain and is not contained by any ProblemDomain, including itself.

bool image (IntVect& p) const
Returns the periodic image of this IntVect inside of the ProblemDomain. Return true if the domain contains this IntVect, returning the image in 'p', otherwise returns false

bool contains (const Box& b) const
Returns true if argument is contained within this ProblemDomain. It is an error if the Box is not cell-centered. An empty ProblemDomain does not contain any Box.

bool intersects (const Box& a_box) const
Returns true if this ProblemDomain and the argument have non-null intersections. It is an error if a_box is not cell-centered. An empty ProblemDomain does not intersect any Box. This will do nothing in periodic directions (since a periodic domain is infinite in the periodic direction. If periodic in all dimensions, this will always return true.

bool intersectsNotEmpty (const Box& a_box) const
Returns true if this ProblemDomain and the argument have non-null intersections. It is an error if a_box is not cell-centered. This routine does not perform the check to see if *this or b are empty boxes. It is the callers responsibility to ensure that this never happens. If you are unsure, the use the .intersects(..) routine. In periodic directions, will always return true.

bool intersects (const Box& box1, const Box& box2) const
returns true if box1 and box2 and any of their periodic images intersect (useful for checking disjointness)

friend void operator &= (Box& a_box, const ProblemDomain & a_probomain)
modifies a_box to be the intersection of a_box and the problemDomain

friend Box operator & (const Box& a_box, const ProblemDomain & a_probdomain)
returns a box which is the interesection of a_box and the problemDomain

ProblemDomain & operator= (const ProblemDomain & b)
The assignment operator.

void setPeriodic (int a_dir, bool a_isPeriodic)
sets whether BC is periodic in direction a_dir (true == periodic)

inline ProblemDomain & grow (int i)
grows (or shrinks) the domain box by i in all directions

friend inline ProblemDomain grow (const ProblemDomain & pd, int i)
returns a ProblemDomain with a domainBox grown by the given amount

inline ProblemDomain & grow (const IntVect& v)
modifies this ProblemDomain by growing the domainBox in each direction by the specified amount

friend inline ProblemDomain grow (const ProblemDomain & pd, const IntVect& v)
Returns a ProblemDomain that is the argument ProblemDomain with a DomainBox grown by the given amount.

inline ProblemDomain & grow (int idir, int n_cell)
Modifies this ProblemDomain by growing it on the low and high end by n_cell cells in direction idir

inline ProblemDomain & growLo (int idir, int n_cell=1)
Modifies this ProblemDomain by growing it on the low end by n_cell cells in direction idir.

inline ProblemDomain & growHi (int idir, int n_cell=1)
Modifies this ProblemDomain by growing it on the high end by n_Cell cells in direction idir

friend Box bdryLo (const ProblemDomain & a_pd, int a_dir, int a_len=1)
Returns the edge-centered Box (in direction dir) defining the low side of the argument ProblemDomain. The output Box will have the given length in the given direction. Directions are zero-based. It is an error if not 0 <= dir < SpaceDim. The neighbor of an Empty ProblemDomain is an Empty Box of the appropriate type. If dir is a periodic direction, will return an empty box.

friend Box bdryHi (const ProblemDomain & a_pd, int a_dir, int a_len=1)
Returns the edge-centered Box (in direction dir) defining the high side of the argument ProblemDomain. The return Box will have the given length in the given direction. Directions are zero-based. It is an error if not 0 <= dir < SpaceDim. The neighbor of an Empty ProblemDomain is an Empty Box of the appropriate type. If dir is a periodic direction, will return an empty box.

friend Box adjCellLo (const ProblemDomain & a_pd, int a_dir, int a_len=1)
Returns the cell centered Box of the given length adjacent to the argument ProblemDomain on the low end along the given coordinate direction. The return Box is identical to the argument ProblemDomain in the other directions. The return ProblemDomain and the argument ProblemDomain have an empty intersection.

NOTE: len >= 1.

NOTE: Box retval = adjCellLo(b,dir,len) is equivalent to the following set of operations:

Box retval(b);

retval.convert(dir,ProblemDomain::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 ProblemDomain is an Empty Box of the appropriate type. If dir is a periodic direction, will return an empty Box as well.

friend Box adjCellHi (const ProblemDomain & a_pd, int a_dir, int a_len=1)
Returns the cell centered Box of the given length adjacent to the argument ProblemDomain on the high end along the given coordinate direction. The return Box is identical to the argument ProblemDomain in the other directions. The return Box and the argument ProblemDomain have an empty intersection.

NOTE: len >= 1.

NOTE: Box retval = adjCellHi(b,dir,len) is equivalent to the following set of operations:

Box retval(b);

retval.convert(dir,ProblemDomain::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 ProblemDomain is an Empty Box of the appropriate type. If dir is a periodic direction, will return an empty Box.

Box operator& (const Box& a_b) const
Returns the Box that is intersection of this ProblemDomain and the argument ProblemDomain. The Box MUST be cell-centered. The intersection of the Empty ProblemDomain and any Box is the Empty Box. This operator does nothing in periodic directions (since a periodic domain is an infinite domain).

ProblemDomain & refine (int a_refinement_ratio)
Modifies this ProblemDomain by refining it by given (positive) refinement ratio. The Empty ProblemDomain is not modified by this function.

friend ProblemDomain refine (const ProblemDomain & a_probdomain, int a_refinement_ratio)
Returns a ProblemDomain that is the argument ProblemDomain refined by given (positive) refinement ratio. The Empty ProblemDomain is not modified by this function.

ProblemDomain & refine (const IntVect& a_refinement_ratio)
Modifies this ProblemDomain by refining it by given (positive) refinement ratio. The Empty ProblemDomain is not modified by this function.

friend ProblemDomain refine (const ProblemDomain & a_probdomain, const IntVect& a_refinement_ratio)
Returns a ProblemDomain that is the argument ProblemDomain refined by given (positive) refinement ratio. The Empty ProblemDomain is not modified by this function.

ProblemDomain & coarsen (int a_refinement_ratio)
Modifies this ProblemDomain by coarsening it by given (positive) refinement ratio. The Empty ProblemDomain is not modified by this function.

friend ProblemDomain coarsen (const ProblemDomain & a_probdomain, int a_refinement_ratio)
Returns a ProblemDomain that is the argument ProblemDomain coarsened by given (positive) refinement ratio. The Empty ProblemDomain is not modified by this function.

ProblemDomain & coarsen (const IntVect& refinement_ratio)
Modifies this ProblemDomain by coarsening by given (positive) refinement ratio. The Empty ProblemDomain is not modified by this function.

friend ProblemDomain coarsen (const ProblemDomain & a_probdomain, const IntVect& a_refinement_ratio)
Returns a ProblemDomain that is the argument ProblemDomain coarsened by given (positive) refinement ratio. The Empty ProblemDomain is not modified by this function.

friend std::ostream& operator<< (std::ostream& os, const ProblemDomain & bx)
Write an ASCII representation to the ostream.

friend std::istream& operator>> (std::istream& is, ProblemDomain & bx)
Read from istream.

void dumpOn (std::ostream& strm) const
Gives more detail than printOn. Useful for exiting due to an error.


this class has no child classes.

alphabetic index hierarchy of classes


Chombo

Copyright Notice

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.