Go to the documentation of this file.
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)
229 const bool useFaceMap = (surf.
useFaceMap() && zones.size() > 1);
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)
276 const bool useFaceMap = (surf.
useFaceMap() && zones.size() > 1);
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
371 unsigned int nTris = surf.nTriangles();
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);
Pair< int > faceMap(const label facePi, const face &faceP, const label faceNi, const face &faceN)
A class for handling file names.
bool useFaceMap() const
Can/should use faceMap?
label nTriangles() const
Count number of triangles.
Base class for mesh zones.
streamFormat format() const noexcept
Get the current stream format.
const pointField & points() const
Return const access to the points.
Ostream & endl(Ostream &os)
Add newline and flush stream.
A proxy for writing MeshedSurface, UnsortedMeshedSurface and surfMesh to various file formats.
const labelUList & faceMap() const
Const access to the faceMap, zero-sized when unused.
#define forAll(list, i)
Loop across all elements in list.
virtual const labelList & zoneIds() const
Return const access to the zone ids.
word format(conversionProperties.get< word >("format"))
A surface geometry mesh, in which the surface zone information is conveyed by the 'zoneId' associated...
The IOstreamOption is a simple container for options an IOstream can normally have.
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,...
OBJstream os(runTime.globalPath()/outputName)
Vector< scalar > vector
A scalar version of the templated Vector.
errorManipArg< error, int > exit(error &err, const int errNo=1)
Output to file stream, using an OSstream.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
const word & name() const noexcept
The zone name.
A surface zone on a MeshedSurface.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
void clear()
Clear the list, i.e. set size to zero.
void write(vtk::formatter &fmt, const Type &val, const label n=1)
Component-wise write of a value (N times)
compressionType
Compression treatment (UNCOMPRESSED | COMPRESSED)
Various functions to operate on Lists.
labelList sortedOrder(const UList< T > &input)
Return the (stable) sort order for the list.
const UList< Face > & surfFaces() const
Return const access to the faces.
const volScalarField & p0
vector point
Point is a vector.
compressionType compression() const noexcept
Get the stream compression.
List< word > names(const UPtrList< T > &list, const UnaryMatchPredicate &matcher)
surfZoneList sortedZones(labelList &faceMap) const
Sort faces according to zoneIds.
triangle< point, const point & > triPointRef
A triangle using referred points.
const UList< surfZone > & surfZones() const
Const access to the surface zones.