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::cellToCellStencil 00026 00027 Description 00028 baseclass for extended cell centred addressing. Contains per cell a 00029 list of neighbouring cells and/or boundaryfaces in global addressing. 00030 00031 SourceFiles 00032 cellToCellStencil.C 00033 00034 \*---------------------------------------------------------------------------*/ 00035 00036 #ifndef cellToCellStencil_H 00037 #define cellToCellStencil_H 00038 00039 #include <OpenFOAM/globalIndex.H> 00040 #include <OpenFOAM/boolList.H> 00041 #include <OpenFOAM/HashSet.H> 00042 #include <OpenFOAM/indirectPrimitivePatch.H> 00043 00044 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00045 00046 namespace Foam 00047 { 00048 00049 class polyMesh; 00050 00051 /*---------------------------------------------------------------------------*\ 00052 Class cellToCellStencil Declaration 00053 \*---------------------------------------------------------------------------*/ 00054 00055 class cellToCellStencil 00056 : 00057 public labelListList 00058 { 00059 // Private data 00060 00061 const polyMesh& mesh_; 00062 00063 //- Global numbering for cells and boundary faces 00064 const globalIndex globalNumbering_; 00065 00066 00067 // Private Member Functions 00068 00069 //- Disallow default bitwise assignment 00070 void operator=(const cellToCellStencil&); 00071 00072 00073 protected: 00074 00075 //- Merge two lists. 00076 static void merge 00077 ( 00078 const label, 00079 const label, 00080 const labelList&, 00081 labelList& 00082 ); 00083 00084 //- Merge two lists. 00085 static void merge(const label, const labelList&, labelList&); 00086 00087 //- Valid boundary faces (not empty and not coupled) 00088 void validBoundaryFaces(boolList& isValidBFace) const; 00089 00090 //- Return patch of all coupled faces. 00091 autoPtr<indirectPrimitivePatch> allCoupledFacesPatch() const; 00092 00093 //- Combine operator for labelLists 00094 class unionEqOp 00095 { 00096 public: 00097 void operator()( labelList& x, const labelList& y ) const; 00098 }; 00099 00100 //- Collect cell neighbours of faces in global numbering 00101 void insertFaceCells 00102 ( 00103 const label exclude0, 00104 const label exclude1, 00105 const boolList& nonEmptyFace, 00106 const labelList& faceLabels, 00107 labelHashSet& globals 00108 ) const; 00109 00110 //- Collect cell neighbours of faces in global numbering 00111 labelList calcFaceCells 00112 ( 00113 const boolList& nonEmptyFace, 00114 const labelList& faceLabels, 00115 labelHashSet& globals 00116 ) const; 00117 00118 00119 public: 00120 00121 // Constructors 00122 00123 //- Construct from mesh 00124 explicit cellToCellStencil(const polyMesh&); 00125 00126 00127 // Member Functions 00128 00129 const polyMesh& mesh() const 00130 { 00131 return mesh_; 00132 } 00133 00134 //- Global numbering for cells and boundary faces 00135 const globalIndex& globalNumbering() const 00136 { 00137 return globalNumbering_; 00138 } 00139 00140 }; 00141 00142 00143 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00144 00145 } // End namespace Foam 00146 00147 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00148 00149 #endif 00150 00151 // ************************ vim: set sw=4 sts=4 et: ************************ //