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-------------------------------------------------------------------------------
10License
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
26Description
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.
32bool wroteTopoSet = false;
33
34// Write faceSet (as PolyData)
35if (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
49 vtk::writeFaceSet
50 (
51 mesh,
52 set,
53 writeOpts,
55 Pstream::parRun()
56 );
57
58 wroteTopoSet = true;
59}
60
61
62// Write pointSet (as PolyData)
63if (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
77 vtk::writePointSet
78 (
79 mesh,
80 set,
81 writeOpts,
83 Pstream::parRun()
84 );
85
86 wroteTopoSet = true;
87}
88
89
90// ************************************************************************* //
fileName relativePath(const fileName &input, const bool caseTag=false) const
Definition: argListI.H:94
bool wroteTopoSet
dynamicFvMesh & mesh
word outputName("finiteArea-edges.obj")
const word & regionDir
Foam::argList args(argc, argv)