channelIndex.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
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.
15 
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.
20 
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/>.
23 
24 Class
25  Foam::channelIndex
26 
27 Description
28  Does averaging of fields over layers of cells. Assumes layered mesh.
29 
30 SourceFiles
31  channelIndex.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef channelIndex_H
36 #define channelIndex_H
37 
38 #include "regionSplit.H"
39 #include "direction.H"
40 #include "scalarField.H"
41 #include "polyMesh.H"
42 
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44 
45 namespace Foam
46 {
47 
48 
49 /*---------------------------------------------------------------------------*\
50  Class channelIndex Declaration
51 \*---------------------------------------------------------------------------*/
52 
53 class channelIndex
54 {
55 
56  // Private data
57 
59 
60  //- Is mesh symmetric
61  const bool symmetric_;
62 
63  //- Direction to sort
64  const direction dir_;
65 
66  //- Per cell the global region
68 
69  //- Per global region the number of cells (scalarField so we can use
70  // field algebra)
72 
73  //- From sorted region back to unsorted global region
75 
76  //- Sorted component of cell centres
78 
79 
80 
81  // Private Member Functions
82 
84  (
85  const polyMesh& mesh,
86  const labelList& startFaces,
87  boolList& blockedFace
88  );
89 
91  (
92  const polyMesh& mesh,
93  const labelList& startFaces
94  );
95 
96  //- Disallow default bitwise copy construct and assignment
97  channelIndex(const channelIndex&);
98  void operator=(const channelIndex&);
99 
100 
101 public:
102 
103  // Constructors
104 
105  //- Construct from dictionary
106  channelIndex(const polyMesh&, const dictionary&);
107 
108  //- Construct from supplied starting faces
110  (
111  const polyMesh& mesh,
112  const labelList& startFaces,
113  const bool symmetric,
114  const direction dir
115  );
116 
117 
118  // Member Functions
119 
120  // Access
121 
122  //- Sum field per region
123  template<class T>
124  Field<T> regionSum(const Field<T>& cellField) const;
125 
126  //- Collapse a field to a line
127  template<class T>
129  (
130  const Field<T>& vsf,
131  const bool asymmetric=false
132  ) const;
133 
134  //- Return the field of Y locations from the cell centres
135  const scalarField& y() const
136  {
137  return y_;
138  }
139 
140 };
141 
142 
143 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
144 
145 } // End namespace Foam
146 
147 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
148 
149 #ifdef NoRepository
150  #include "channelIndexTemplates.C"
151 #endif
152 
153 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
154 
155 #endif
156 
157 // ************************************************************************* //
Foam::channelIndex
Does averaging of fields over layers of cells. Assumes layered mesh.
Definition: channelIndex.H:52
scalarField.H
Foam::channelIndex::operator=
void operator=(const channelIndex &)
Foam::channelIndex::regionCount_
scalarField regionCount_
Per global region the number of cells (scalarField so we can use.
Definition: channelIndex.H:70
polyMesh.H
Foam::polyMesh
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:74
Foam::channelIndex::collapse
Field< T > collapse(const Field< T > &vsf, const bool asymmetric=false) const
Collapse a field to a line.
channelIndexTemplates.C
Foam::Field
Pre-declare SubField and related Field type.
Definition: Field.H:57
Foam::channelIndex::channelIndex
channelIndex(const channelIndex &)
Disallow default bitwise copy construct and assignment.
regionSplit.H
Foam::channelIndex::cellRegion_
autoPtr< regionSplit > cellRegion_
Per cell the global region.
Definition: channelIndex.H:66
Foam::dictionary
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:137
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:18
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::channelIndex::y
const scalarField & y() const
Return the field of Y locations from the cell centres.
Definition: channelIndex.H:134
direction.H
Direction is an integer type used to represent the Cartesian directions etc. Currently it is a typede...
Foam::channelIndex::y_
scalarField y_
Sorted component of cell centres.
Definition: channelIndex.H:76
Foam::autoPtr
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:117
Foam::channelIndex::sortMap_
labelList sortMap_
From sorted region back to unsorted global region.
Definition: channelIndex.H:73
Foam::List
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: HashTable.H:59
Foam::channelIndex::symmetric_
const bool symmetric_
Is mesh symmetric.
Definition: channelIndex.H:60
Foam::channelIndex::vectorComponentsNames_
static const NamedEnum< vector::components, 3 > vectorComponentsNames_
Definition: channelIndex.H:57
Foam::direction
unsigned char direction
Definition: direction.H:43
Foam::channelIndex::calcLayeredRegions
void calcLayeredRegions(const polyMesh &mesh, const labelList &startFaces)
Foam::NamedEnum< vector::components, 3 >
Foam::channelIndex::regionSum
Field< T > regionSum(const Field< T > &cellField) const
Sum field per region.
Foam::channelIndex::walkOppositeFaces
void walkOppositeFaces(const polyMesh &mesh, const labelList &startFaces, boolList &blockedFace)
Foam::channelIndex::dir_
const direction dir_
Direction to sort.
Definition: channelIndex.H:63