18 #include <unordered_map> 20 #include "NamespaceHeader.H" 23 typedef std::unordered_map<uint64_t, LayoutIndex>
LMap;
49 const Box& a_fromRegion,
50 const Box& a_toRegion);
65 m_recbuffer(NULL), m_reccapacity(0)
74 {
return ncomps == m_ncomps;}
95 if (procID == rhs.procID)
98 const Box& right= rhs.item->toRegion;
105 return item->
toRegion < rhs.item->toRegion;
109 return procID < rhs.procID;
158 bool a_exchange =
false,
165 bool a_exchange =
false,
172 bool a_exchange =
false,
180 bool a_exchange =
false,
189 bool a_exchange =
false,
196 bool a_exchange =
false,
203 bool a_exchange =
false,
207 virtual void define(
const BoxLayout& a_level,
211 bool a_exchange =
false,
217 bool a_includeSelf=
false);
223 bool a_includeSelf=
false,
224 bool a_reverse=
false);
227 const LMap& a_lmapSrc,
230 const LMap& a_lmapDst,
234 bool a_reverse =
false);
243 const LMap& a_lmapSrc,
247 const LMap& a_lmapDst,
276 virtual void clear();
319 bool bufferAllocated()
const;
320 void setBufferAllocated(
bool arg)
const;
322 int numLocalCellsToCopy()
const;
323 int numFromCellsToCopy()
const;
324 int numToCellsToCopy()
const;
327 {
return m_isDefined;}
377 const Box& a_fromRegion,
378 const Box& a_toRegion)
409 inline const MotionItem& operator[](
size_t index)
const;
411 inline void operator++();
413 inline bool ok()
const;
417 inline size_t size(){
return m_motionplanPtr->size();}
441 MayDay::Error(
"illegal local_from_to option for CopyIterator");
472 #include "NamespaceFooter.H" bool isDefined(int ncomps) const
Definition: Copier.H:73
std::vector< IndexTM< int, 2 > > m_range
Definition: Copier.H:331
bool isDefined() const
Definition: Copier.H:326
void reset()
Definition: Copier.H:467
#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:329
Vector< MotionItem * > m_fromMotionPlan
Definition: Copier.H:338
int m_ncomps
Definition: Copier.H:76
std::unordered_map< uint64_t, LayoutIndex > LMap
Definition: Copier.H:23
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:145
std::ostream & operator<<(std::ostream &os, const Copier &copier)
const MotionItem & operator[](size_t index) const
Definition: Copier.H:451
std::vector< std::vector< bufEntry > > m_toMeUnpack
Definition: Copier.H:116
std::vector< bufEntry > m_fromMe
Definition: Copier.H:114
DisjointBoxLayout m_originPlan
Definition: Copier.H:347
bool m_isDefined
Definition: Copier.H:350
size_t m_sendcapacity
Definition: Copier.H:80
size_t size()
Definition: Copier.H:417
void reverse()
Definition: Copier.H:385
static Pool s_motionItemPool
Definition: Copier.H:342
int procID
Definition: Copier.H:42
IndexTM< T, N > coarsen(const IndexTM< T, N > &a_p, T a_s)
Definition: IndexTMI.H:430
DataIndex toIndex
Definition: Copier.H:39
const IntVect & bigEnd() const
Definition: Box.H:1768
BoxLayout m_dest
Definition: Copier.H:348
Vector< MotionItem * > m_toMotionPlan
Definition: Copier.H:339
size_t m_reccapacity
Definition: Copier.H:83
void * m_recbuffer
Definition: Copier.H:81
MotionItem(const DataIndex &a_from, const DataIndex &a_to, const Box &a_region)
Definition: Copier.H:367
void * m_sendbuffer
Definition: Copier.H:78
const IntVect & smallEnd() const
{ Accessors}
Definition: Box.H:1754
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:343
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:64
Vector< MotionItem * > m_localMotionPlan
Definition: Copier.H:337
size_t size() const
Definition: Vector.H:192
Box toRegion
Definition: Copier.H:41
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:421
void operator++()
Definition: Copier.H:457
static const IntVect Zero
Definition: IntVect.H:654
A Rectangular Domain on an Integer Lattice.
Definition: Box.H:465
Definition: DataIndex.H:112
Copier()
null constructor, copy constructor and operator= can be compiler defined.
Definition: Copier.H:150
const MotionItem & operator()() const
Definition: Copier.H:445
local_from_to
Definition: Copier.H:398
An integer Vector in SpaceDim-dimensional space.
Definition: CHArray.H:42
bool ok() const
Definition: Copier.H:462
const Vector< MotionItem * > * m_motionplanPtr
Definition: Copier.H:420
DataIndex fromIndex
Definition: Copier.H:39
bool operator==(const MotionItem &rhs)
Definition: Copier.H:53
Box fromRegion
Definition: Copier.H:40
CopyIterator(const Copier &a_copier, local_from_to)
Definition: Copier.H:426
std::vector< bufEntry > m_toMe
Definition: Copier.H:115
bool lexLT(const IntVect &s) const
Definition: IntVect.H:898