1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
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
13 the Free Software Foundation, either version 3 of the License, or
14 (at your 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, see <http://www.gnu.org/licenses/>.
25 Foam::extendedCellToFaceStencil
28 Calculates/constains the extended cell-to-face stencil.
30 The stencil is a list of indices into either cells or boundary faces
31 in a compact way. (element 0 is owner, 1 is neighbour). The index numbering
34 - then all (non-empty patch) boundary faces
36 When used in evaluation is a two stage process:
37 - collect the data (cell data and non-empty boundaries) into a
39 - (parallel) distribute the field
40 - sum the weights*field.
43 extendedCellToFaceStencil.C
44 extendedCellToFaceStencilTemplates.C
46 \*---------------------------------------------------------------------------*/
48 #ifndef extendedCellToFaceStencil_H
49 #define extendedCellToFaceStencil_H
51 #include "mapDistribute.H"
52 #include "volFields.H"
53 #include "surfaceFields.H"
55 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
62 /*---------------------------------------------------------------------------*\
63 Class extendedCellToFaceStencil Declaration
64 \*---------------------------------------------------------------------------*/
66 class extendedCellToFaceStencil
72 const polyMesh& mesh_;
77 //- Write some statistics about stencil
78 static void writeStencilStats
81 const labelListList& stencil,
82 const mapDistribute& map
87 // Declare name of the class and its debug switch
88 ClassName("extendedCellToFaceStencil");
93 //- Construct from mesh
94 explicit extendedCellToFaceStencil(const polyMesh&);
99 //- Use map to get the data into stencil order
101 static void collectData
103 const mapDistribute& map,
104 const labelListList& stencil,
105 const GeometricField<T, fvPatchField, volMesh>& fld,
106 List<List<T> >& stencilFld
109 //- Sum vol field contributions to create face values
111 static tmp<GeometricField<Type, fvsPatchField, surfaceMesh> >
114 const mapDistribute& map,
115 const labelListList& stencil,
116 const GeometricField<Type, fvPatchField, volMesh>& fld,
117 const List<List<scalar> >& stencilWeights
122 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
124 } // End namespace Foam
126 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
129 # include "extendedCellToFaceStencilTemplates.C"
132 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
136 // ************************************************************************* //