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