MCPcopy Create free account
hub / github.com/OpenFOAM/OpenFOAM-dev / writeGTS

Function writeGTS

src/triSurface/triSurface/interfaces/GTS/writeGTS.C:35–117  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

33// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
34
35void triSurface::writeGTS(const bool writeSorted, Ostream& os) const
36{
37 // Write header
38 os << "# GTS file" << endl
39 << "# Regions:" << endl;
40
41 labelList faceMap;
42
43 surfacePatchList patches(calcPatches(faceMap));
44
45 // Print patch names as comment
46 forAll(patches, patchi)
47 {
48 os << "# " << patchi << " "
49 << patches[patchi].name() << endl;
50 }
51 os << "#" << endl;
52
53
54 const pointField& ps = points();
55
56 os << "# nPoints nEdges nTriangles" << endl
57 << ps.size() << ' ' << nEdges() << ' ' << size() << endl;
58
59 // Write vertex coords
60
61 forAll(ps, pointi)
62 {
63 os << ps[pointi].x() << ' '
64 << ps[pointi].y() << ' '
65 << ps[pointi].z() << endl;
66 }
67
68 // Write edges.
69 // Note: edges are in local point labels so convert
70 const edgeList& es = edges();
71 const labelList& meshPts = meshPoints();
72
73 forAll(es, edgei)
74 {
75 os << meshPts[es[edgei].start()] + 1 << ' '
76 << meshPts[es[edgei].end()] + 1 << endl;
77 }
78
79 // Write faces in terms of edges.
80 const labelListList& faceEs = faceEdges();
81
82 if (writeSorted)
83 {
84 label faceIndex = 0;
85 forAll(patches, patchi)
86 {
87 for
88 (
89 label patchFacei = 0;
90 patchFacei < patches[patchi].size();
91 patchFacei++
92 )

Callers 1

writeFunction · 0.85

Calls 12

pointsFunction · 0.85
sizeFunction · 0.85
faceEdgesFunction · 0.85
forAllFunction · 0.50
nameMethod · 0.45
sizeMethod · 0.45
xMethod · 0.45
yMethod · 0.45
zMethod · 0.45
startMethod · 0.45
endMethod · 0.45
regionMethod · 0.45

Tested by

no test coverage detected