FreeFOAM The Cross-Platform CFD Toolkit
Hosted by SourceForge:
Get FreeFOAM at SourceForge.net.
            Fast, secure and Free Open Source software downloads

faceZoneSet.H

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------------*\
00002   =========                 |
00003   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
00004    \\    /   O peration     |
00005     \\  /    A nd           | Copyright (C) 1991-2010 OpenCFD Ltd.
00006      \\/     M anipulation  |
00007 -------------------------------------------------------------------------------
00008 License
00009     This file is part of OpenFOAM.
00010 
00011     OpenFOAM is free software: you can redistribute it and/or modify it
00012     under the terms of the GNU General Public License as published by
00013     the Free Software Foundation, either version 3 of the License, or
00014     (at your option) any later version.
00015 
00016     OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
00017     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00018     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
00019     for more details.
00020 
00021     You should have received a copy of the GNU General Public License
00022     along with OpenFOAM.  If not, see <http://www.gnu.org/licenses/>.
00023 
00024 Class
00025     Foam::faceZoneSet
00026 
00027 Description
00028     Like faceSet but updates faceZone when writing.
00029 
00030 SourceFiles
00031     faceZone.C
00032 
00033 \*---------------------------------------------------------------------------*/
00034 
00035 #ifndef faceZoneSet_H
00036 #define faceZoneSet_H
00037 
00038 #include "faceSet.H"
00039 #include <OpenFOAM/boolList.H>
00040 
00041 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00042 
00043 namespace Foam
00044 {
00045 
00046 /*---------------------------------------------------------------------------*\
00047                            Class faceZoneSet Declaration
00048 \*---------------------------------------------------------------------------*/
00049 
00050 class faceZoneSet
00051 :
00052     public faceSet
00053 {
00054     // Private data
00055 
00056         const polyMesh& mesh_;
00057 
00058         labelList addressing_;
00059 
00060         boolList flipMap_;
00061 
00062    // Private Member Functions
00063 
00064 
00065 public:
00066 
00067     //- Runtime type information
00068     TypeName("faceZoneSet");
00069 
00070 
00071     // Constructors
00072 
00073         //- Construct from objectRegistry and name
00074         faceZoneSet
00075         (
00076             const polyMesh& mesh,
00077             const word& name,
00078             readOption r=MUST_READ,
00079             writeOption w=NO_WRITE
00080         );
00081 
00082         //- Construct from additional size of labelHashSet
00083         faceZoneSet
00084         (
00085             const polyMesh& mesh,
00086             const word& name,
00087             const label,
00088             writeOption w=NO_WRITE
00089         );
00090 
00091         //- Construct from existing set
00092         faceZoneSet
00093         (
00094             const polyMesh& mesh,
00095             const word& name,
00096             const topoSet&,
00097             writeOption w=NO_WRITE
00098         );
00099 
00100 
00101 
00102     // Destructor
00103 
00104         virtual ~faceZoneSet();
00105 
00106 
00107     // Member functions
00108 
00109         const labelList& addressing() const
00110         {
00111             return addressing_;
00112         }
00113 
00114         labelList& addressing()
00115         {
00116             return addressing_;
00117         }
00118 
00119 
00120         const boolList& flipMap() const
00121         {
00122             return flipMap_;
00123         }
00124 
00125         boolList& flipMap()
00126         {
00127             return flipMap_;
00128         }
00129 
00130 
00131         //- Sort addressing and make faceSet part consistent with addressing
00132         void updateSet();
00133 
00134         //- Invert contents. (insert all members 0..maxLen-1 which were not in
00135         //  set)
00136         virtual void invert(const label maxLen);
00137 
00138         //- Subset contents. Only elements present in both sets remain.
00139         virtual void subset(const topoSet& set);
00140 
00141         //- Add elements present in set.
00142         virtual void addSet(const topoSet& set);
00143 
00144         //- Delete elements present in set.
00145         virtual void deleteSet(const topoSet& set);
00146 
00147         //- Sync faceZoneSet across coupled patches.
00148         virtual void sync(const polyMesh& mesh);
00149 
00150         //- Write maxLen items with label and coordinates.
00151         virtual void writeDebug
00152         (
00153             Ostream& os,
00154             const primitiveMesh&,
00155             const label maxLen
00156         ) const;
00157 
00158         //- Write faceZone
00159         virtual bool writeObject
00160         (
00161             IOstream::streamFormat,
00162             IOstream::versionNumber,
00163             IOstream::compressionType
00164         ) const;
00165 
00166         //- Update any stored data for new labels
00167         virtual void updateMesh(const mapPolyMesh& morphMap);
00168 
00169         //- Return max index+1.
00170         virtual label maxSize(const polyMesh& mesh) const;
00171 
00172 
00173 
00174 
00175 };
00176 
00177 
00178 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00179 
00180 } // End namespace Foam
00181 
00182 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00183 
00184 #endif
00185 
00186 // ************************ vim: set sw=4 sts=4 et: ************************ //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines