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 #ifndef fvFieldDecomposer_H
00037 #define fvFieldDecomposer_H
00038
00039 #include <finiteVolume/fvMesh.H>
00040 #include <finiteVolume/fvPatchFieldMapper.H>
00041 #include <finiteVolume/surfaceFields.H>
00042
00043
00044
00045 namespace Foam
00046 {
00047
00048 class IOobjectList;
00049
00050
00051
00052
00053
00054 class fvFieldDecomposer
00055 {
00056 public:
00057
00058
00059 class patchFieldDecomposer
00060 :
00061 public fvPatchFieldMapper
00062 {
00063
00064
00065 labelList directAddressing_;
00066
00067 public:
00068
00069
00070
00071
00072 patchFieldDecomposer
00073 (
00074 const unallocLabelList& addressingSlice,
00075 const label addressingOffset
00076 );
00077
00078
00079
00080
00081 label size() const
00082 {
00083 return directAddressing_.size();
00084 }
00085
00086 bool direct() const
00087 {
00088 return true;
00089 }
00090
00091 const unallocLabelList& directAddressing() const
00092 {
00093 return directAddressing_;
00094 }
00095 };
00096
00097
00098
00099
00100
00101 class processorVolPatchFieldDecomposer
00102 :
00103 public fvPatchFieldMapper
00104 {
00105
00106
00107 labelList directAddressing_;
00108
00109 public:
00110
00111
00112 processorVolPatchFieldDecomposer
00113 (
00114 const fvMesh& mesh,
00115 const unallocLabelList& addressingSlice
00116 );
00117
00118
00119
00120
00121 label size() const
00122 {
00123 return directAddressing_.size();
00124 }
00125
00126 bool direct() const
00127 {
00128 return true;
00129 }
00130
00131 const unallocLabelList& directAddressing() const
00132 {
00133 return directAddressing_;
00134 }
00135 };
00136
00137
00138
00139
00140 class processorSurfacePatchFieldDecomposer
00141 :
00142 public fvPatchFieldMapper
00143 {
00144 labelListList addressing_;
00145 scalarListList weights_;
00146
00147 public:
00148
00149
00150 processorSurfacePatchFieldDecomposer
00151 (
00152 const unallocLabelList& addressingSlice
00153 );
00154
00155
00156
00157
00158 label size() const
00159 {
00160 return addressing_.size();
00161 }
00162
00163 bool direct() const
00164 {
00165 return false;
00166 }
00167
00168 const labelListList& addressing() const
00169 {
00170 return addressing_;
00171 }
00172
00173 const scalarListList& weights() const
00174 {
00175 return weights_;
00176 }
00177 };
00178
00179
00180 private:
00181
00182
00183
00184
00185 const fvMesh& completeMesh_;
00186
00187
00188 const fvMesh& procMesh_;
00189
00190
00191 const labelList& faceAddressing_;
00192
00193
00194 const labelList& cellAddressing_;
00195
00196
00197 const labelList& boundaryAddressing_;
00198
00199
00200 List<patchFieldDecomposer*> patchFieldDecomposerPtrs_;
00201
00202 List<processorVolPatchFieldDecomposer*>
00203 processorVolPatchFieldDecomposerPtrs_;
00204
00205 List<processorSurfacePatchFieldDecomposer*>
00206 processorSurfacePatchFieldDecomposerPtrs_;
00207
00208
00209
00210
00211
00212 fvFieldDecomposer(const fvFieldDecomposer&);
00213
00214
00215 void operator=(const fvFieldDecomposer&);
00216
00217
00218 public:
00219
00220
00221
00222
00223 fvFieldDecomposer
00224 (
00225 const fvMesh& completeMesh,
00226 const fvMesh& procMesh,
00227 const labelList& faceAddressing,
00228 const labelList& cellAddressing,
00229 const labelList& boundaryAddressing
00230 );
00231
00232
00233
00234
00235 ~fvFieldDecomposer();
00236
00237
00238
00239
00240
00241 template<class Type>
00242 tmp<GeometricField<Type, fvPatchField, volMesh> >
00243 decomposeField
00244 (
00245 const GeometricField<Type, fvPatchField, volMesh>& field
00246 ) const;
00247
00248
00249 template<class Type>
00250 tmp<GeometricField<Type, fvsPatchField, surfaceMesh> >
00251 decomposeField
00252 (
00253 const GeometricField<Type, fvsPatchField, surfaceMesh>& field
00254 ) const;
00255
00256 template<class GeoField>
00257 void decomposeFields(const PtrList<GeoField>& fields) const;
00258 };
00259
00260
00261
00262
00263 }
00264
00265
00266
00267 #ifdef NoRepository
00268 # include "fvFieldDecomposerDecomposeFields.C"
00269 #endif
00270
00271
00272
00273 #endif
00274
00275