00001 #ifdef CH_LANG_CC 00002 /* 00003 * _______ __ 00004 * / ___/ / ___ __ _ / / ___ 00005 * / /__/ _ \/ _ \/ V \/ _ \/ _ \ 00006 * \___/_//_/\___/_/_/_/_.__/\___/ 00007 * Please refer to Copyright.txt, in Chombo's root directory. 00008 */ 00009 #endif 00010 00011 00012 // RegionGather 00013 // bvs, 05/26/06 00014 00015 #ifndef _REGIONGATHER_H_ 00016 #define _REGIONGATHER_H_ 00017 00018 #include "IntVect.H" 00019 #include "REAL.H" 00020 #include "LayoutData.H" 00021 #include "DisjointBoxLayout.H" 00022 #include "ProblemDomain.H" 00023 #include <list> 00024 #include "SPMD.H" 00025 #include "CH_Timer.H" 00026 #include "NamespaceHeader.H" 00027 00028 00030 template <class T> 00031 class GatherObject 00032 { 00033 public: 00034 IntVect m_offset; 00035 T m_value; 00036 }; 00037 00038 00040 00052 class RegionGather 00053 { 00054 public: 00055 RegionGather(); 00056 00057 void define(const ProblemDomain& a_domain, 00058 const DisjointBoxLayout& a_layout, 00059 int radius); 00060 00061 void dump() const; 00062 00063 class Message 00064 { 00065 public: 00066 IntVect distance; 00067 int src, dest; 00068 DataIndex srcIndex; 00069 DataIndex destIndex; 00070 int procID; 00071 bool operator < (const RegionGather::Message& rhs) const; 00072 }; 00073 00074 00075 LayoutData<Vector<RegionGather::Message> > m_messages; 00076 LayoutData<Vector<RegionGather::Message> > m_local; 00077 00078 00079 }; 00080 00082 00089 template <class T> 00090 void regionGather(const LayoutData<T>& a_local, 00091 const RegionGather& a_copier, 00092 LayoutData<Vector<GatherObject<T> > >& a_gatherObjects); 00093 00094 00095 #include "RegionGatherI.H" 00096 00097 #include "NamespaceFooter.H" 00098 #endif