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

Function readAC

src/triSurface/triSurface/interfaces/AC3D/readAC.C:123–343  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

121// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
122
123bool triSurface::readAC(const fileName& ACfileName)
124{
125 IFstream ACfile(ACfileName);
126
127 if (!ACfile.good())
128 {
129 FatalErrorInFunction
130 << "Cannot read file " << ACfileName
131 << exit(FatalError);
132 }
133
134 string line;
135 ACfile.getLine(line);
136
137 string version = line.substr(4);
138
139 if (version != "b")
140 {
141 WarningInFunction
142 << "When reading AC3D file " << ACfileName
143 << " read header " << line << " with version " << version
144 << endl << "Only tested reading with version 'b'."
145 << " This might give problems" << endl;
146 }
147
148 string cmd;
149
150 string args;
151
152 if (!readUpto("OBJECT", ACfile, args) || (args != "world"))
153 {
154 FatalErrorInFunction
155 << "Cannot find \"OBJECT world\" in file " << ACfileName
156 << exit(FatalError);
157 }
158
159 // Number of kids = patches
160
161 readUpto("kids", ACfile, args, "");
162
163 label nPatches = parseInt(args);
164
165 // Storage for patches and unmerged points and faces
166
167 DynamicList<point> points;
168 DynamicList<labelledTri> faces;
169 geometricSurfacePatchList patches(nPatches);
170
171
172 // Start of vertices for object/patch
173 label patchStartVert = 0;
174
175 for (label patchi = 0; patchi < nPatches; patchi++)
176 {
177 readUpto
178 (
179 "OBJECT",
180 ACfile,

Callers 1

readFunction · 0.85

Calls 15

readUptoFunction · 0.85
parseIntFunction · 0.85
wordClass · 0.85
stitchTrianglesFunction · 0.85
xyMethod · 0.80
shrinkMethod · 0.80
readCmdFunction · 0.70
exitFunction · 0.50
nameFunction · 0.50
stringClass · 0.50
labelledTriClass · 0.50

Tested by

no test coverage detected