18 #include <unordered_map> 22 #include "NamespaceHeader.H" 25 typedef std::unordered_map<uint64_t, LayoutIndex>
LMap;
51 const Box& a_fromRegion,
52 const Box& a_toRegion);
67 m_recbuffer(NULL), m_reccapacity(0)
76 {
return ncomps == m_ncomps;}
97 if (procID == rhs.procID)
100 const Box& right= rhs.item->toRegion;
107 return item->
toRegion < rhs.item->toRegion;
111 return procID < rhs.procID;
165 bool a_exchange =
false,
172 bool a_exchange =
false,
179 bool a_exchange =
false,
187 bool a_exchange =
false,
196 bool a_exchange =
false,
203 bool a_exchange =
false,
210 bool a_exchange =
false,
214 virtual void define(
const BoxLayout& a_level,
218 bool a_exchange =
false,
224 bool a_includeSelf=
false);
230 bool a_includeSelf=
false,
231 bool a_reverse=
false);
234 const LMap& a_lmapSrc,
237 const LMap& a_lmapDst,
241 bool a_reverse =
false);
250 const LMap& a_lmapSrc,
254 const LMap& a_lmapDst,
283 virtual void clear();
326 bool bufferAllocated()
const;
327 void setBufferAllocated(
bool arg)
const;
329 int numLocalCellsToCopy()
const;
330 int numFromCellsToCopy()
const;
331 int numToCellsToCopy()
const;
334 {
return m_isDefined;}
384 const Box& a_fromRegion,
385 const Box& a_toRegion)
416 inline const MotionItem& operator[](
size_t index)
const;
418 inline void operator++();
420 inline bool ok()
const;
424 inline size_t size(){
return m_motionplanPtr->size();}
448 MayDay::Error(
"illegal local_from_to option for CopyIterator");
479 #include "NamespaceFooter.H" bool isDefined(int ncomps) const
Definition: Copier.H:75
std::vector< IndexTM< int, 2 > > m_range
Definition: Copier.H:338
bool isDefined() const
Definition: Copier.H:333
void reset()
Definition: Copier.H:474
#define CH_assert(cond)
Definition: CHArray.H:37
A class to facilitate interaction with physical boundary conditions.
Definition: ProblemDomain.H:141
CopierBuffer m_buffers
Definition: Copier.H:336
Vector< MotionItem * > m_fromMotionPlan
Definition: Copier.H:345
int m_ncomps
Definition: Copier.H:78
std::unordered_map< uint64_t, LayoutIndex > LMap
Definition: Copier.H:25
A not-necessarily-disjoint collective of boxes.
Definition: BoxLayout.H:145
one dimensional dynamic array
Definition: Vector.H:53
A strange but true thing to make copying from one boxlayoutdata to another fast.
Definition: Copier.H:152
std::ostream & operator<<(std::ostream &os, const Copier &copier)
const MotionItem & operator[](size_t index) const
Definition: Copier.H:458
std::vector< std::vector< bufEntry > > m_toMeUnpack
Definition: Copier.H:118
std::vector< bufEntry > m_fromMe
Definition: Copier.H:116
DisjointBoxLayout m_originPlan
Definition: Copier.H:354
bool m_isDefined
Definition: Copier.H:357
size_t m_sendcapacity
Definition: Copier.H:82
size_t size()
Definition: Copier.H:424
void reverse()
Definition: Copier.H:392
static Pool s_motionItemPool
Definition: Copier.H:349
int procID
Definition: Copier.H:44
IndexTM< T, N > coarsen(const IndexTM< T, N > &a_p, T a_s)
Definition: IndexTMI.H:430
DataIndex toIndex
Definition: Copier.H:41
const IntVect & bigEnd() const
Definition: Box.H:1784
BoxLayout m_dest
Definition: Copier.H:355
Vector< MotionItem * > m_toMotionPlan
Definition: Copier.H:346
size_t m_reccapacity
Definition: Copier.H:85
void * m_recbuffer
Definition: Copier.H:83
MotionItem(const DataIndex &a_from, const DataIndex &a_to, const Box &a_region)
Definition: Copier.H:374
int numSends
Definition: Copier.H:124
void * m_sendbuffer
Definition: Copier.H:80
const IntVect & smallEnd() const
{ Accessors}
Definition: Box.H:1770
bool operator<(const FaceIndex &f1, const FaceIndex &f2)
Definition: FaceIndex.H:212
Pool is a class to optimize memory allocation.
Definition: Pool.H:63
bool buffersAllocated
Definition: Copier.H:350
A BoxLayout that has a concept of disjointedness.
Definition: DisjointBoxLayout.H:30
CopierBuffer()
null constructor, copy constructor and operator= can be compiler defined.
Definition: Copier.H:66
Vector< MotionItem * > m_localMotionPlan
Definition: Copier.H:344
size_t size() const
Definition: Vector.H:192
Box toRegion
Definition: Copier.H:43
static void Error(const char *const a_msg=m_nullString, int m_exitCode=CH_DEFAULT_ERROR_CODE)
Print out message to cerr and exit with the specified exit code.
unsigned int m_current
Definition: Copier.H:428
void operator++()
Definition: Copier.H:464
static const IntVect Zero
Definition: IntVect.H:658
A Rectangular Domain on an Integer Lattice.
Definition: Box.H:469
Definition: DataIndex.H:114
Copier()
null constructor, copy constructor and operator= can be compiler defined.
Definition: Copier.H:157
const MotionItem & operator()() const
Definition: Copier.H:452
local_from_to
Definition: Copier.H:405
An integer Vector in SpaceDim-dimensional space.
Definition: CHArray.H:42
bool ok() const
Definition: Copier.H:469
const Vector< MotionItem * > * m_motionplanPtr
Definition: Copier.H:427
DataIndex fromIndex
Definition: Copier.H:41
bool operator==(const MotionItem &rhs)
Definition: Copier.H:55
Box fromRegion
Definition: Copier.H:42
CopyIterator(const Copier &a_copier, local_from_to)
Definition: Copier.H:433
std::vector< bufEntry > m_toMe
Definition: Copier.H:117
bool lexLT(const IntVect &s) const
Definition: IntVect.H:917