39 const UList<point>& pts,
51 for (label fp1 = 1; fp1 <
f.size() - 1; ++fp1)
53 const label fp2 =
f.fcIndex(fp1);
72 const UList<point>& pts,
85 for (label fp1 = 1; fp1 <
f.size() - 1; ++fp1)
87 const label fp2 =
f.fcIndex(fp1);
133 const auto& readpts = reader.
points();
137 pointLst.
setSize(nUniquePoints);
140 pointLst[pointMap[pointi]] = readpts[pointi];
156 const label startPt = 3*facei;
157 faceLst[facei] = Face
174 const label startPt = 3*
faceMap[facei];
175 faceLst[facei] = Face
186 this->storedFaces().transfer(faceLst);
190 this->addZones(sizes, names);
194 this->addZones(sizes);
196 this->addZonesToFaces();
214 <<
"Cannot write file " << filename <<
nl
225 ? surfaceFormatsCore::oneZone(faceLst)
236 for (label nLocal =
zone.
size(); nLocal--; ++faceIndex)
239 (useFaceMap ?
faceMap[faceIndex] : faceIndex);
241 const Face&
f = faceLst[facei];
243 writeShell(
os, pointLst,
f);
257 std::ofstream
os(filename, std::ios::binary);
261 <<
"Cannot write file " << filename <<
nl
273 : surfaceFormatsCore::oneZone(faceLst)
280 STLCore::writeBinaryHeader(
os, nTris);
286 for (label nLocal =
zone.
size(); nLocal--; ++faceIndex)
289 (useFaceMap ?
faceMap[faceIndex] : faceIndex);
291 const Face&
f = faceLst[facei];
293 writeShell(
os, pointLst,
f, zoneIndex);
313 if (surf.
zoneToc().size() == 1)
319 <<
"Cannot write file " << filename <<
nl
324 for (
const Face&
f : faceLst)
326 writeShell(
os, pointLst,
f);
328 os <<
"endsolid " << surf.
zoneToc()[0].name() <<
nl;
358 std::ofstream
os(filename, std::ios::binary);
362 <<
"Cannot write file " << filename <<
nl
372 STLCore::writeBinaryHeader(
os, nTris);
399 streamOpt.
format() == IOstream::BINARY
401 || STLCore::isBinaryName(filename, STLCore::UNKNOWN)
404 writeBinary(filename, surf);
408 writeAscii(filename, surf, streamOpt.
compression());
422 if (STLCore::isBinaryName(filename,
format))
424 writeBinary(filename, surf);
428 writeAscii(filename, surf, comp);
444 streamOpt.
format() == IOstream::BINARY
446 || STLCore::isBinaryName(filename, STLCore::UNKNOWN)
449 writeBinary(filename, surf);
453 writeAscii(filename, surf, streamOpt.
compression());
467 if (STLCore::isBinaryName(filename,
format))
469 writeBinary(filename, surf);
473 writeAscii(filename, surf, comp);
Various functions to operate on Lists.
The IOstreamOption is a simple container for options an IOstream can normally have.
compressionType compression() const noexcept
Get the stream compression.
streamFormat format() const noexcept
Get the current stream format.
compressionType
Compression treatment (UNCOMPRESSED | COMPRESSED)
void setSize(const label n)
Alias for resize()
void clear()
Clear the list, i.e. set size to zero.
A proxy for writing MeshedSurface, UnsortedMeshedSurface and surfMesh to various file formats.
const UList< surfZone > & surfZones() const
Const access to the surface zones.
const UList< Face > & surfFaces() const
Return const access to the faces.
bool useFaceMap() const
Can/should use faceMap?
label nTriangles() const
Count number of triangles.
const pointField & points() const
Return const access to the points.
const labelUList & faceMap() const
Const access to the faceMap, zero-sized when unused.
const List< Face > & surfFaces() const
Return const access to the faces.
virtual label nTriangles() const
Count number of triangles.
Output to file stream, using an OSstream.
const Field< point_type > & points() const noexcept
Return reference to global points.
virtual bool read()
Re-read model coefficients if they have changed.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
bool empty() const noexcept
True if the UList is empty (ie, size() is zero)
void size(const label n)
Older name for setAddressableSize.
A surface geometry mesh, in which the surface zone information is conveyed by the 'zoneId' associated...
surfZoneList sortedZones(labelList &faceMap) const
Sort faces according to zoneIds.
virtual const labelList & zoneIds() const
Return const access to the zone ids.
const List< surfZoneIdentifier > & zoneToc() const
Return const access to the zone table-of-contents.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
A class for handling file names.
virtual bool write()
Write the output fields.
A surface zone on a MeshedSurface.
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
const word & name() const noexcept
The zone name.
Base class for mesh zones.
const volScalarField & p0
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
OBJstream os(runTime.globalPath()/outputName)
Pair< int > faceMap(const label facePi, const face &faceP, const label faceNi, const face &faceN)
vector point
Point is a vector.
Ostream & endl(Ostream &os)
Add newline and flush stream.
labelList sortedOrder(const UList< T > &input)
Return the (stable) sort order for the list.
triangle< point, const point & > triPointRef
A triangle using referred points.
errorManipArg< error, int > exit(error &err, const int errNo=1)
constexpr char nl
The newline '\n' character (0x0a)
word format(conversionProperties.get< word >("format"))
#define forAll(list, i)
Loop across all elements in list.