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 topoSet_H
00039 #define topoSet_H
00040 
00041 #include <OpenFOAM/HashSet.H>
00042 #include <OpenFOAM/regIOobject.H>
00043 #include <OpenFOAM/labelList.H>
00044 #include <OpenFOAM/typeInfo.H>
00045 #include <OpenFOAM/autoPtr.H>
00046 #include <OpenFOAM/pointField.H>
00047 
00048 
00049 
00050 namespace Foam
00051 {
00052 
00053 
00054 class mapPolyMesh;
00055 class polyMesh;
00056 class primitiveMesh;
00057 
00058 
00059 
00060 
00061 
00062 class topoSet
00063 :
00064     public regIOobject,
00065     public labelHashSet
00066 {
00067 
00068 protected:
00069 
00070     
00071 
00072         
00073         
00074         void updateLabels(const labelList& map);
00075 
00076         
00077         void check(const label maxLabel);
00078 
00079         
00080         void writeDebug
00081         (
00082             Ostream& os,
00083             const label maxElem,
00084             topoSet::const_iterator& iter,
00085             label& elemI
00086         ) const;
00087 
00088         
00089         
00090         void writeDebug
00091         (
00092             Ostream& os,
00093             const pointField& coords,
00094             const label maxElem,
00095             topoSet::const_iterator& iter,
00096             label& elemI
00097         ) const;
00098 
00099         
00100         void writeDebug
00101         (
00102             Ostream& os,
00103             const pointField& coords,
00104             const label maxLen
00105         ) const;
00106 
00107 
00108         
00109         topoSet(const topoSet&);
00110 
00111 public:
00112 
00113     
00114     TypeName("topoSet");
00115 
00116 
00117     
00118 
00119         
00120         static fileName localPath(const polyMesh& mesh, const word& name);
00121 
00122 
00123     
00124 
00125         
00126         declareRunTimeSelectionTable
00127         (
00128             autoPtr,
00129             topoSet,
00130             word,
00131             (
00132                 const polyMesh& mesh,
00133                 const word& name,
00134                 readOption r,
00135                 writeOption w
00136             ),
00137             (mesh, name, r, w)
00138         );
00139 
00140         
00141         declareRunTimeSelectionTable
00142         (
00143             autoPtr,
00144             topoSet,
00145             size,
00146             (
00147                 const polyMesh& mesh,
00148                 const word& name,
00149                 const label size,
00150                 writeOption w
00151             ),
00152             (mesh, name, size, w)
00153         );
00154 
00155         
00156         declareRunTimeSelectionTable
00157         (
00158             autoPtr,
00159             topoSet,
00160             set,
00161             (
00162                 const polyMesh& mesh,
00163                 const word& name,
00164                 const topoSet& set,
00165                 writeOption w
00166             ),
00167             (mesh, name, set, w)
00168         );
00169 
00170 
00171     
00172 
00173 
00174         
00175         
00176         topoSet(const IOobject&, const word& wantedType);
00177 
00178         
00179         topoSet
00180         (
00181             const polyMesh& mesh,
00182             const word& wantedType,
00183             const word& name,
00184             readOption r=MUST_READ,
00185             writeOption w=NO_WRITE
00186         );
00187 
00188         
00189         topoSet
00190         (
00191             const polyMesh& mesh,
00192             const word& name,
00193             const label,
00194             writeOption w=NO_WRITE
00195         );
00196 
00197         
00198         topoSet
00199         (
00200             const polyMesh& mesh,
00201             const word& name,
00202             const labelHashSet&,
00203             writeOption w=NO_WRITE
00204         );
00205 
00206         
00207         topoSet(const IOobject&, const label size);
00208 
00209         
00210         topoSet(const IOobject&, const labelHashSet&);
00211 
00212 
00213 
00214         
00215         autoPtr<topoSet> clone() const
00216         {
00217             notImplemented("autoPtr<topoSet> clone() const");
00218             return autoPtr<topoSet>(NULL);
00219         }
00220 
00221 
00222     
00223 
00224         
00225         static autoPtr<topoSet> New
00226         (
00227             const word& setType,
00228             const polyMesh& mesh,
00229             const word& name,
00230             readOption r=MUST_READ,
00231             writeOption w=NO_WRITE
00232         );
00233 
00234         
00235         static autoPtr<topoSet> New
00236         (
00237             const word& setType,
00238             const polyMesh& mesh,
00239             const word& name,
00240             const label size,
00241             writeOption w=NO_WRITE
00242         );
00243 
00244         
00245         static autoPtr<topoSet> New
00246         (
00247             const word& setType,
00248             const polyMesh& mesh,
00249             const word& name,
00250             const topoSet& set,
00251             writeOption w=NO_WRITE
00252         );
00253 
00254 
00255     
00256 
00257         virtual ~topoSet();
00258 
00259 
00260     
00261 
00262         
00263         
00264         virtual void invert(const label maxLen);
00265 
00266         
00267         virtual void subset(const topoSet& set);
00268 
00269         
00270         virtual void addSet(const topoSet& set);
00271 
00272         
00273         virtual void deleteSet(const topoSet& set);
00274 
00275         
00276         virtual void sync(const polyMesh& mesh);
00277 
00278         
00279         virtual void writeDebug(Ostream& os, const label maxLen) const;
00280 
00281         
00282         
00283         virtual void writeDebug
00284         (
00285             Ostream& os,
00286             const primitiveMesh&,
00287             const label maxLen
00288         ) const;    
00289 
00290         
00291         virtual bool writeData(Ostream&) const;
00292 
00293         
00294         virtual void updateMesh(const mapPolyMesh& morphMap);
00295 
00296         
00297         virtual label maxSize(const polyMesh& mesh) const;  
00298 
00299 
00300 
00301     
00302 
00303         
00304         void operator=(const topoSet&);
00305 
00306 };
00307 
00308 
00309 
00310 
00311 } 
00312 
00313 
00314 
00315 #endif
00316 
00317