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

Function readPoints

src/fileFormats/starcd/STARCDCore.C:95–134  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

93// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
94
95bool Foam::fileFormats::STARCDCore::readPoints
96(
97 IFstream& is,
98 pointField& points,
99 labelList& ids
100)
101{
102 if (!is.good())
103 {
104 FatalErrorInFunction
105 << "Cannot read file " << is.name()
106 << exit(FatalError);
107 }
108
109 readHeader(is, "PROSTAR_VERTEX");
110
111
112 // reuse memory if possible
113 DynamicList<point> dynPoints(points.xfer());
114 DynamicList<label> dynPointId(ids.xfer()); // STAR-CD index of points
115
116 dynPoints.clear();
117 dynPointId.clear();
118
119 label lineLabel;
120 while ((is >> lineLabel).good())
121 {
122 scalar x, y, z;
123
124 is >> x >> y >> z;
125
126 dynPoints.append(point(x, y, z));
127 dynPointId.append(lineLabel);
128 }
129
130 points.transfer(dynPoints);
131 ids.transfer(dynPointId);
132
133 return true;
134}
135
136
137void Foam::fileFormats::STARCDCore::writePoints

Callers 2

readFunction · 0.50

Calls 9

pointClass · 0.85
readHeaderFunction · 0.70
exitFunction · 0.50
goodMethod · 0.45
nameMethod · 0.45
xferMethod · 0.45
clearMethod · 0.45
appendMethod · 0.45
transferMethod · 0.45

Tested by

no test coverage detected