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::cellZoneSet 00026 00027 Description 00028 Like cellSet but updates cellZone when writing. 00029 00030 SourceFiles 00031 cellZone.C 00032 00033 \*---------------------------------------------------------------------------*/ 00034 00035 #ifndef cellZoneSet_H 00036 #define cellZoneSet_H 00037 00038 #include "cellSet.H" 00039 #include <OpenFOAM/boolList.H> 00040 00041 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00042 00043 namespace Foam 00044 { 00045 00046 /*---------------------------------------------------------------------------*\ 00047 Class cellZoneSet Declaration 00048 \*---------------------------------------------------------------------------*/ 00049 00050 class cellZoneSet 00051 : 00052 public cellSet 00053 { 00054 // Private data 00055 00056 const polyMesh& mesh_; 00057 00058 labelList addressing_; 00059 00060 public: 00061 00062 //- Runtime type information 00063 TypeName("cellZoneSet"); 00064 00065 00066 // Constructors 00067 00068 //- Construct from objectRegistry and name 00069 cellZoneSet 00070 ( 00071 const polyMesh& mesh, 00072 const word& name, 00073 readOption r=MUST_READ, 00074 writeOption w=NO_WRITE 00075 ); 00076 00077 //- Construct from additional size of labelHashSet 00078 cellZoneSet 00079 ( 00080 const polyMesh& mesh, 00081 const word& name, 00082 const label, 00083 writeOption w=NO_WRITE 00084 ); 00085 00086 //- Construct from existing set 00087 cellZoneSet 00088 ( 00089 const polyMesh& mesh, 00090 const word& name, 00091 const topoSet&, 00092 writeOption w=NO_WRITE 00093 ); 00094 00095 00096 00097 // Destructor 00098 00099 virtual ~cellZoneSet(); 00100 00101 00102 // Member functions 00103 00104 const labelList& addressing() const 00105 { 00106 return addressing_; 00107 } 00108 00109 labelList& addressing() 00110 { 00111 return addressing_; 00112 } 00113 00114 //- Sort addressing and make cellSet part consistent with addressing 00115 void updateSet(); 00116 00117 //- Invert contents. (insert all members 0..maxLen-1 which were not in 00118 // set) 00119 virtual void invert(const label maxLen); 00120 00121 //- Subset contents. Only elements present in both sets remain. 00122 virtual void subset(const topoSet& set); 00123 00124 //- Add elements present in set. 00125 virtual void addSet(const topoSet& set); 00126 00127 //- Delete elements present in set. 00128 virtual void deleteSet(const topoSet& set); 00129 00130 //- Sync cellZoneSet across coupled patches. 00131 virtual void sync(const polyMesh& mesh); 00132 00133 //- Write maxLen items with label and coordinates. 00134 virtual void writeDebug 00135 ( 00136 Ostream& os, 00137 const primitiveMesh&, 00138 const label maxLen 00139 ) const; 00140 00141 //- Write cellZone 00142 virtual bool writeObject 00143 ( 00144 IOstream::streamFormat, 00145 IOstream::versionNumber, 00146 IOstream::compressionType 00147 ) const; 00148 00149 //- Update any stored data for new labels 00150 virtual void updateMesh(const mapPolyMesh& morphMap); 00151 00152 //- Return max index+1. 00153 virtual label maxSize(const polyMesh& mesh) const; 00154 00155 00156 00157 00158 }; 00159 00160 00161 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00162 00163 } // End namespace Foam 00164 00165 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00166 00167 #endif 00168 00169 // ************************ vim: set sw=4 sts=4 et: ************************ //