1 #ifndef _PROTO_DisjointBoxLayout_H_ 2 #define _PROTO_DisjointBoxLayout_H_ 4 #include "Proto_Point.H" 6 #include "implem/Proto_Stack.H" 7 #include "Proto_ProblemDomain.H" 8 #include "Proto_DBLInternals.H" 9 #include "Proto_DataIndex.H" 10 #include "Proto_Morton.H" 11 #include "Proto_SPMD.H" 17 #include <unordered_map> 45 shared_ptr<DBLInternals> m_internals;
66 const Point & a_boxSize);
87 const vector<Point> & a_coarsenedPatches,
96 m_internals = a_input.m_internals;
97 m_problemDomain = a_input.m_problemDomain;
98 m_boxSize = a_input.m_boxSize;
106 const Point & a_boxSize);
114 const vector<Point> & a_coarsenedPatches,
115 const Point & a_boxSize);
123 m_internals = a_input.m_internals;
124 m_problemDomain = a_input.m_problemDomain;
125 m_boxSize = a_input.m_boxSize;
132 return ((a_input.m_internals == m_internals)&&
133 (a_input.m_problemDomain == m_problemDomain)&&
134 (a_input.m_boxSize == m_boxSize));
144 inline const shared_ptr<DBLInternals>
dblInternals()
const{
return m_internals;};
167 inline int procid(
const DataIndex& a_index)
const;
173 inline unsigned int offset(
int a_proc)
const;
190 inline unsigned int size()
const;
197 inline unsigned int mySize()
const;
214 inline DataIndex myIndex(
unsigned int a_myIndexInt)
const;
224 inline int myIntIndex(
const DataIndex& a_di)
const;
234 inline ProblemDomain problemDomain()
const{
return m_problemDomain;};
287 template <MemType MEMTYPE>
288 static StackAlloc<MEMTYPE>& getStackAllocator()
290 static StackAlloc<MEMTYPE> s_allocator;
296 static protoStream_t getCurrentStream()
298 static protoStream_t currStream;
299 static bool init=
false;
302 protoStreamCreate(&currStream);
312 os <<
"DisjointBoxLayout: \n" ;
313 os << a_dbl.problemDomain() <<
"\n";
315 os <<
"coarsened Domain = " << internals->coarsenedDomain <<
"\n" ;
316 os <<
"Points and ranks: \n";
317 for (
int k = 0; k < internals->allBoxes.size();k++)
319 os << internals->allBoxes[k].first
320 <<
" , " << internals->allBoxes[k].second <<
"\n";
322 os <<
"StartProc vector: \n";
323 for (
int k = 0; k < internals->startProc.size() ; k++)
325 os <<
"Starting patch number for processor " << k
326 <<
" = " << internals->startProc[k] <<
"\n";
330 #include "implem/Proto_DisjointBoxLayoutImplem.H" DisjointBoxLayout coarsen(const Point &a_refrat) const
Coarsen.
Definition: Proto_DisjointBoxLayout.H:194
unsigned int size() const
Size.
Definition: Proto_DisjointBoxLayout.H:82
DataIterator begin() const
Get Iterator.
Definition: Proto_LevelIterators.H:159
Definition: Proto_LevelIterators.H:19
void define(const ProblemDomain &a_problemDomain, const Point &a_boxSize)
Define (Full Domain)
Definition: Proto_DisjointBoxLayout.H:16
std::ostream & operator<<(std::ostream &a_os, const Box &a_box)
OStream Operator.
Definition: Proto_Box.H:850
Disjoint Box Layout.
Definition: Proto_DisjointBoxLayout.H:37
bool operator==(const DisjointBoxLayout &a_input) const
Equality Operator.
Definition: Proto_DisjointBoxLayout.H:130
DataIndex localIndex(unsigned int a_myIndexInt) const
Local Indexing.
Definition: Proto_DisjointBoxLayout.H:145
bool coarsenable(const Point &a_refrat) const
Coarsenable Query.
Definition: Proto_DisjointBoxLayout.H:187
unsigned int localSize() const
Local Size.
Definition: Proto_DisjointBoxLayout.H:88
An interval in DIM dimensional space.
Definition: Proto_Box.H:26
DisjointBoxLayout(const DisjointBoxLayout &a_input)
Copy Constructor.
Definition: Proto_DisjointBoxLayout.H:94
const shared_ptr< DBLInternals > dblInternals() const
Get Internals.
Definition: Proto_DisjointBoxLayout.H:144
DataIndex find(const Point &a_pt) const
Find Index.
Definition: Proto_DisjointBoxLayout.H:172
int procID()
local process ID
Definition: Proto_SPMD.H:52
const DataIndex & end() const
Definition: Proto_DisjointBoxLayout.H:245
DataIndex index(Point &a_coarsenedPt) const
Get Index From Point.
Definition: Proto_DisjointBoxLayout.H:133
ProblemDomain domain() const
Get Problem Domain.
Definition: Proto_DisjointBoxLayout.H:233
Box operator[](const DataIndex &a_index) const
Index Access.
Definition: Proto_DisjointBoxLayout.H:100
DisjointBoxLayout & operator=(const DisjointBoxLayout &a_input)
Assignment.
Definition: Proto_DisjointBoxLayout.H:121
Definition: Proto_Box.H:11
Point boxSize() const
Get Box Size.
Definition: Proto_DisjointBoxLayout.H:230
Integer Valued Vector.
Definition: Proto_Point.H:21
int localIntIndex(const DataIndex &a_di) const
Local Indexing (Inverse)
Definition: Proto_DisjointBoxLayout.H:157
Definition: Proto_DataIndex.H:17
Point point(const DataIndex &a_index) const
Point Indexing.
Definition: Proto_DisjointBoxLayout.H:107
unsigned int offset(int a_proc) const
Patch Offset.
Definition: Proto_DisjointBoxLayout.H:74
Box box(const DataIndex &a_index) const
Box Indexing.
Definition: Proto_DisjointBoxLayout.H:113
DisjointBoxLayout refine(const Point &a_refrat) const
Refine.
Definition: Proto_DisjointBoxLayout.H:205
int procID(const DataIndex &a_index) const
Get Process ID.
Definition: Proto_DisjointBoxLayout.H:121
Represents a rectangular domain over which a problem can be defined, including periodic images...
Definition: Proto_ProblemDomain.H:22