Proto  3.2
Public Member Functions | Protected Attributes | List of all members
Proto::ProblemDomain Class Reference

Represents a rectangular domain over which a problem can be defined, including periodic images. More...

#include <Proto_ProblemDomain.H>

Public Member Functions

 ProblemDomain ()
 
 ProblemDomain (const Box &a_box, const Array< bool, DIM > a_isPeriodic)
 Anisotropic Constructor. More...
 
 ProblemDomain (const Box &a_box, bool a_isPeriodic)
 Isotropic Constructor. More...
 
void define (const Box &a_box, const Array< bool, DIM > a_isPeriodic)
 Define. More...
 
Box operator & (Box a_box) const
 Box Intersection. More...
 
bool contains (const Point &a_pt) const
 Contains Point. More...
 
Point image (const Point &a_pt) const
 Periodic Image. More...
 
Box image (const Box &a_box) const
 Periodic Image. More...
 
bool coarsenable (Point a_boxSize) const
 Check If Coarsenable. More...
 
Point sizes () const
 Query Size. More...
 
bool operator== (const ProblemDomain &a_domain) const
 Equality. More...
 
bool operator!= (const ProblemDomain &a_domain) const
 Inequality. More...
 
Box box () const
 Get Box. More...
 
Array< bool, DIM > periodicity () const
 Get Periodicity. More...
 
bool isPeriodic (int a_dir) const
 Check Periodic Direction. More...
 
ProblemDomain coarsen (Point a_refRatio) const
 Coarsen (Anisotropic) More...
 
ProblemDomain coarsen (int a_refRatio) const
 Coarsen (Isotropic) More...
 
ProblemDomain refine (Point a_refRatio) const
 Refine (Anisotropic) More...
 
ProblemDomain refine (int a_refRatio) const
 Refine (Isotropic) More...
 

Protected Attributes

Box m_box
 
Array< bool, DIM > m_isPeriodic
 
bool m_isDefined
 

Detailed Description

Represents a rectangular domain over which a problem can be defined, including periodic images.

A ProblemDomain is specified by a Box defining the rectangular set of Points over which a problem may be defined, plus an Array<bool,DIM> specifying whether or not each of the coordinate directions is periodic. The Box is assumed to have the low corner to be all Zeros, and specifies the overall range of indices that contain all the boxes in a DisjointBoxLayout.

Constructor & Destructor Documentation

◆ ProblemDomain() [1/3]

Proto::ProblemDomain::ProblemDomain ( )
inline

◆ ProblemDomain() [2/3]

Proto::ProblemDomain::ProblemDomain ( const Box a_box,
const Array< bool, DIM >  a_isPeriodic 
)
inline

Anisotropic Constructor.

Constructs a ProblemDomain with Box a_bx, and periodic directions given by a_periodic.

Parameters
a_boxDomain Box
a_isPeriodicPeriodic flags

◆ ProblemDomain() [3/3]

Proto::ProblemDomain::ProblemDomain ( const Box a_box,
bool  a_isPeriodic 
)
inline

Isotropic Constructor.

Isotropic overload of the main constructor. Creates a ProblemDomain that is periodic or non-periodic in every direction

Parameters
a_boxDomain Box
a_isPeriodicPeriodic flag

Member Function Documentation

◆ define()

void Proto::ProblemDomain::define ( const Box a_box,
const Array< bool, DIM >  a_isPeriodic 
)
inline

Define.

Lazily constructs a ProblemDomain with Box a_bx, and periodic directions given by a_periodic.

Parameters
a_boxDomain Box
a_isPeriodicPeriodic flags

◆ operator &()

Box Proto::ProblemDomain::operator& ( Box  a_box) const
inline

Box Intersection.

Returns the Box that is the intersection of a_bx with this->box() and all of its periodic images. Points in a_box which have no periodic image in the ProblemDomain are truncated.

This function does no periodic shifting. See image for that functionality.

Parameters
a_boxA Box

◆ contains()

bool Proto::ProblemDomain::contains ( const Point a_pt) const
inline

Contains Point.

Checks if a_pt or any of it's periodic images are contained in this ProblemDomain.

Parameters
a_ptA Point

◆ image() [1/2]

Point Proto::ProblemDomain::image ( const Point a_pt) const
inline

Periodic Image.

Computes the periodic image of a Point. This function results in an error if the input does not have a periodic image, so one should call contains(Point) first.

Parameters
a_ptA Point with a valid periodic image

◆ image() [2/2]

Box Proto::ProblemDomain::image ( const Box a_box) const
inline

Periodic Image.

Computes the periodic image of a Box. Points with no periodic image are truncated. If a_box contains a periodic boundary in its interior, this function fails by assertion.

Parameters
a_ptA Point with a valid periodic image

◆ coarsenable()

bool Proto::ProblemDomain::coarsenable ( Point  a_boxSize) const
inline

Check If Coarsenable.

Returns true if *this can be tiled by boxes of size a_boxSize. This is a requirement for using *this to construct a DisjointBoxLayout with Boxes of this size.

Parameters
a_boxSizeA possibly anisotropic Box size

◆ sizes()

Point Proto::ProblemDomain::sizes ( ) const
inline

Query Size.

Size in number of points in each direction.

References m_box, and Proto::Box::sizes().

◆ operator==()

bool Proto::ProblemDomain::operator== ( const ProblemDomain a_domain) const
inline

Equality.

Two ProblemDomain objects are "==" if they have the same Box domain and periodicity.

Parameters
a_domainA ProblemDomain

◆ operator!=()

bool Proto::ProblemDomain::operator!= ( const ProblemDomain a_domain) const
inline

Inequality.

Two ProblemDomain objects are "==" if they have the same Box domain and periodicity.

Parameters
a_domainA ProblemDomain

◆ box()

Box Proto::ProblemDomain::box ( ) const
inline

Get Box.

References m_box.

Referenced by Proto::MBDisjointBoxLayout::blockDomainBox().

◆ periodicity()

Array<bool,DIM> Proto::ProblemDomain::periodicity ( ) const
inline

Get Periodicity.

References m_isPeriodic.

◆ isPeriodic()

bool Proto::ProblemDomain::isPeriodic ( int  a_dir) const
inline

Check Periodic Direction.

Check if this domain is periodic in direction a_dir.

Parameters
a_dirA coordinate direction in [0,DIM)

References coarsen(), m_isPeriodic, and refine().

◆ coarsen() [1/2]

ProblemDomain Proto::ProblemDomain::coarsen ( Point  a_refRatio) const
inline

Coarsen (Anisotropic)

Returns a ProblemDomain with a box given by this->box.coarsen(a_refRatio). Fails if this->coarsenable(a_refRatio) is false.

Parameters
a_refRatioA vector of refinement ratios

Referenced by isPeriodic(), and Proto::DisjointBoxLayout::patchDomain().

◆ coarsen() [2/2]

ProblemDomain Proto::ProblemDomain::coarsen ( int  a_refRatio) const
inline

Coarsen (Isotropic)

Returns a ProblemDomain with a box given by this->box.coarsen(a_refRatio). Fails if this->coarsenable(a_refRatio) is false

Parameters
a_refRatioAn isotropic refinement ratio

◆ refine() [1/2]

ProblemDomain Proto::ProblemDomain::refine ( Point  a_refRatio) const
inline

Refine (Anisotropic)

Returns a ProblemDomain with a box given by this->box.refine(a_refRatio).

Parameters
a_refRatioA vector of refinement ratios

Referenced by isPeriodic().

◆ refine() [2/2]

ProblemDomain Proto::ProblemDomain::refine ( int  a_refRatio) const
inline

Refine (Isotropic)

Returns a ProblemDomain with a box given by this->box.refine(a_refRatio).

Parameters
a_refRatioAn isotropic refinement ratio

Member Data Documentation

◆ m_box

Box Proto::ProblemDomain::m_box
protected

Referenced by box(), and sizes().

◆ m_isPeriodic

Array<bool,DIM> Proto::ProblemDomain::m_isPeriodic
protected

Referenced by isPeriodic(), and periodicity().

◆ m_isDefined

bool Proto::ProblemDomain::m_isDefined
protected

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