BUG: UListIO: byteSize overflowing on really big faceLists
[OpenFOAM-2.0.x.git] / src / finiteVolume / fvMesh / extendedStencil / cellToFace / extendedCellToFaceStencil.H
blobdd6d2f01a682dd580c591796a6842ff0b7674ccc
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 2011 OpenFOAM Foundation
6      \\/     M anipulation  |
7 -------------------------------------------------------------------------------
8 License
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
19     for more details.
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/>.
24 Class
25     Foam::extendedCellToFaceStencil
27 Description
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
32     is
33     - cells first
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
38     single field
39     - (parallel) distribute the field
40     - sum the weights*field.
42 SourceFiles
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 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
57 namespace Foam
60 class globalIndex;
62 /*---------------------------------------------------------------------------*\
63                   Class extendedCellToFaceStencil Declaration
64 \*---------------------------------------------------------------------------*/
66 class extendedCellToFaceStencil
68 protected:
70     // Protected data
72         const polyMesh& mesh_;
75 protected:
77         //- Write some statistics about stencil
78         static void writeStencilStats
79         (
80             Ostream& os,
81             const labelListList& stencil,
82             const mapDistribute& map
83         );
85 public:
87     // Declare name of the class and its debug switch
88     ClassName("extendedCellToFaceStencil");
91     // Constructors
93         //- Construct from mesh
94         explicit extendedCellToFaceStencil(const polyMesh&);
97     // Member Functions
99         //- Use map to get the data into stencil order
100         template<class T>
101         static void collectData
102         (
103             const mapDistribute& map,
104             const labelListList& stencil,
105             const GeometricField<T, fvPatchField, volMesh>& fld,
106             List<List<T> >& stencilFld
107         );
109         //- Sum vol field contributions to create face values
110         template<class Type>
111         static tmp<GeometricField<Type, fvsPatchField, surfaceMesh> >
112         weightedSum
113         (
114             const mapDistribute& map,
115             const labelListList& stencil,
116             const GeometricField<Type, fvPatchField, volMesh>& fld,
117             const List<List<scalar> >& stencilWeights
118         );
122 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
124 } // End namespace Foam
126 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
128 #ifdef NoRepository
129 #   include "extendedCellToFaceStencilTemplates.C"
130 #endif
132 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
134 #endif
136 // ************************************************************************* //