DisjointBoxLayout Class Reference

#include <DisjointBoxLayout.H>

Inheritance diagram for DisjointBoxLayout:

Inheritance graph
[legend]

List of all members.


Detailed Description

A BoxLayout that has a concept of disjointedness.

DisjointBoxLayout is-a BoxLayout that has a concept of disjointedness of the boxes. DisjointBoxLayout is only different from BoxLayout in that it has a method isDisjoint(). DisjointBoxLayouts also have a ProblemDomain member to ensure disjointness in the case of periodic boundary conditions, among other things.

Modification functions

void coarsen (DisjointBoxLayout &output, const DisjointBoxLayout &input, int refinement)
void refine (DisjointBoxLayout &output, const DisjointBoxLayout &input, int refinement)
virtual void close ()
void setDomain (const ProblemDomain &a_domain)
virtual void deepCopy (const DisjointBoxLayout &a_source)
virtual void deepCopy (const BoxLayout &a_source)
virtual void deepCopy (const BoxLayout &a_source, const ProblemDomain &a_physDomain)
void degenerate (DisjointBoxLayout &a_to, const SliceSpec &a_ss, bool a_maintainProcAssign=false) const

Public Member Functions

const ProblemDomainphysDomain () const
virtual void closeNoSort ()
Constructors, destructors, defines
 DisjointBoxLayout ()
 DisjointBoxLayout (const Vector< Box > &a_boxes, const Vector< int > &a_procIDs)
 DisjointBoxLayout (const Vector< Box > &a_boxes, const Vector< int > &a_procIDs, const ProblemDomain &a_physDomain)
 DisjointBoxLayout (const LayoutData< Box > &a_newLayout)
virtual ~DisjointBoxLayout ()
unsigned long long int numPointsThisProc () const
virtual void define (const Vector< Box > &a_boxes, const Vector< int > &a_procIDs)
void defineAndLoadBalance (const Vector< Box > &a_boxes, Vector< int > *a_procIDs)
void defineAndLoadBalance (const Vector< Box > &a_boxes, Vector< int > *a_procIDs, const ProblemDomain &a_physDomain)
virtual void define (const BoxLayout &a_layout)
virtual void define (const BoxLayout &a_layout, const ProblemDomain &a_physDomain)
virtual void define (const Vector< Box > &a_boxes, const Vector< int > &a_procIDs, const ProblemDomain &a_physDomain)
virtual void define_pd (const Vector< Box > &a_boxes, const Vector< int > &a_procIDs, const ProblemDomain &a_physDomain)
Checks
bool isDisjoint () const
bool checkPeriodic (const ProblemDomain &a_domain) const
bool checkDomains (const DisjointBoxLayout &a_dbl) const

Protected Member Functions

void computeNeighbors ()
virtual void closeN (RefCountedPtr< Vector< Vector< std::pair< int, LayoutIndex > > > > neighbors)
virtual void closeNO ()

Protected Attributes

ProblemDomain m_physDomain
RefCountedPtr< Vector< Vector
< std::pair< int, LayoutIndex > > > > 
m_neighbors

Friends

class Copier
class NeighborIterator
Neighbor functions
void adjCellLo (DisjointBoxLayout &a_output, const DisjointBoxLayout &a_input, int a_dir, int a_len)
void adjCellHi (DisjointBoxLayout &a_output, const DisjointBoxLayout &a_input, int a_dir, int a_len)


Constructor & Destructor Documentation

DisjointBoxLayout::DisjointBoxLayout (  ) 

Construct BoxLayout with no boxes.

DisjointBoxLayout::DisjointBoxLayout ( const Vector< Box > &  a_boxes,
const Vector< int > &  a_procIDs 
)

Construct from a Vector of Boxes and optionally a Vector of processor assignments. If the processor assignment Vector is present, it must be either zero-length or the same length as the Box Vector. On exit, the DisjointBoxLayout will be closed.

DisjointBoxLayout::DisjointBoxLayout ( const Vector< Box > &  a_boxes,
const Vector< int > &  a_procIDs,
const ProblemDomain a_physDomain 
)

Construct from a Vector of Boxes and optionally a Vector of processor assignments. If the processor assignment Vector is present, it must be either zero-length or the same length as the Box Vector. On exit, the DisjointBoxLayout will be closed.

DisjointBoxLayout::DisjointBoxLayout ( const LayoutData< Box > &  a_newLayout  ) 

Construct from a LayoutData<Box>. On exit, the BoxLayout will be closed.

virtual DisjointBoxLayout::~DisjointBoxLayout (  )  [inline, virtual]

Ref-counted destruction. Once the last reference to the implementation of this class is destroyed, the data members are cleaned up.


Member Function Documentation

unsigned long long int DisjointBoxLayout::numPointsThisProc (  )  const

virtual void DisjointBoxLayout::define ( const Vector< Box > &  a_boxes,
const Vector< int > &  a_procIDs 
) [virtual]

Define this DisjointBoxLayout from a Vector of Boxes. This is a wrapper for a call to BoxLayout::define, required because DisjointBoxLayout::define is overloaded and the compiler will not look into the base class for name resolution.

Reimplemented from BoxLayout.

Referenced by define_pd().

void DisjointBoxLayout::defineAndLoadBalance ( const Vector< Box > &  a_boxes,
Vector< int > *  a_procIDs 
)

Like the define() that takes the same two arguments, except this one also initializes a_procIDs if it's not NULL. In that case, the passed-in a_procIDs should point to a Vector of size 0.

void DisjointBoxLayout::defineAndLoadBalance ( const Vector< Box > &  a_boxes,
Vector< int > *  a_procIDs,
const ProblemDomain a_physDomain 
)

Like the define() that takes the same two arguments, except this one also initializes a_procIDs if it's not NULL. In that case, the passed-in a_procIDs should point to a Vector of size 0.

virtual void DisjointBoxLayout::define ( const BoxLayout a_layout  )  [virtual]

Shallow define. Only way to promote a BoxLayout. If BoxLayout has been closed, then this method checks isDisjoint and throws an error if not disjoint. If a_layout is disjoint, then this object becomes a closed DisjointBoxLayout object.

virtual void DisjointBoxLayout::define ( const BoxLayout a_layout,
const ProblemDomain a_physDomain 
) [virtual]

Shallow define. Only way to promote a BoxLayout. If BoxLayout has been closed, then this method checks isDisjoint and throws an error if not disjoint. If a_layout is disjoint, then this object becomes a closed DisjointBoxLayout object. If BoxLayout has been closed, and is sorted, the neighbour iterator is rebuilt (now with knowledge of the problem domain).

virtual void DisjointBoxLayout::define ( const Vector< Box > &  a_boxes,
const Vector< int > &  a_procIDs,
const ProblemDomain a_physDomain 
) [virtual]

Define this DisjointBoxLayout from a Vector of Boxes. This is a wrapper for a call to BoxLayout::define, required because DisjointBoxLayout::define is overloaded and the compiler will not look into the base class for name resolution.

virtual void DisjointBoxLayout::define_pd ( const Vector< Box > &  a_boxes,
const Vector< int > &  a_procIDs,
const ProblemDomain a_physDomain 
) [inline, virtual]

Define this DisjointBoxLayout from a Vector of Boxes. Same as define.

References define().

bool DisjointBoxLayout::isDisjoint (  )  const

Returns true if this object contains a disjoint union of Boxes.

The Disjoint testing algorithm assumes that the boxes are CELL-Centered boxes. We can expand the algorithm when someone needs it. bvs

bool DisjointBoxLayout::checkPeriodic ( const ProblemDomain a_domain  )  const

Checks to see that problem domains are compatible. To be compatible:

  • a_domain and the ProblemDomain in this DisjointBoxLayout must have the same periodicity.
  • The ProblemDomains must be periodic in the same dimensions.
  • In all periodic directions, the period must be the same.

There are no checks in non-periodic directions, since DisjointBoxLayouts don't care about physical domains except in the periodic case.

bool DisjointBoxLayout::checkDomains ( const DisjointBoxLayout a_dbl  )  const

Performs problem domain check when we don't have direct access to a problemDomain.

Returns true if this and a_dbl have compatible ProblemDomains.

virtual void DisjointBoxLayout::close (  )  [virtual]

Mark this DisjointBoxLayout as complete and unchangeable.

Reimplemented from BoxLayout.

Referenced by blockReadLevel(), and readLevel().

void DisjointBoxLayout::setDomain ( const ProblemDomain a_domain  )  [inline]

Set ProblemDomain. Useful when using addBox() and trying to use closeNoSort()

References m_physDomain.

virtual void DisjointBoxLayout::deepCopy ( const DisjointBoxLayout a_source  )  [virtual]

Create new open DisjointBoxLayout with copied data.

Doesn't check for disjointness, since a_source is already guaranteed to be disjoint. Also copies problem domain info.

virtual void DisjointBoxLayout::deepCopy ( const BoxLayout a_source  )  [virtual]

Create new open DisjointBoxLayout with copied data.

Checks that the source BoxLayout isDisjoint, throws an error if it is not. Otherwise, same as BoxLayout::deepCopy.

Reimplemented from BoxLayout.

virtual void DisjointBoxLayout::deepCopy ( const BoxLayout a_source,
const ProblemDomain a_physDomain 
) [virtual]

Create new open DisjointBoxLayout with copied data.

Checks that the source BoxLayout isDisjoint, throws an error if it is not. Otherwise, same as BoxLayout::deepCopy.

void DisjointBoxLayout::degenerate ( DisjointBoxLayout a_to,
const SliceSpec a_ss,
bool  a_maintainProcAssign = false 
) const

Makes a_to a one-cell-thick version of *this -- sliced at a_ss.position along the a_ss.direction'th axis. If a_ss.position is outside the range of *this, that's a fatal error. If a_maintainProcAssign = true, maintain processor assignments in the process (even if it breaks load balancing)

Referenced by LevelData< T >::degenerate(), and LevelData< T >::degenerateLocalOnly().

const ProblemDomain& DisjointBoxLayout::physDomain (  )  const

virtual void DisjointBoxLayout::closeNoSort (  )  [virtual]

Reimplemented from BoxLayout.

void DisjointBoxLayout::computeNeighbors (  )  [protected]

virtual void DisjointBoxLayout::closeN ( RefCountedPtr< Vector< Vector< std::pair< int, LayoutIndex > > > >  neighbors  )  [protected, virtual]

virtual void DisjointBoxLayout::closeNO (  )  [protected, virtual]


Friends And Related Function Documentation

friend class Copier [friend]

friend class NeighborIterator [friend]

void coarsen ( DisjointBoxLayout output,
const DisjointBoxLayout input,
int  refinement 
) [friend]

Coarsen a DisjointBoxLayout:

  • output must be open
  • input must be closed
  • refinement must be a positive non-zero integer
  • output and input do not share an implementation.

output is first deepCopy'ed from input, then coarsen(refinement) is called on each box of output.

output returns from this function closed.

LayoutIterators and DataIterators from input and output can be used interchangeably.

void refine ( DisjointBoxLayout output,
const DisjointBoxLayout input,
int  refinement 
) [friend]

Refine a DisjointBoxLayout:

  • output must be open
  • input must be closed
  • refinement must be a positive non-zero integer
  • output and input do not share an implementation.

output is first deepCopy'ed from input, then refine(refinement) is called on each box of output.

output returns from this function closed.

LayoutIterators and DataIterators from input and output can be used interchangeably.

void adjCellLo ( DisjointBoxLayout a_output,
const DisjointBoxLayout a_input,
int  a_dir,
int  a_len 
) [friend]

Returns the set of boxes which you get from calling Box::adjCellLo on each box in input. Output must be open, is closed upon exit from this function. A negative length results in the set of boxes of width a_len on the low side of, but _inside_ the original boxes.

Returns the set of boxes which you get from calling Box::adjCellLo on each box in input. Output must be open, is closed upon exit from this function. A negative length results in the set of boxes of width a_len on the low side of, but _inside_ the original boxes.

void adjCellHi ( DisjointBoxLayout a_output,
const DisjointBoxLayout a_input,
int  a_dir,
int  a_len 
) [friend]

Returns the set of boxes which result from calling Box::adjCellHi on each box in input. Output must be open, will be closed upon exiting this function. A negative length results in the set of boxes of width a_len on the low side of, but _inside_ the original boxes.

Returns the set of boxes which result from calling Box::adjCellHi on each box in input. Output must be open, will be closed upon exiting this function. A negative length results in the set of boxes of width a_len on the low side of, but _inside_ the original boxes.


Member Data Documentation

Referenced by setDomain().


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

Generated on Fri Apr 5 04:25:00 2019 for Chombo + EB by  doxygen 1.5.5