convertTopoSet.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 | 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 Description
27  Code chunk for converting face and point sets - included by foamToVTK.
28 
29 \*---------------------------------------------------------------------------*/
30 
31 // flag to top-level code to signal early stop.
32 bool wroteTopoSet = false;
33 
34 // Write faceSet (as PolyData)
35 if (faceSetName.size())
36 {
37  // Load
38  faceSet set(mesh, faceSetName);
39 
40  fileName outputName
41  (
42  outputDir/regionDir/"face-set"
43  / set.name()/set.name() + timeDesc
44  );
45 
46  Info<< " faceSet : "
48 
50  (
51  mesh,
52  set,
53  writeOpts,
54  outputName,
55  Pstream::parRun()
56  );
57 
58  wroteTopoSet = true;
59 }
60 
61 
62 // Write pointSet (as PolyData)
63 if (pointSetName.size())
64 {
65  // Load
66  pointSet set(mesh, pointSetName);
67 
68  fileName outputName
69  (
70  outputDir/regionDir/"point-set"
71  / set.name()/set.name() + timeDesc
72  );
73 
74  Info<< " pointSet : "
76 
78  (
79  mesh,
80  set,
81  writeOpts,
82  outputName,
83  Pstream::parRun()
84  );
85 
86  wroteTopoSet = true;
87 }
88 
89 
90 // ************************************************************************* //
Foam::BitOps::set
void set(List< bool > &bools, const labelRange &range)
Set the specified range 'on' in a boolList.
Definition: BitOps.C:37
outputName
word outputName("finiteArea-edges.obj")
Foam::Info
messageStream Info
Information stream (stdout output on master, null elsewhere)
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
wroteTopoSet
bool wroteTopoSet
Definition: convertTopoSet.H:32
regionDir
const word & regionDir
Definition: findMeshDefinitionDict.H:34
args
Foam::argList args(argc, argv)
Foam::argList::relativePath
fileName relativePath(const fileName &input, const bool caseTag=false) const
Definition: argListI.H:94