Home
Downloads
Documentation
Installation
User Guide
man-pages
API Documentation
README
Release Notes
Changes
License
Support
SourceForge Project
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
applications
utilities
postProcessing
miscellaneous
postChannel
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) 1991-2010 OpenCFD Ltd.
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 <
meshTools/regionSplit.H
>
39
#include <
OpenFOAM/direction.H
>
40
#include <
OpenFOAM/scalarField.H
>
41
#include <
OpenFOAM/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
58
static
const
NamedEnum<vector::components, 3>
vectorComponentsNames_;
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
67
autoPtr<regionSplit>
cellRegion_;
68
69
//- Per global region the number of cells (scalarField so we can use
70
// field algebra)
71
scalarField
regionCount_;
72
73
//- From sorted region back to unsorted global region
74
labelList
sortMap_;
75
76
//- Sorted component of cell centres
77
scalarField
y_;
78
79
80
81
// Private Member Functions
82
83
void
walkOppositeFaces
84
(
85
const
polyMesh
&
mesh
,
86
const
labelList
& startFaces,
87
boolList
& blockedFace
88
);
89
90
void
calcLayeredRegions
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
109
channelIndex
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>
128
Field<T>
collapse
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
// ************************ vim: set sw=4 sts=4 et: ************************ //