foamVtkWriteTopoSet.C
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2018 OpenCFD Ltd.
9 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 \*---------------------------------------------------------------------------*/
27 
28 #include "foamVtkWriteTopoSet.H"
29 #include "polyMesh.H"
30 #include "topoSet.H"
31 #include "faceSet.H"
32 #include "cellSet.H"
33 #include "pointSet.H"
34 
35 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
36 
38 (
39  const polyMesh& mesh,
40  const topoSet& set,
41  const vtk::outputOptions opts,
42  const fileName& file,
43  bool parallel
44 )
45 {
46  if (isA<pointSet>(set))
47  {
48  return vtk::writePointSet
49  (
50  mesh,
51  dynamicCast<const pointSet&>(set),
52  opts,
53  file,
54  parallel
55  );
56  }
57  else if (isA<faceSet>(set))
58  {
59  return vtk::writeFaceSet
60  (
61  mesh,
62  dynamicCast<const faceSet&>(set),
63  opts,
64  file,
65  parallel
66  );
67  }
68  else if (isA<cellSet>(set))
69  {
71  (
72  mesh,
73  dynamicCast<const cellSet&>(set),
74  opts,
75  file,
76  parallel
77  );
78  }
79 
81  << "No VTK writer for '" << set.type() << "' topoSet" << nl << endl;
82 
83  return false;
84 }
85 
86 
87 // ************************************************************************* //
Foam::vtk::outputOptions
Encapsulated combinations of output format options. This is primarily useful when defining the output...
Definition: foamVtkOutputOptions.H:59
Foam::BitOps::set
void set(List< bool > &bools, const labelRange &range)
Set the specified range 'on' in a boolList.
Definition: BitOps.C:37
Foam::fileName
A class for handling file names.
Definition: fileName.H:69
topoSet.H
Foam::vtk::writeCellSetFaces
bool writeCellSetFaces(const polyMesh &mesh, const cellSet &set, const vtk::outputOptions opts, const fileName &file, bool parallel=Pstream::parRun())
Write perimeter faces of cellset to vtk polydata file.
Definition: foamVtkWriteCellSetFaces.C:37
Foam::endl
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:350
polyMesh.H
Foam::polyMesh
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:77
Foam::vtk::writeTopoSet
bool writeTopoSet(const polyMesh &mesh, const topoSet &set, const vtk::outputOptions opts, const fileName &file, bool parallel=Pstream::parRun())
Dispatch to vtk::writeCellSetFaces, vtk::writeFaceSet, vtk::writePointSet.
Definition: foamVtkWriteTopoSet.C:38
faceSet.H
Foam::topoSet
General set of labels of mesh quantity (points, cells, faces).
Definition: topoSet.H:63
Foam::vtk::writePointSet
bool writePointSet(const polyMesh &mesh, const pointSet &set, const vtk::outputOptions opts, const fileName &file, bool parallel=Pstream::parRun())
Write pointSet to VTK polydata file.
Definition: foamVtkWritePointSet.C:38
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:6
Foam::vtk::writeFaceSet
bool writeFaceSet(const polyMesh &mesh, const faceSet &set, const vtk::outputOptions opts, const fileName &file, bool parallel=Pstream::parRun())
Write faceSet as VTK polydata file.
Definition: foamVtkWriteFaceSet.C:37
Foam::nl
constexpr char nl
Definition: Ostream.H:385
foamVtkWriteTopoSet.H
Write topoSet in VTK format.
cellSet.H
WarningInFunction
#define WarningInFunction
Report a warning using Foam::Warning.
Definition: messageStream.H:303
pointSet.H