Go to the documentation of this file.
41 const UList<Face>& faceLst
46 if (!faceTraits<Face>::isTri())
48 for (
const auto&
f : faceLst)
60 <<
"Surface has " << nNonTris <<
"/" << faceLst.size()
61 <<
" non-triangulated faces - not writing!" <<
endl;
95 <<
"Cannot read file " << filename
100 string line = this->getLineNoComment(is);
125 line = this->getLineNoComment(is);
132 pointLst[pointi] =
point(
x,
y, z);
140 line = this->getLineNoComment(is);
146 edges[edgei] =
edge(beg - 1,
end - 1);
154 label e0Label, e1Label, e2Label;
157 line = this->getLineNoComment(is);
161 >> e0Label >> e1Label >> e2Label;
168 if (!lineStream.
bad())
183 const edge& e0 = edges[e0Label - 1];
184 const edge& e1 = edges[e1Label - 1];
185 const edge& e2 = edges[e2Label - 1];
191 <<
"Edges 0 and 1 of triangle " << facei
192 <<
" do not share a point.\n"
193 <<
" edge0:" << e0 <<
nl
205 <<
"Edges 1 and 2 of triangle " << facei
206 <<
" do not share a point.\n"
207 <<
" edge1:" << e1 <<
nl
214 if (common12 != e1Far || e2Far != e0Far)
217 <<
"Edges of triangle " << facei
218 <<
" reference more than three points.\n"
219 <<
" edge0:" << e0 <<
nl
220 <<
" edge1:" << e1 <<
nl
221 <<
" edge2:" << e2 <<
nl
225 faceLst[facei] = Face{e0Far, common01, e1Far};
226 zoneIds[facei] = zoneI;
240 this->storedZoneToc().transfer(newZones);
241 this->addZonesToFaces();
262 : surfaceFormatsCore::oneZone(faceLst)
265 checkIfTriangulated(faceLst);
271 <<
"Cannot open file for writing " << filename
277 os <<
"# GTS file" <<
nl
282 os <<
"# " << zoneI <<
" "
283 << zones[zoneI].name() <<
nl;
287 os <<
"# nPoints nEdges nTriangles" <<
nl
288 << pointLst.
size() <<
' ' << surf.nEdges() <<
' '
293 for (
const point& pt : pointLst)
295 os << pt.x() <<
' ' << pt.y() <<
' ' << pt.z() <<
nl;
302 const labelList& meshPts = surf.meshPoints();
304 for (
const edge&
e : es)
306 os << meshPts[
e.start()] + 1 <<
' '
307 << meshPts[
e.end()] + 1 <<
nl;
319 for (
label i=0; i<nLocalFaces; ++i)
321 const labelList& fEdges = faceEs[faceIndex++];
323 os << fEdges[0] + 1 <<
' '
324 << fEdges[1] + 1 <<
' '
325 << fEdges[2] + 1 <<
' '
347 checkIfTriangulated(faceLst);
353 <<
"Cannot open file for writing " << filename
359 os <<
"# GTS file" <<
nl
364 os <<
"# " << zoneI <<
" "
365 << zoneToc[zoneI].name() <<
nl;
370 os <<
"# nPoints nEdges nTriangles" <<
nl
371 << pointLst.
size() <<
' ' << surf.nEdges() <<
' '
376 for (
const point& pt : pointLst)
378 os << pt.x() <<
' ' << pt.y() <<
' ' << pt.z() <<
nl;
385 const labelList& meshPts = surf.meshPoints();
387 for (
const edge&
e : es)
389 os << meshPts[
e.start()] + 1 <<
' '
390 << meshPts[
e.end()] + 1 <<
nl;
400 os << fEdges[0] + 1 <<
' '
401 << fEdges[1] + 1 <<
' '
402 << fEdges[2] + 1 <<
' '
403 << zoneIds[facei] <<
nl;
const surfZoneList & surfZones() const
Const access to the surface zones.
label commonVertex(const edge &other) const
Return vertex common with other edge or -1 on failure.
A class for handling file names.
Input from file stream, using an ISstream.
An edge is a list of two point labels. The functionality it provides supports the discretisation on a...
Base class for mesh zones.
const List< Face > & surfFaces() const
Return const access to the faces.
Input/output from string buffers.
Ostream & endl(Ostream &os)
Add newline and flush stream.
Identifies a surface patch/zone by name, patch index and geometricType.
#define forAll(list, i)
Loop across all elements in list.
virtual const labelList & zoneIds() const
Return const access to the zone ids.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
A surface geometry mesh, in which the surface zone information is conveyed by the 'zoneId' associated...
word name(const complex &c)
Return string representation of complex.
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,...
bool bad() const
Return true if stream is corrupted.
constexpr auto end(C &c) -> decltype(c.end())
Return iterator to the end of the container c.
label size() const
The surface size is the number of faces.
Input from string buffer, using a ISstream.
errorManipArg< error, int > exit(error &err, const int errNo=1)
Output to file stream, using an OSstream.
label otherVertex(const label pointLabel) const
Given the point label for one vertex, return the other one.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Input/output from file streams.
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...
const dimensionedScalar e
Elementary charge.
void size(const label n) noexcept
Override size to be inconsistent with allocated storage.
vector point
Point is a vector.
bool good() const
Return true if next operation might succeed.
void setSize(const label newSize)
Alias for resize(const label)
A surface geometry mesh with zone information, not to be confused with the similarly named surfaceMes...
label size() const
The surface size is the number of faces.