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
mesh
conversion
cfx4ToFoam
hexBlock.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::hexBlock
26
27
Description
28
Hex block definition used in the cfx converter.
29
30
SourceFiles
31
hexBlock.C
32
33
\*---------------------------------------------------------------------------*/
34
35
#ifndef hexBlock_H
36
#define hexBlock_H
37
38
#include <
OpenFOAM/labelList.H
>
39
#include <
OpenFOAM/pointField.H
>
40
#include <
OpenFOAM/faceList.H
>
41
42
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43
44
namespace
Foam
45
{
46
47
/*---------------------------------------------------------------------------*\
48
Class hexBlock Declaration
49
\*---------------------------------------------------------------------------*/
50
51
class
hexBlock
52
{
53
// Private data
54
55
//- Handedness of the block
56
enum
handed
57
{
58
noPoints,
59
right,
60
left
61
};
62
63
//- Number of point in each direction
64
label xDim_;
65
label yDim_;
66
label zDim_;
67
68
//- Handedness of the block
69
handed blockHandedness_;
70
71
//- List of points
72
pointField
points_;
73
74
75
// Private Member Functions
76
77
//- Disallow default bitwise copy construct
78
hexBlock
(
const
hexBlock
&);
79
80
//- Disallow default bitwise assignment
81
void
operator=(
const
hexBlock
&);
82
83
//- Vertex addressing inside the block
84
inline
label vtxLabel(label i, label j, label
k
)
const
;
85
86
87
public
:
88
89
// Constructors
90
91
//- Construct from components
92
hexBlock
(
const
label nx,
const
label ny,
const
label nz);
93
94
// Member Functions
95
96
//- Number of points
97
label
xDim
()
const
98
{
99
return
xDim_;
100
}
101
102
label
yDim
()
const
103
{
104
return
yDim_;
105
}
106
107
label
zDim
()
const
108
{
109
return
zDim_;
110
}
111
112
label
nBlockPoints
()
const
113
{
114
return
(xDim_ + 1)*(yDim_ + 1)*(zDim_ + 1);
115
}
116
117
label
nBlockCells
()
const
118
{
119
return
xDim_*yDim_*zDim_;
120
}
121
122
//- Return block points
123
const
pointField
&
points
()
const
124
{
125
if
(blockHandedness_ == noPoints)
126
{
127
FatalErrorIn
(
"hexBlock::points() const"
)
128
<<
"points not read in yet"
129
<<
abort
(
FatalError
);
130
}
131
132
return
points_;
133
}
134
135
//- Return block cells
136
labelListList
blockCells
()
const
;
137
138
//- Return block patch faces given direction and range limits
139
// From the cfx manual: direction
140
// 0 = solid (3-D patch),
141
// 1 = high i, 2 = high j, 3 = high k
142
// 4 = low i, 5 = low j, 6 = low k
143
faceList
patchFaces
(label direc,
const
labelList
& range)
const
;
144
145
146
//- Read block points
147
void
readPoints
(
Istream
&);
148
};
149
150
151
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
152
153
}
// End namespace Foam
154
155
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
156
157
#endif
158
159
// ************************ vim: set sw=4 sts=4 et: ************************ //