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