1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
7 -------------------------------------------------------------------------------
9 This file is part of OpenFOAM.
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 the
13 Free Software Foundation; either version 2 of the License, or (at your
14 option) any later version.
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
21 You should have received a copy of the GNU General Public License
22 along with OpenFOAM; if not, write to the Free Software Foundation,
23 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
29 Encapsulation of VTK mesh data. Holds mesh or meshsubset and
30 polyhedral-cell decomposition on it.
35 \*---------------------------------------------------------------------------*/
41 #include "fvMeshSubset.H"
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
48 // Forward declaration of classes
51 /*---------------------------------------------------------------------------*\
52 Class vtkMesh Declaration
53 \*---------------------------------------------------------------------------*/
62 //- Subsetting engine + sub-fvMesh
63 fvMeshSubset subsetter_;
65 //- Current cellSet (or empty)
68 //- Current decomposition of topology
69 mutable autoPtr<vtkTopo> topoPtr_;
73 // Private Member Functions
75 //- Disallow default bitwise copy construct
76 vtkMesh(const vtkMesh&);
78 //- Disallow default bitwise assignment
79 void operator=(const vtkMesh&);
86 //- Construct from components
87 vtkMesh(fvMesh& baseMesh, const word& setName = "");
95 const fvMesh& baseMesh() const
100 const fvMeshSubset& subsetter() const
105 //- Check if running subMesh
106 bool useSubMesh() const
108 return setName_.size();
112 const vtkTopo& topo() const
114 if (topoPtr_.empty())
116 topoPtr_.reset(new vtkTopo(mesh()));
121 //- Access either mesh or submesh
122 const fvMesh& mesh() const
126 return subsetter_.subMesh();
134 //- Number of field cells
135 label nFieldCells() const
137 return topo().cellTypes().size();
140 //- Number of field points
141 label nFieldPoints() const
143 return mesh().nPoints() + topo().addPointCellLabels().size();
150 polyMesh::readUpdateState readUpdate();
153 //- Map volume field (does in fact do very little interpolation;
154 // just copied from fvMeshSubset)
155 template<class GeoField>
156 tmp<GeoField> interpolate(const GeoField& fld) const
160 tmp<GeoField> subFld = subsetter_.interpolate(fld);
161 subFld().rename(fld.name());
172 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
174 } // End namespace Foam
176 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
180 // ************************************************************************* //