1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | foam-extend: Open Source CFD
4 \\ / O peration | Version: 3.2
5 \\ / A nd | Web: http://www.foam-extend.org
6 \\/ M anipulation | For copyright notice see file Copyright
7 -------------------------------------------------------------------------------
9 This file is part of foam-extend.
11 foam-extend 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 3 of the License, or (at your
14 option) any later version.
16 foam-extend is distributed in the hope that it will be useful, but
17 WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 General Public License for more details.
21 You should have received a copy of the GNU General Public License
22 along with foam-extend. If not, see <http://www.gnu.org/licenses/>.
28 Does averaging of fields over layers of cells. Assumes layered mesh.
33 \*---------------------------------------------------------------------------*/
35 #ifndef channelIndex_H
36 #define channelIndex_H
38 #include "regionSplit.H"
39 #include "direction.H"
40 #include "scalarField.H"
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
49 /*---------------------------------------------------------------------------*\
50 Class channelIndex Declaration
51 \*---------------------------------------------------------------------------*/
58 static const NamedEnum<vector::components, 3> vectorComponentsNames_;
61 const bool symmetric_;
66 //- Per cell the global region
67 autoPtr<regionSplit> cellRegion_;
69 //- Per global region the number of cells (scalarField so we can use
71 scalarField regionCount_;
73 //- From sorted region back to unsorted global region
76 //- Sorted component of cell centres
81 // Private Member Functions
83 void walkOppositeFaces
86 const labelList& startFaces,
90 void calcLayeredRegions
93 const labelList& startFaces
96 //- Disallow default bitwise copy construct and assignment
97 channelIndex(const channelIndex&);
98 void operator=(const channelIndex&);
105 //- Construct from dictionary
106 channelIndex(const polyMesh&, const dictionary&);
108 //- Construct from supplied starting faces
111 const polyMesh& mesh,
112 const labelList& startFaces,
113 const bool symmetric,
122 //- Sum field per region
124 Field<T> regionSum(const Field<T>& cellField) const;
126 //- collapse a field to a line
131 const bool asymmetric=false
134 //- return the field of Y locations from the cell centres
135 const scalarField& y() const
143 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
145 } // End namespace Foam
147 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
150 # include "channelIndexTemplates.C"
153 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
157 // ************************************************************************* //