mapDistribute.H
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048 #ifndef mapDistribute_H
00049 #define mapDistribute_H
00050
00051 #include "labelList.H"
00052 #include "labelPair.H"
00053 #include "Pstream.H"
00054 #include "boolList.H"
00055
00056
00057
00058 namespace Foam
00059 {
00060
00061 class mapPolyMesh;
00062
00063
00064
00065
00066
00067 class mapDistribute
00068 {
00069
00070
00071
00072 label constructSize_;
00073
00074
00075 labelListList subMap_;
00076
00077
00078 labelListList constructMap_;
00079
00080
00081 mutable autoPtr<List<labelPair> > schedulePtr_;
00082
00083
00084 public:
00085
00086
00087
00088
00089 mapDistribute
00090 (
00091 const label constructSize,
00092 const labelListList& subMap,
00093 const labelListList& constructMap
00094 );
00095
00096
00097 mapDistribute
00098 (
00099 const label constructSize,
00100 labelListList& subMap,
00101 labelListList& constructMap,
00102 const bool reUse
00103 );
00104
00105
00106
00107 mapDistribute
00108 (
00109 const labelList& sendProcs,
00110 const labelList& recvProcs
00111 );
00112
00113
00114 mapDistribute(const mapDistribute&);
00115
00116
00117
00118
00119
00120
00121
00122 label constructSize() const
00123 {
00124 return constructSize_;
00125 }
00126
00127
00128 label& constructSize()
00129 {
00130 return constructSize_;
00131 }
00132
00133
00134 const labelListList& subMap() const
00135 {
00136 return subMap_;
00137 }
00138
00139
00140 labelListList& subMap()
00141 {
00142 return subMap_;
00143 }
00144
00145
00146 const labelListList& constructMap() const
00147 {
00148 return constructMap_;
00149 }
00150
00151
00152 labelListList& constructMap()
00153 {
00154 return constructMap_;
00155 }
00156
00157
00158 static List<labelPair> schedule
00159 (
00160 const labelListList& subMap,
00161 const labelListList& constructMap
00162 );
00163
00164
00165 const List<labelPair>& schedule() const;
00166
00167
00168
00169
00170
00171
00172
00173 void compact(const boolList& elemIsUsed);
00174
00175
00176
00177
00178 template<class T>
00179 static void distribute
00180 (
00181 const Pstream::commsTypes commsType,
00182 const List<labelPair>& schedule,
00183 const label constructSize,
00184 const labelListList& subMap,
00185 const labelListList& constructMap,
00186 List<T>&
00187 );
00188
00189
00190
00191 template<class T, class CombineOp>
00192 static void distribute
00193 (
00194 const Pstream::commsTypes commsType,
00195 const List<labelPair>& schedule,
00196 const label constructSize,
00197 const labelListList& subMap,
00198 const labelListList& constructMap,
00199 List<T>&,
00200 const CombineOp& cop,
00201 const T& nullValue
00202 );
00203
00204
00205 template<class T>
00206 void distribute(List<T>& fld) const
00207 {
00208 if
00209 (
00210 Pstream::defaultCommsType == Pstream::nonBlocking
00211 && contiguous<T>()
00212 )
00213 {
00214 distribute
00215 (
00216 Pstream::nonBlocking,
00217 List<labelPair>(),
00218 constructSize_,
00219 subMap_,
00220 constructMap_,
00221 fld
00222 );
00223 }
00224 else if (Pstream::defaultCommsType == Pstream::scheduled)
00225 {
00226 distribute
00227 (
00228 Pstream::scheduled,
00229 schedule(),
00230 constructSize_,
00231 subMap_,
00232 constructMap_,
00233 fld
00234 );
00235 }
00236 else
00237 {
00238 distribute
00239 (
00240 Pstream::blocking,
00241 List<labelPair>(),
00242 constructSize_,
00243 subMap_,
00244 constructMap_,
00245 fld
00246 );
00247 }
00248 }
00249
00250
00251 void updateMesh(const mapPolyMesh&)
00252 {
00253 notImplemented
00254 (
00255 "mapDistribute::updateMesh(const mapPolyMesh&)"
00256 );
00257 }
00258
00259
00260
00261 void operator=(const mapDistribute&);
00262
00263 };
00264
00265
00266
00267
00268 }
00269
00270
00271
00272 #ifdef NoRepository
00273 # include "mapDistributeTemplates.C"
00274 #endif
00275
00276
00277
00278 #endif
00279
00280
Copyright © 2000-2009 OpenCFD Ltd