2 #ifndef _PROTO_DISJOINT_BOX_LAYOUT_ 3 #define _PROTO_DISJOINT_BOX_LAYOUT_ 18 #include <unordered_map> 54 const Point & a_boxSize);
71 const vector<Point> & a_coarsenedPatches,
72 const Point & a_boxSize);
89 const Point& a_boxSize);
92 std::shared_ptr<BoxPartition> a_partition,
93 const Point& a_boxSize);
101 std::shared_ptr<BoxPartition> a_partition,
102 const Point& a_boxSize);
118 const Point & a_boxSize);
126 const vector<PatchID> & a_patchIDs,
127 const Point & a_boxSize);
135 const Box & a_region,
136 const Point & a_boxSize);
148 inline void loadBalance(
unsigned int a_startProc,
unsigned int a_endProc);
157 template<
typename... Args>
166 inline void loadAssign(std::vector<std::pair<int, unsigned int>>& a_assignment);
191 inline const std::vector<pair<Point, unsigned int>>
boxes()
const;
209 inline Box box(
const LevelIndex& a_index)
const;
218 inline Point point(
const LevelIndex& a_index)
const;
227 inline int procID(
const LevelIndex& a_index)
const;
237 inline unsigned int offset(
int a_proc)
const;
256 inline LevelIndex
index(
Point& a_patchPoint)
const;
263 inline unsigned int size()
const;
269 inline unsigned int numBoxes()
const;
284 inline LevelIndex
index(
unsigned int a_intIndex)
const;
293 inline LevelIndex
localIndex(
unsigned int a_myIndexInt)
const;
319 inline LevelIndex
find(
const Point& a_pt)
const;
353 inline LevelIterator
end()
const;
356 inline LevelIterator
begin()
const;
386 inline bool compatible(
const LevelIterator& a_iter)
const;
394 inline bool compatible(
const LevelIndex& a_iter)
const;
463 inline void print(std::string a_name =
"")
const;
470 static bool init=
false;
473 protoStreamCreate(&currStream);
487 inline std::ostream&
operator<< (std::ostream& os,
const LevelIndex& a_dbl);
488 #include "implem/Proto_DisjointBoxLayoutImplem.H" bool contains(const Point &a_pt) const
Find Tile Point.
Definition: Proto_DisjointBoxLayout.H:279
friend std::ostream & operator<<(std::ostream &os, const DisjointBoxLayout &a_dbl)
Definition: Proto_DisjointBoxLayout.H:503
Definition: Proto_NeighborIterator.H:8
unsigned int size() const
Size.
Definition: Proto_DisjointBoxLayout.H:185
unsigned int offset() const
This Patch Offset.
Definition: Proto_DisjointBoxLayout.H:244
bool isDomainBoundary(const LevelIndex &a_patch, const Point &a_dir) const
Definition: Proto_DisjointBoxLayout.H:303
ProblemDomain patchDomain() const
Get Problem Domain in Patch Space.
Definition: Proto_DisjointBoxLayout.H:308
std::shared_ptr< BoxPartition > m_partition
Definition: Proto_DisjointBoxLayout.H:484
Distributed Data Iterator.
Definition: Proto_DataIndex.H:10
Box box(const LevelIndex &a_index) const
Box Indexing.
Definition: Proto_DisjointBoxLayout.H:220
Disjoint Box Layout.
Definition: Proto_DisjointBoxLayout.H:30
DisjointBoxLayout sorted() const
Get Sorted Version of This.
Definition: Proto_DisjointBoxLayout.H:108
bool onDomainBoundary(const Point &a_pt) const
On Domain Boundary.
Definition: Proto_DisjointBoxLayout.H:287
DataIterator< BoxPartition > LevelIterator
Definition: Proto_DisjointBoxLayout.H:23
void loadBalance(unsigned int a_startProc, unsigned int a_endProc)
Load Balance.
Definition: Proto_DisjointBoxLayout.H:116
bool operator==(const DisjointBoxLayout &a_input) const
Equality Operator.
Definition: Proto_DisjointBoxLayout.H:163
bool radialSymmetry(Point a_origin) const
Check Radial Symmetry.
Definition: Proto_DisjointBoxLayout.H:431
LevelIndex index(Point &a_patchPoint) const
Get Index From Point.
Definition: Proto_DisjointBoxLayout.H:238
void print(std::string a_name="") const
Print.
Definition: Proto_DisjointBoxLayout.H:470
unsigned int localSize() const
Local Size.
Definition: Proto_DisjointBoxLayout.H:197
An interval in DIM dimensional space.
Definition: Proto_Box.H:29
Box boundingBox() const
Get Bounding Box.
Definition: Proto_DisjointBoxLayout.H:413
int procID()
Get Local Process ID.
Definition: Proto_SPMD.H:39
Box operator[](const LevelIndex &a_index) const
Index Access.
Definition: Proto_DisjointBoxLayout.H:203
ProblemDomain domain() const
Get Problem Domain.
Definition: Proto_DisjointBoxLayout.H:302
int procID(const LevelIndex &a_index) const
Get Process ID.
Definition: Proto_DisjointBoxLayout.H:230
bool isSorted() const
Definition: Proto_DisjointBoxLayout.H:141
bool mirrorSymmetry(Point a_origin, int a_coord) const
Check Mirror Symmetry.
Definition: Proto_DisjointBoxLayout.H:449
LevelIterator begin() const
Get Iterator.
Definition: Proto_DisjointBoxLayout.H:341
Definition: Proto_Array.H:17
DisjointBoxLayout & operator=(const DisjointBoxLayout &a_input)
Assignment.
Definition: Proto_DisjointBoxLayout.H:152
DataIndex< BoxPartition > LevelIndex
Definition: Proto_DisjointBoxLayout.H:22
Point boxSize() const
Get Box Size.
Definition: Proto_DisjointBoxLayout.H:299
bool compatible(const DisjointBoxLayout &a_layout) const
Compatibility Query.
Definition: Proto_DisjointBoxLayout.H:355
const std::vector< pair< Point, unsigned int > > boxes() const
Get All Boxes.
Definition: Proto_DisjointBoxLayout.H:171
Integer Valued Vector.
Definition: Proto_Point.H:24
std::shared_ptr< BoxPartition > partition()
Definition: Proto_DisjointBoxLayout.H:310
ProblemDomain coarsen(Point a_refRatio) const
Coarsen (Anisotropic)
Definition: Proto_ProblemDomain.H:100
DisjointBoxLayout refine(const Point &a_refRatio) const
Refine.
Definition: Proto_DisjointBoxLayout.H:403
DisjointBoxLayout()
Default Constructor.
Definition: Proto_DisjointBoxLayout.H:6
LevelIterator end() const
Iterator End.
Definition: Proto_DisjointBoxLayout.H:334
LevelIndex localIndex(unsigned int a_myIndexInt) const
Local Indexing.
Definition: Proto_DisjointBoxLayout.H:253
ProblemDomain m_problemDomain
Definition: Proto_DisjointBoxLayout.H:482
bool onLevelBoundary(const Point &a_pt) const
On Level Boundary.
Definition: Proto_DisjointBoxLayout.H:318
unsigned int numBoxes() const
NumBoxes.
Definition: Proto_DisjointBoxLayout.H:191
LevelIndex find(const Point &a_pt) const
Find Index.
Definition: Proto_DisjointBoxLayout.H:263
void loadAssign(Args... a_args)
Load Assign.
Definition: Proto_DisjointBoxLayout.H:130
bool coarsenable(const Point &a_refRatio) const
Coarsenable Query.
Definition: Proto_DisjointBoxLayout.H:348
Point point(const LevelIndex &a_index) const
Point Indexing.
Definition: Proto_DisjointBoxLayout.H:212
void define(std::shared_ptr< BoxPartition > a_partition, const Point &a_boxSize)
Direct Define.
Definition: Proto_DisjointBoxLayout.H:40
Point m_boxSize
Definition: Proto_DisjointBoxLayout.H:483
#define protoStream_t
Definition: Proto_Macros.H:18
Represents a rectangular domain over which a problem can be defined, including periodic images...
Definition: Proto_ProblemDomain.H:22
DisjointBoxLayout coarsen(const Point &a_refRatio) const
Simple Coarsen.
Definition: Proto_DisjointBoxLayout.H:373