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-2021 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  {
47  const auto* ptr = isA<pointSet>(set);
48  if (ptr)
49  {
50  return vtk::writePointSet(mesh, *ptr, opts, file, parallel);
51  }
52  }
53  {
54  const auto* ptr = isA<faceSet>(set);
55  if (ptr)
56  {
57  return vtk::writeFaceSet(mesh, *ptr, opts, file, parallel);
58  }
59  }
60  {
61  const auto* ptr = isA<cellSet>(set);
62  if (ptr)
63  {
64  return vtk::writeCellSetFaces(mesh, *ptr, opts, file, parallel);
65  }
66  }
67 
69  << "No VTK writer for '" << set.type() << "' topoSet" << nl << endl;
70 
71  return false;
72 }
73 
74 
75 // ************************************************************************* //
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:73
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:369
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:404
foamVtkWriteTopoSet.H
Write topoSet in VTK format.
cellSet.H
WarningInFunction
#define WarningInFunction
Report a warning using Foam::Warning.
Definition: messageStream.H:328
pointSet.H