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 #ifndef syncTools_H
00047 #define syncTools_H
00048
00049 #include "UList.H"
00050 #include "Pstream.H"
00051 #include "transformList.H"
00052 #include "Map.H"
00053 #include "EdgeMap.H"
00054 #include "PackedBoolList.H"
00055
00056
00057
00058 namespace Foam
00059 {
00060
00061 class polyBoundaryMesh;
00062 class polyMesh;
00063 class coupledPolyPatch;
00064
00065
00066
00067
00068
00069 class syncTools
00070 {
00071
00072
00073
00074 static bool hasCouples(const polyBoundaryMesh&);
00075
00076
00077 static void checkTransform(const coupledPolyPatch&, const bool);
00078
00079
00080
00081 template <class T>
00082 static void separateList(const vectorField&, UList<T>&);
00083
00084 template <class T>
00085 static void separateList(const vectorField&, Map<T>&);
00086
00087 template <class T>
00088 static void separateList(const vectorField&, EdgeMap<T>&);
00089
00090
00091 template <class T, class CombineOp>
00092 static void combine
00093 (
00094 Map<T>& pointValues,
00095 const CombineOp& cop,
00096 const label index,
00097 const T& val
00098 );
00099
00100
00101 template <class T, class CombineOp>
00102 static void combine
00103 (
00104 EdgeMap<T>& edgeValues,
00105 const CombineOp& cop,
00106 const edge& index,
00107 const T& val
00108 );
00109
00110
00111 public:
00112
00113
00114
00115
00116
00117 template <class T, class CombineOp>
00118 static void syncPointList
00119 (
00120 const polyMesh&,
00121 UList<T>&,
00122 const CombineOp& cop,
00123 const T& nullValue,
00124 const bool applySeparation
00125 );
00126
00127
00128
00129 template <class T, class CombineOp>
00130 static void syncPointList
00131 (
00132 const polyMesh&,
00133 const labelList& meshPoints,
00134 UList<T>&,
00135 const CombineOp& bop,
00136 const T& nullValue,
00137 const bool applySeparation
00138 );
00139
00140
00141
00142 template <class T, class CombineOp>
00143 static void syncEdgeList
00144 (
00145 const polyMesh&,
00146 UList<T>&,
00147 const CombineOp& cop,
00148 const T& nullValue,
00149 const bool applySeparation
00150 );
00151
00152
00153
00154
00155 template <class T, class CombineOp>
00156 static void syncBoundaryFaceList
00157 (
00158 const polyMesh&,
00159 UList<T>&,
00160 const CombineOp& cop,
00161 const bool applySeparation
00162 );
00163
00164
00165
00166
00167 template <class T, class CombineOp>
00168 static void syncFaceList
00169 (
00170 const polyMesh&,
00171 UList<T>&,
00172 const CombineOp& cop,
00173 const bool applySeparation
00174 );
00175
00176
00177
00178 template <class T>
00179 static void swapBoundaryFaceList
00180 (
00181 const polyMesh&,
00182 UList<T>&,
00183 const bool applySeparation
00184 );
00185
00186
00187
00188 template <class T>
00189 static void swapFaceList
00190 (
00191 const polyMesh&,
00192 UList<T>&,
00193 const bool applySeparation
00194 );
00195
00196
00197
00198
00199
00200
00201 template <class T, class CombineOp>
00202 static void syncPointMap
00203 (
00204 const polyMesh&,
00205 Map<T>& pointValues,
00206 const CombineOp& cop,
00207 const bool applySeparation
00208 );
00209
00210
00211
00212
00213
00214
00215 template <class T, class CombineOp>
00216 static void syncEdgeMap
00217 (
00218 const polyMesh&,
00219 EdgeMap<T>& edgeValues,
00220 const CombineOp& cop,
00221 const bool applySeparation
00222 );
00223
00224
00225
00226 template <unsigned nBits, class CombineOp>
00227 static void syncFaceList
00228 (
00229 const polyMesh& mesh,
00230 PackedList<nBits>& faceValues,
00231 const CombineOp& cop
00232 );
00233
00234 template <unsigned nBits>
00235 static void swapFaceList
00236 (
00237 const polyMesh& mesh,
00238 PackedList<nBits>& faceValues
00239 );
00240
00241 template <unsigned nBits, class CombineOp>
00242 static void syncPointList
00243 (
00244 const polyMesh& mesh,
00245 PackedList<nBits>& pointValues,
00246 const CombineOp& cop,
00247 const unsigned int nullValue
00248 );
00249
00250 template <unsigned nBits, class CombineOp>
00251 static void syncEdgeList
00252 (
00253 const polyMesh& mesh,
00254 PackedList<nBits>& edgeValues,
00255 const CombineOp& cop,
00256 const unsigned int nullValue
00257 );
00258
00259
00260
00261
00262 static PackedBoolList getMasterPoints(const polyMesh&);
00263
00264
00265 static PackedBoolList getMasterEdges(const polyMesh&);
00266
00267
00268 static PackedBoolList getMasterFaces(const polyMesh&);
00269
00270 };
00271
00272
00273 template<>
00274 void syncTools::separateList(const vectorField&, UList<vector>&);
00275
00276 template<>
00277 void syncTools::separateList(const vectorField&, Map<vector>&);
00278
00279 template<>
00280 void syncTools::separateList(const vectorField&, EdgeMap<vector>&);
00281
00282
00283
00284
00285 }
00286
00287
00288
00289 #ifdef NoRepository
00290 # include "syncToolsTemplates.C"
00291 #endif
00292
00293
00294
00295 #endif
00296
00297