2 #ifndef _PROTO_MB_LEVEL_DATA_ 3 #define _PROTO_MB_LEVEL_DATA_ 12 template<
typename T,
unsigned int C, MemType MEM, Centering CTR>
16 template<
typename T,
unsigned int C, MemType MEM, Centering CTR>
18 template<
typename MAP, MemType MEM>
24 template<
typename T,
unsigned int C, MemType SRC_MEM, MemType DST_MEM, Centering CTR>
36 inline void linearOut(
void* a_buffer,
const MBMotionItem& a_info)
const;
37 inline void linearIn(
void* a_buffer,
const MBMotionItem& a_info)
const;
38 inline void localCopy(
const MBMotionItem& a_info)
const;
42 template<
typename T,
unsigned int C, MemType SRC_MEM, MemType DST_MEM, Centering CTR>
45 <MBLevelCopierOp<T, C, SRC_MEM, DST_MEM, CTR>, MBBoxPartition, MBBoxPartition, SRC_MEM, DST_MEM>
49 inline void buildMotionPlans(
55 template<
typename T,
unsigned int C, MemType SRC_MEM, MemType DST_MEM, Centering CTR>
67 inline void linearOut(
void* a_buffer,
const MBMotionItem& a_info)
const;
68 inline void linearIn(
void* a_buffer,
const MBMotionItem& a_info)
const;
69 inline void localCopy(
const MBMotionItem& a_info)
const;
73 template<
typename T,
unsigned int C, MemType SRC_MEM, MemType DST_MEM, Centering CTR>
76 <MBLevelFullCopierOp<T, C, SRC_MEM, DST_MEM, CTR>, MBBoxPartition, MBBoxPartition, SRC_MEM, DST_MEM>
80 inline void buildMotionPlans(
85 template<
typename T,
unsigned int C, MemType MEM, Centering CTR>
96 inline void linearOut(
void* a_buffer,
const MBMotionItem& a_info)
const;
98 inline void linearIn(
void* a_buffer,
const MBMotionItem& a_info)
const;
100 inline void localCopy(
const MBMotionItem& a_info)
const;
104 template<
typename T,
unsigned int C, MemType MEM, Centering CTR>
106 :
public Copier<MBLevelExchangeCopierOp<T, C, MEM, CTR>, MBBoxPartition, MBBoxPartition, MEM, MEM>
119 template<
typename T,
unsigned int C, MemType MEM, Centering CTR=PR_CELL>
127 template<
typename _T,
unsigned int _C, MemType _MEM, Centering _CTR>
193 template<
typename Func,
typename... Srcs>
194 inline void initialize(Func& a_func, Srcs&... a_srcs);
197 inline void setVal(T a_value);
200 inline void setBoundary(T a_val,
int a_comp = -1);
203 inline void setRandom(T a_low, T a_high);
206 template<
typename Func,
typename... Srcs>
207 inline void initConvolve(Func& a_func, Srcs&... a_srcs);
222 template<MemType DST_MEM>
225 template<MemType DST_MEM>
253 inline Box patchBox(
const MBIndex& a_index)
const;
259 inline unsigned int patchSize(
BlockIndex a_block)
const;
274 inline void linearOut(
void* a_buffer)
const;
281 inline void linearIn(
void* a_buffer);
284 inline size_t offset(
unsigned int a_proc)
const;
292 inline std::vector<MBBoundaryData<T, C, MEM>>& bounds(
296 inline const std::vector<MBBoundaryData<T, C, MEM>>& bounds(
302 inline bool isBlockBoundary(
347 inline std::vector<Point> onDomainBoundary(
353 template<Proto::Operation OP>
354 inline T reduce(
unsigned int c = 0)
const;
356 inline T absMax(
unsigned int c = 0)
const;
358 inline T max(
unsigned int c = 0)
const;
360 inline T min(
unsigned int c = 0)
const;
362 inline T sum(
unsigned int c = 0)
const;
367 inline void printBounds(
const MBIndex& a_index,
int a_prec = 4);
370 inline unsigned int numBlocks()
const {
return m_layout.numBlocks(); }
380 std::vector<std::shared_ptr<LevelBoxData<T, C, MEM, CTR>>>
m_data;
381 mutable std::map<boundsKey_t, std::vector<MBBoundaryData<T, C, MEM>>>
m_bounds;
384 #include "implem/Proto_MBLevelBoxDataImplem.H" 386 #endif //end include guard Level Copier Operator.
Definition: Proto_MBLevelBoxData.H:25
Full Level Copier (Includes all ghost cells)
Definition: Proto_MBLevelBoxData.H:74
void localCopy(const MBMotionItem &a_info) const
Definition: Proto_MBLevelBoxData.H:980
std::tuple< Point, BlockIndex, Point > boundsKey_t
Definition: Proto_MBLevelBoxData.H:124
Exchange Copier.
Definition: Proto_MBLevelBoxData.H:105
std::enable_if< I< sizeof...(LArgs), void >::typecall_mb_level_forall(Func &a_func, MBIndex &a_index, Centering CTR, std::tuple< LArgs... > a_args, FArgs &&... a_fargs){ auto &arg=parse_mb_level_arg(a_index, CTR, std::get< I >a_args));call_mb_level_forall< I+1 >a_func, a_index, CTR, a_args, a_fargs..., arg);}template< typename T, unsigned int C, MemType MEM, Centering CTR >template< typename Func, typename... Srcs >void MBLevelBoxData< T, C, MEM, CTR >::initialize(Func &a_func, Srcs &... a_srcs){ auto srcs=std::tuple< Srcs &... >a_srcs...);for(auto iter :(m_layout)) { auto &patch=(*this)[iter];auto block=layout().block(iter);call_mb_level_forall(a_func, iter, CTR, srcs, patch, block);} }template< typename T, unsigned int C, MemType MEM, Centering CTR >template< typename Func, typename... Srcs >void MBLevelBoxData< T, C, MEM, CTR >::initConvolve(Func &a_func, Srcs &... a_srcs){ auto g=ghost();g[0]=g[0]+Point::Ones();MBLevelBoxData< T, C, MEM, CTR > tmp(m_layout, g);tmp.initialize(a_func, a_srcs...);for(auto iter :m_layout) { auto &tmp_i=tmp[iter];auto &patch=(*this)[iter];Operator::convolve(patch, tmp_i);}}template< typename T, unsigned int C, MemType MEM, Centering CTR >void MBLevelBoxData< T, C, MEM, CTR >::setVal(T a_value){ for(auto data :m_data) { data-> setVal(a_value)
Definition: Proto_MBLevelBoxData.H:208
Multiblock AMR Data.
Definition: Proto_MBAMRData.H:12
Distributed Data Iterator.
Definition: Proto_DataIndex.H:10
std::map< boundsKey_t, std::vector< MBBoundaryData< T, C, MEM > > > m_bounds
Definition: Proto_MBLevelBoxData.H:381
Multidimensional Rectangular Array.
Definition: Proto_BoxData.H:314
Level Copier.
Definition: Proto_MBLevelBoxData.H:43
MBLevelBoxData< T, C, SRC_MEM, CTR > * m_src
Definition: Proto_MBLevelBoxData.H:28
int BlockIndex
Defines what type is used for indexing block entities.
Definition: Proto_MBGraph.H:9
void linearOut(void *a_buffer, const MBMotionItem &a_info) const
Definition: Proto_MBLevelBoxData.H:954
MBLevelBoxData< T, C, DST_MEM, CTR > * m_dst
Definition: Proto_MBLevelBoxData.H:29
Single Level Mapped Multiblock Map.
Definition: Proto_MBLevelBoxData.H:19
MBLevelExchangeCopier< T, C, MEM, CTR > m_exchangeCopier
Definition: Proto_MBLevelBoxData.H:377
Level Box Data.
Definition: Proto_HDF5.H:17
MBLevelExchangeCopier()
Definition: Proto_MBLevelBoxData.H:109
MBLevelFullCopier()
Definition: Proto_MBLevelBoxData.H:79
const MBDisjointBoxLayout & layout() const
Get Layout.
Definition: Proto_MBLevelBoxData.H:248
Multiblock Level Box Data.
Definition: Proto_MBLevelBoxData.H:17
void linearIn(void *a_buffer, const MBMotionItem &a_info) const
Definition: Proto_MBLevelBoxData.H:967
Exchange Copier Operator.
Definition: Proto_MBLevelBoxData.H:86
MotionItem< MBBoxPartition, MBBoxPartition > MBMotionItem
Definition: Proto_MBBoundaryRegister.H:11
An interval in DIM dimensional space.
Definition: Proto_Box.H:29
MBLevelFullCopierOp()
Definition: Proto_MBLevelBoxData.H:62
Array< Point, DIM+1 > m_ghost
Definition: Proto_MBLevelBoxData.H:378
MBLevelBoxData< T, C, SRC_MEM, CTR > * m_src
Definition: Proto_MBLevelBoxData.H:59
MBLevelBoxData< T, C, DST_MEM, CTR > * m_dst
Definition: Proto_MBLevelBoxData.H:60
Definition: Proto_MBBoundaryData.H:11
Full Level Copier Operator (Includes all ghost cells)
Definition: Proto_MBLevelBoxData.H:56
MBLevelCopierOp()
Definition: Proto_MBLevelBoxData.H:31
uint64_t linearSize(const Box &a_bx, const MBIndex a_index) const
Definition: Proto_MBLevelBoxData.H:945
void initConvolve(LevelBoxData< T, C, MEM, CTR > &a_data, Func &a_func, Srcs... a_srcs)
Initialize and Convolve.
Definition: Proto_Operator.H:84
static ACCEL_DECORATION Point Zeros()
Get Zeros.
Definition: Proto_Array.H:17
A templated constant size array object similar to std::array, but with the ability to be used inside ...
Definition: Proto_Array.H:28
unsigned int numBlocks() const
Get Number of Blocks.
Definition: Proto_MBLevelBoxData.H:370
Integer Valued Vector.
Definition: Proto_Point.H:24
Definition: Proto_MBDisjointBoxLayout.H:14
MBLevelBoxData< T, C, MEM, CTR > * m_data
Definition: Proto_MBLevelBoxData.H:89
std::vector< std::shared_ptr< LevelBoxData< T, C, MEM, CTR > > > m_data
Definition: Proto_MBLevelBoxData.H:380
MBLevelCopier()
Definition: Proto_MBLevelBoxData.H:48
MBDisjointBoxLayout m_layout
Definition: Proto_MBLevelBoxData.H:379
MBLevelExchangeCopierOp()
Definition: Proto_MBLevelBoxData.H:91
Pointwise Variable.
Definition: Proto_BoxData.H:117
Abstract Generic Parallel Copier.
Definition: Proto_Copier.H:60
Definition: Proto_MBDataPoint.H:10
Definition: Proto_Copier.H:22