openfoam/applications/utilities/finiteArea/makeFaMesh/faMeshWriteEdgesOBJ.H
Mark Olesen b76595df42 ENH: improve stream output of std::string etc.
- change write(const string&) to write(const std::string&).
  This allows output of std::string without an intermediate copy.

- additional writeQuoted method to handle range of char data:

     writeQuoted(const char* str, std::streamsize len, bool)

  This helps with supporting string_view and span<char>

- add operator<< for stdFoam::span<char> and std::string_view (c++17)

- avoid duplicate code in OBJstream

STYLE: add override keyword for IO stream methods
2023-10-11 18:11:37 +00:00

43 lines
1.2 KiB
C

/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2021-2023 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
Description
OBJ output of faMesh edges
\*---------------------------------------------------------------------------*/
{
Info<< nl
<< "Writing edges in obj format" << endl;
word outputName("finiteArea-edges.obj");
if (UPstream::parRun())
{
outputName = word
(
"finiteArea-edges-proc"
+ Foam::name(UPstream::myProcNo())
+ ".obj"
);
}
OBJstream os(runTime.globalPath()/outputName);
os.writeComment(outputName);
os.write(aMesh.patch().edges(), aMesh.patch().localPoints());
}
// ************************************************************************* //