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
dataConversion
foamToVTK
vtkMesh.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::vtkMesh
26
27
Description
28
Encapsulation of VTK mesh data. Holds mesh or meshsubset and
29
polyhedral-cell decomposition on it.
30
31
SourceFiles
32
vtkMesh.C
33
34
\*---------------------------------------------------------------------------*/
35
36
#ifndef vtkMesh_H
37
#define vtkMesh_H
38
39
#include "
vtkTopo.H
"
40
#include <
finiteVolume/fvMeshSubset.H
>
41
42
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43
44
namespace
Foam
45
{
46
47
// Forward declaration of classes
48
class
Time;
49
50
/*---------------------------------------------------------------------------*\
51
Class vtkMesh Declaration
52
\*---------------------------------------------------------------------------*/
53
54
class
vtkMesh
55
{
56
// Private data
57
58
//- Reference to mesh
59
fvMesh
& baseMesh_;
60
61
//- Subsetting engine + sub-fvMesh
62
fvMeshSubset
subsetter_;
63
64
//- Current cellSet (or empty)
65
const
word
setName_;
66
67
//- Current decomposition of topology
68
mutable
autoPtr<vtkTopo>
topoPtr_;
69
70
71
72
// Private Member Functions
73
74
//- Disallow default bitwise copy construct
75
vtkMesh
(
const
vtkMesh
&);
76
77
//- Disallow default bitwise assignment
78
void
operator=(
const
vtkMesh
&);
79
80
81
public
:
82
83
// Constructors
84
85
//- Construct from components
86
vtkMesh
(
fvMesh
&
baseMesh
,
const
word
& setName =
""
);
87
88
89
// Member Functions
90
91
// Access
92
93
//- whole mesh
94
const
fvMesh
&
baseMesh
()
const
95
{
96
return
baseMesh_;
97
}
98
99
const
fvMeshSubset
&
subsetter
()
const
100
{
101
return
subsetter_;
102
}
103
104
//- Check if running subMesh
105
bool
useSubMesh
()
const
106
{
107
return
setName_.size();
108
}
109
110
//- topology
111
const
vtkTopo
&
topo
()
const
112
{
113
if
(topoPtr_.
empty
())
114
{
115
topoPtr_.
reset
(
new
vtkTopo
(
mesh
()));
116
}
117
return
topoPtr_();
118
}
119
120
//- Access either mesh or submesh
121
const
fvMesh
&
mesh
()
const
122
{
123
if
(
useSubMesh
())
124
{
125
return
subsetter_.
subMesh
();
126
}
127
else
128
{
129
return
baseMesh_;
130
}
131
}
132
133
//- Number of field cells
134
label
nFieldCells
()
const
135
{
136
return
topo
().
cellTypes
().
size
();
137
}
138
139
//- Number of field points
140
label
nFieldPoints
()
const
141
{
142
return
mesh
().
nPoints
() +
topo
().
addPointCellLabels
().
size
();
143
}
144
145
146
// Edit
147
148
//- Read mesh
149
polyMesh::readUpdateState
readUpdate
();
150
151
152
//- Map volume field (does in fact do very little interpolation;
153
// just copied from fvMeshSubset)
154
template
<
class
GeoField>
155
tmp<GeoField>
interpolate
(
const
GeoField& fld)
const
156
{
157
if
(
useSubMesh
())
158
{
159
tmp<GeoField>
subFld = subsetter_.
interpolate
(fld);
160
subFld().rename(fld.name());
161
return
subFld;
162
}
163
else
164
{
165
return
fld;
166
}
167
}
168
};
169
170
171
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
172
173
}
// End namespace Foam
174
175
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
176
177
#endif
178
179
// ************************ vim: set sw=4 sts=4 et: ************************ //