faMeshWriteEdgesOBJ.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) 2021 OpenCFD Ltd.
9 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
12 
13 Description
14  OBJ output of faMesh edges
15 
16 \*---------------------------------------------------------------------------*/
17 
18 {
19  Info<< nl
20  << "Writing edges in obj format" << endl;
21 
22  word outputName("finiteArea-edges.obj");
23 
24  if (Pstream::parRun())
25  {
26  outputName = word
27  (
28  "finiteArea-edges-proc"
29  + Foam::name(Pstream::myProcNo())
30  + ".obj"
31  );
32  }
33 
34  OBJstream os(runTime.globalPath()/outputName);
35 
36  os.writeQuoted
37  (
38  ("# " + outputName + "\n"),
39  false
40  );
41 
42  os.write(aMesh.patch().edges(), aMesh.patch().localPoints());
43 }
44 
45 
46 // ************************************************************************* //
runTime
engineTime & runTime
Definition: createEngineTime.H:13
Foam::endl
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:369
aMesh
faMesh aMesh(mesh)
outputName
word outputName("finiteArea-edges.obj")
Foam::Info
messageStream Info
Information stream (stdout output on master, null elsewhere)
os
OBJstream os(runTime.globalPath()/outputName)
Foam::nl
constexpr char nl
Definition: Ostream.H:404
Foam::name
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
Definition: exprTraits.C:59