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, distributed under GPL-3.0-or-later.
12 
13 Description
14  Code chunk for converting face and point sets - included by foamToVTK.
15 
16 \*---------------------------------------------------------------------------*/
17 
18 // flag to top-level code to signal early stop.
19 bool wroteTopoSet = false;
20 
21 // Write faceSet (as PolyData)
22 if (faceSetName.size())
23 {
24  // Load
25  faceSet set(mesh, faceSetName);
26 
27  fileName outputName
28  (
29  outputDir/regionDir/"face-set"
30  / set.name()/set.name() + timeDesc
31  );
32 
33  Info<< " faceSet : "
35 
37  (
38  mesh,
39  set,
40  writeOpts,
41  outputName,
42  UPstream::parRun()
43  );
44 
45  wroteTopoSet = true;
46 }
47 
48 
49 // Write pointSet (as PolyData)
50 if (pointSetName.size())
51 {
52  // Load
53  pointSet set(mesh, pointSetName);
54 
55  fileName outputName
56  (
57  outputDir/regionDir/"point-set"
58  / set.name()/set.name() + timeDesc
59  );
60 
61  Info<< " pointSet : "
63 
65  (
66  mesh,
67  set,
68  writeOpts,
69  outputName,
70  UPstream::parRun()
71  );
72 
73  wroteTopoSet = true;
74 }
75 
76 
77 // ************************************************************************* //
bool writePointSet(const polyMesh &mesh, const pointSet &set, const vtk::outputOptions opts, const fileName &file, bool parallel=UPstream::parRun())
Write pointSet to VTK polydata file.
constexpr char nl
The newline &#39;\n&#39; character (0x0a)
Definition: Ostream.H:50
word outputName("finiteArea-edges.obj")
dynamicFvMesh & mesh
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
Definition: exprTraits.C:127
fileName relativePath(const fileName &input, const bool caseTag=false) const
Return the input relative to the globalPath by stripping off a leading value of the globalPath...
Definition: argListI.H:87
bool writeFaceSet(const polyMesh &mesh, const faceSet &set, const vtk::outputOptions opts, const fileName &file, bool parallel=UPstream::parRun())
Write faceSet as VTK polydata file.
const word & regionDir
messageStream Info
Information stream (stdout output on master, null elsewhere)
Foam::argList args(argc, argv)
bool wroteTopoSet