34 Foam::label Foam::starMesh::readVtxLabel(IFstream& is)
38 for (
int i=0; i<15; i++)
49 Foam::scalar Foam::starMesh::readVtxCmpt(IFstream& is)
53 for (
int i=0; i<16; i++)
60 return scalar(atof(lcs));
64 void Foam::starMesh::readToNl(IFstream& is)
70 }
while (is && c !=
'\n');
74 void Foam::starMesh::readPoints(
const scalar scaleFactor)
79 fileName pointsFileName(casePrefix_ +
".vrt");
82 IFstream pointsFile(pointsFileName);
86 if (pointsFile.good())
93 pointLabel = readVtxLabel(pointsFile);
95 if (!pointsFile)
break;
97 maxLabel =
max(maxLabel, pointLabel);
99 readVtxCmpt(pointsFile);
100 readVtxCmpt(pointsFile);
101 readVtxCmpt(pointsFile);
103 readToNl(pointsFile);
111 <<
"Cannot read file " << pointsFileName
116 Info<<
"Number of points = " << nPoints << endl <<
endl;
127 starPointLabelLookup_.
setSize(maxLabel+1);
130 starPointLabelLookup_ = -1;
137 IFstream pointsFile(pointsFileName);
142 pointLabel = readVtxLabel(pointsFile);
143 points_[
p].x() = readVtxCmpt(pointsFile);
144 points_[
p].y() = readVtxCmpt(pointsFile);
145 points_[
p].z() = readVtxCmpt(pointsFile);
147 readToNl(pointsFile);
150 starPointID_[
p] = pointLabel;
153 starPointLabelLookup_[pointLabel] =
p;
156 if (scaleFactor > 1.0 + small || scaleFactor < 1.0 - small)
158 points_ *= scaleFactor;
164 <<
"void starMesh::readPoints() : " 165 <<
"no points in file " #define forAll(list, i)
Loop across all elements in list.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Ostream & endl(Ostream &os)
Add newline and flush stream.
const dimensionedScalar c
Speed of light in a vacuum.
errorManip< error > abort(error &err)
void setSize(const label)
Reset size of List.