1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright held by original author
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 fvMeshSubset subsetMesh_;
64 //- Current cellSet (or empty)
67 //- Current decomposition of topology
68 mutable autoPtr<vtkTopo> topoPtr_;
72 // Private Member Functions
74 //- Disallow default bitwise copy construct
75 vtkMesh(const vtkMesh&);
77 //- Disallow default bitwise assignment
78 void operator=(const vtkMesh&);
85 //- Construct from components
86 vtkMesh(const IOobject& io, const word& setName = "");
98 const fvMeshSubset& subsetMesh() const
103 //- Check if running subMesh
104 bool useSubMesh() const
106 return setName_.size();
110 const vtkTopo& topo() const
112 if (topoPtr_.empty())
114 topoPtr_.reset(new vtkTopo(mesh()));
119 //- Access either mesh or submesh
120 const fvMesh& mesh() const
124 return subsetMesh_.subMesh();
132 //- Access either pointMesh of base or pointMesh of subset
133 const pointMesh& pMesh() const
137 return pointMesh::New(subsetMesh_.subMesh());
141 return pointMesh::New(*this);
145 //- Number of field cells
146 label nFieldCells() const
148 return topo().cellTypes().size();
151 //- Number of field points
152 label nFieldPoints() const
154 return mesh().nPoints() + topo().addPointCellLabels().size();
161 polyMesh::readUpdateState readUpdate();
164 //- Map volume field (does in fact do very little interpolation;
165 // just copied from fvMeshSubset)
166 template<class GeoField>
167 tmp<GeoField> interpolate(const GeoField& fld) const
171 tmp<GeoField> subFld = subsetMesh_.interpolate(fld);
172 subFld().rename(fld.name());
183 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
185 } // End namespace Foam
187 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
191 // ************************************************************************* //