1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
7 -------------------------------------------------------------------------------
9 This file is part of OpenFOAM.
11 OpenFOAM is free software; you can redistribute it and/or modify it
12 under the terms of the GNU General Public License as published by the
13 Free Software Foundation; either version 2 of the License, or (at your
14 option) any later version.
16 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 You should have received a copy of the GNU General Public License
22 along with OpenFOAM; if not, write to the Free Software Foundation,
23 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
26 Foam::extendedCellToFaceStencil
29 Calculates/constains the extended cell-to-face stencil.
31 The stencil is a list of indices into either cells or boundary faces
32 in a compact way. (element 0 is owner, 1 is neighbour). The index numbering
35 - then all (non-empty patch) boundary faces
37 When used in evaluation is a two stage process:
38 - collect the data (cell data and non-empty boundaries) into a
40 - (parallel) distribute the field
41 - sum the weights*field.
44 extendedCellToFaceStencil.C
45 extendedCellToFaceStencilTemplates.C
47 \*---------------------------------------------------------------------------*/
49 #ifndef extendedCellToFaceStencil_H
50 #define extendedCellToFaceStencil_H
52 #include "mapDistribute.H"
53 #include "volFields.H"
54 #include "surfaceFields.H"
56 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
63 /*---------------------------------------------------------------------------*\
64 Class extendedCellToFaceStencil Declaration
65 \*---------------------------------------------------------------------------*/
67 class extendedCellToFaceStencil
73 const polyMesh& mesh_;
76 // Protected Member Functions
82 // Private Member Functions
84 //- Disallow default bitwise copy construct
85 extendedCellToFaceStencil(const extendedCellToFaceStencil&);
87 //- Disallow default bitwise assignment
88 void operator=(const extendedCellToFaceStencil&);
93 //- Write some statistics about stencil
94 static void writeStencilStats
97 const labelListList& stencil,
98 const mapDistribute& map
103 // Declare name of the class and its debug switch
104 ClassName("extendedCellToFaceStencil");
109 //- Construct from mesh
110 explicit extendedCellToFaceStencil(const polyMesh&);
115 //- Calculate distribute map
116 static autoPtr<mapDistribute> calcDistributeMap
118 const polyMesh& mesh,
119 const globalIndex& globalNumbering,
120 labelListList& faceStencil
123 //- Use map to get the data into stencil order
125 static void collectData
127 const mapDistribute& map,
128 const labelListList& stencil,
129 const GeometricField<T, fvPatchField, volMesh>& fld,
130 List<List<T> >& stencilFld
133 //- Sum vol field contributions to create face values
135 static tmp<GeometricField<Type, fvsPatchField, surfaceMesh> >
138 const mapDistribute& map,
139 const labelListList& stencil,
140 const GeometricField<Type, fvPatchField, volMesh>& fld,
141 const List<List<scalar> >& stencilWeights
146 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
148 } // End namespace Foam
150 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
153 # include "extendedCellToFaceStencilTemplates.C"
156 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
160 // ************************************************************************* //