![]() |
|
00001 /*---------------------------------------------------------------------------*\ 00002 ========= | 00003 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox 00004 \\ / O peration | 00005 \\ / A nd | Copyright (C) 1991-2005 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 the 00013 Free Software Foundation; either version 2 of the License, or (at your 00014 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, write to the Free Software Foundation, 00023 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 00024 00025 Class 00026 polyBoundaryMesh 00027 00028 Description 00029 00030 SourceFiles 00031 polyBoundaryMesh.C 00032 00033 \*---------------------------------------------------------------------------*/ 00034 00035 #ifndef polyBoundaryMesh_H 00036 #define polyBoundaryMesh_H 00037 00038 #include "polyPatchList.H" 00039 #include "regIOobject.H" 00040 #include "labelPair.H" 00041 00042 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00043 00044 namespace Foam 00045 { 00046 00047 typedef List<labelPair> labelPairList; 00048 00049 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00050 00051 class polyMesh; 00052 00053 /*---------------------------------------------------------------------------*\ 00054 Class polyBoundaryMesh Declaration 00055 \*---------------------------------------------------------------------------*/ 00056 00057 class polyBoundaryMesh 00058 : 00059 public polyPatchList, 00060 public regIOobject 00061 { 00062 // private data 00063 00064 //- Reference to mesh 00065 const polyMesh& mesh_; 00066 00067 //- Edges of neighbouring patches 00068 mutable List<labelPairList>* neighbourEdgesPtr_; 00069 00070 00071 // Private Member Functions 00072 00073 //- Create identity map 00074 static labelList ident(const label len); 00075 00076 //- Disallow construct as copy 00077 polyBoundaryMesh(const polyBoundaryMesh&); 00078 00079 //- Disallow assignment 00080 void operator=(const polyBoundaryMesh&); 00081 00082 00083 public: 00084 00085 //- Runtime type information 00086 TypeName("polyBoundaryMesh"); 00087 00088 00089 // Constructors 00090 00091 //- Read constructor given IOobject and a polyMesh reference 00092 // Note point pointers are unset, only used in copying meshes 00093 polyBoundaryMesh 00094 ( 00095 const IOobject&, 00096 const polyMesh& 00097 ); 00098 00099 //- Construct given size 00100 polyBoundaryMesh 00101 ( 00102 const IOobject&, 00103 const polyMesh&, 00104 const label size 00105 ); 00106 00107 00108 // Destructor 00109 00110 ~polyBoundaryMesh(); 00111 00112 //- Clear geometry at this level and at patches 00113 void clearGeom(); 00114 00115 //- Clear addressing at this level and at patches 00116 void clearAddressing(); 00117 00118 00119 // Member functions 00120 00121 //- Calculate the geometry for the patches (transformation tensors etc.) 00122 void calcGeometry(); 00123 00124 //- Return the mesh reference 00125 const polyMesh& mesh() const 00126 { 00127 return mesh_; 00128 } 00129 00130 //- Per patch the edges on the neighbouring patch. Is for every external 00131 // edge the neighbouring patch and neighbouring (external) patch edge 00132 // label. Note that edge indices are offset by nInternalEdges to keep 00133 // it as much as possible consistent with coupled patch addressing 00134 // (where coupling is by local patch face index). 00135 // Only valid for singly connected polyBoundaryMesh and not parallel 00136 const List<labelPairList>& neighbourEdges() const; 00137 00138 //- Return a list of patch names 00139 wordList names() const; 00140 00141 //- Return a list of patch types 00142 wordList types() const; 00143 00144 //- Return a list of physical types 00145 wordList physicalTypes() const; 00146 00147 //- Find patch index given a name 00148 label findPatchID(const word& patchName) const; 00149 00150 //- Return patch index for a given face label 00151 label whichPatch(const label faceIndex) const; 00152 00153 //- Check boundary definition 00154 bool checkDefinition(const bool report = false) const; 00155 00156 //- Correct polyBoundaryMesh after moving points 00157 void movePoints(const pointField&); 00158 00159 //- Correct polyBoundaryMesh after topology update 00160 void updateMesh(); 00161 00162 //- writeData member function required by regIOobject 00163 bool writeData(Ostream&) const; 00164 00165 //- Write using given format, version and form uncompression 00166 bool write 00167 ( 00168 IOstream::streamFormat fmt, 00169 IOstream::versionNumber ver, 00170 IOstream::compressionType cmp 00171 ) const; 00172 00173 00174 // Ostream operator 00175 00176 friend Ostream& operator<<(Ostream&, const polyBoundaryMesh&); 00177 }; 00178 00179 00180 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00181 00182 } // End namespace Foam 00183 00184 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00185 00186 #endif 00187 00188 // ************************************************************************* //