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

Function writeSMESH

src/triSurface/triSurface/interfaces/SMESH/writeSMESH.C:35–104  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

33// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
34
35void triSurface::writeSMESH(const bool writeSorted, Ostream& os) const
36{
37 const pointField& ps = points();
38
39 // Write header
40 os << "# tetgen .smesh file" << endl
41 << ps.size() << " 3" << endl; // 3 dimensions
42
43 // Write vertex coords
44 forAll(ps, pointi)
45 {
46 os << pointi << ' '
47 << ps[pointi].x() << ' '
48 << ps[pointi].y() << ' '
49 << ps[pointi].z() << endl;
50 }
51
52 if (writeSorted)
53 {
54 labelList faceMap;
55
56 surfacePatchList patches(calcPatches(faceMap));
57
58 os << size() << " 1" << endl; // 1 attribute: region number
59
60 label faceIndex = 0;
61
62 forAll(patches, patchi)
63 {
64 // Print all faces belonging to this patch
65
66 for
67 (
68 label patchFacei = 0;
69 patchFacei < patches[patchi].size();
70 patchFacei++
71 )
72 {
73 const label facei = faceMap[faceIndex++];
74
75 os << "3 " // triangles
76 << operator[](facei)[0] << ' '
77 << operator[](facei)[1] << ' '
78 << operator[](facei)[2] << ' '
79 << operator[](facei).region() // region number
80 << endl;
81 }
82 }
83
84 os << '0' << endl // holes
85 << '0' << endl; // regions
86 }
87 else
88 {
89 os << size() << " 1" << endl; // 1 attribute: region number
90
91 forAll(*this, facei)
92 {

Callers 1

writeFunction · 0.85

Calls 8

pointsFunction · 0.85
sizeFunction · 0.85
forAllFunction · 0.50
sizeMethod · 0.45
xMethod · 0.45
yMethod · 0.45
zMethod · 0.45
regionMethod · 0.45

Tested by

no test coverage detected