surfMesh.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 #ifndef surfMesh_H
00039 #define surfMesh_H
00040
00041 #include "surfaceRegistry.H"
00042 #include "MeshedSurfaceIOAllocator.H"
00043 #include "PrimitivePatch.H"
00044 #include "SubField.H"
00045
00046
00047
00048 namespace Foam
00049 {
00050
00051 template<class Face> class MeshedSurface;
00052
00053
00054
00055
00056
00057 class surfMesh
00058 :
00059 public surfaceRegistry,
00060 private MeshedSurfaceIOAllocator,
00061 public PrimitivePatch<face, ::Foam::UList, ::Foam::SubField<point>, point>
00062 {
00063
00064 template<class Face> friend class MeshedSurface;
00065 template<class Face> friend class UnsortedMeshedSurface;
00066
00067 public:
00068
00069
00070
00071
00072
00073
00074 enum readUpdateState
00075 {
00076 UNCHANGED,
00077 POINTS_MOVED,
00078 TOPO_CHANGE,
00079 TOPO_PATCH_CHANGE
00080 };
00081
00082
00083 private:
00084
00085
00086
00087 typedef MeshedSurfaceIOAllocator Allocator;
00088
00089 typedef PrimitivePatch
00090 <
00091 face,
00092 ::Foam::UList,
00093 ::Foam::SubField<point>,
00094 point
00095 >
00096 MeshReference;
00097
00098
00099
00100
00101
00102 surfMesh(const surfMesh&);
00103
00104
00105 void operator=(const surfMesh&);
00106
00107
00108 protected:
00109
00110
00111
00112
00113 pointField& storedPoints()
00114 {
00115 return Allocator::storedIOPoints();
00116 }
00117
00118
00119 faceList& storedFaces()
00120 {
00121 return Allocator::storedIOFaces();
00122 }
00123
00124
00125 surfZoneList& storedZones()
00126 {
00127 return Allocator::storedIOZones();
00128 }
00129
00130
00131 virtual void updateFacesRef();
00132
00133
00134 virtual void updatePointsRef();
00135
00136
00137 virtual void updateRefs();
00138
00139
00140 public:
00141
00142
00143
00144 typedef surfMesh Mesh;
00145
00146
00147 typedef bool BoundaryMesh;
00148
00149
00150
00151 TypeName("surfMesh");
00152
00153
00154 static word meshSubDir;
00155
00156
00157
00158
00159 explicit surfMesh(const IOobject&, const word& surfName="");
00160
00161
00162
00163 surfMesh
00164 (
00165 const IOobject&,
00166 const Xfer<pointField>&,
00167 const Xfer<faceList>&,
00168 const word& surfName=""
00169 );
00170
00171
00172 surfMesh
00173 (
00174 const IOobject&,
00175 const Xfer< MeshedSurface<face> >& surf,
00176 const word& surfName=""
00177 );
00178
00179
00180
00181
00182 virtual ~surfMesh();
00183
00184
00185
00186
00187
00188
00189
00190 fileName meshDir() const;
00191
00192
00193
00194
00195 const fileName& pointsInstance() const;
00196
00197
00198 const fileName& facesInstance() const;
00199
00200
00201 void setInstance(const fileName&);
00202
00203
00204
00205
00206
00207 virtual label nPoints() const;
00208
00209
00210 virtual label nFaces() const;
00211
00212
00213 virtual label size() const
00214 {
00215 return nFaces();
00216 }
00217
00218
00219
00220 virtual const pointField& points() const;
00221
00222
00223 virtual const faceList& faces() const;
00224
00225
00226 virtual const surfZoneList& surfZones() const
00227 {
00228 return Allocator::storedIOZones();
00229 }
00230
00231
00232 void checkZones();
00233
00234
00235 void addZones
00236 (
00237 const List<surfZone>&,
00238 const bool validate = true
00239 );
00240
00241
00242
00243 virtual readUpdateState readUpdate();
00244
00245
00246
00247
00248 void removeZones();
00249
00250
00251 void resetPrimitives
00252 (
00253 const Xfer< pointField >& points,
00254 const Xfer< faceList >& faces,
00255 const Xfer< surfZoneList >& zones,
00256 const bool validate = true
00257 );
00258
00259
00260
00261 void transfer(MeshedSurface<face>&);
00262
00263
00264
00265 using surfaceRegistry::write;
00266
00267
00268 static void write(const fileName&, const surfMesh&);
00269
00270
00271 void write(const fileName&);
00272
00273
00274
00275
00276 Xfer< MeshedSurface<face> > xfer();
00277
00278
00279 void clearGeom();
00280
00281
00282 void clearAddressing();
00283
00284
00285 void clearOut();
00286
00287
00288 void clearPrimitives();
00289
00290
00291 void removeFiles(const fileName& instanceDir) const;
00292
00293
00294 void removeFiles() const;
00295 };
00296
00297
00298
00299 }
00300
00301
00302
00303 #endif
00304
00305
Copyright © 2000-2009 OpenCFD Ltd