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
29 Does averaging of fields over layers of cells. Assumes layered mesh.
34 \*---------------------------------------------------------------------------*/
36 #ifndef channelIndex_H
37 #define channelIndex_H
39 #include <meshTools/regionSplit.H>
40 #include <OpenFOAM/direction.H>
41 #include <OpenFOAM/scalarField.H>
42 #include <OpenFOAM/polyMesh.H>
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
50 /*---------------------------------------------------------------------------*\
51 Class channelIndex Declaration
52 \*---------------------------------------------------------------------------*/
59 static const NamedEnum<vector::components, 3> vectorComponentsNames_;
62 const bool symmetric_;
67 //- Per cell the global region
68 autoPtr<regionSplit> cellRegion_;
70 //- Per global region the number of cells (scalarField so we can use
72 scalarField regionCount_;
74 //- From sorted region back to unsorted global region
77 //- Sorted component of cell centres
82 // Private Member Functions
84 void walkOppositeFaces
87 const labelList& startFaces,
91 void calcLayeredRegions
94 const labelList& startFaces
97 //- Disallow default bitwise copy construct and assignment
98 channelIndex(const channelIndex&);
99 void operator=(const channelIndex&);
106 //- Construct from dictionary
107 channelIndex(const polyMesh&, const dictionary&);
109 //- Construct from supplied starting faces
112 const polyMesh& mesh,
113 const labelList& startFaces,
114 const bool symmetric,
123 //- Sum field per region
125 Field<T> regionSum(const Field<T>& cellField) const;
127 //- collapse a field to a line
132 const bool asymmetric=false
135 //- return the field of Y locations from the cell centres
136 const scalarField& y() const
144 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
146 } // End namespace Foam
148 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
151 # include "channelIndexTemplates.C"
154 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
158 // ************************ vim: set sw=4 sts=4 et: ************************ //