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

Function read

src/meshTools/edgeMesh/edgeMeshFormats/nas/NASedgeFormat.C:44–233  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

42// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
43
44bool Foam::fileFormats::NASedgeFormat::read
45(
46 const fileName& filename
47)
48{
49 clear();
50
51 IFstream is(filename);
52 if (!is.good())
53 {
54 FatalErrorInFunction
55 << "Cannot read file " << filename
56 << exit(FatalError);
57 }
58
59 DynamicList<point> dynPoints;
60 DynamicList<edge> dynEdges;
61 DynamicList<label> pointId; // Nastran index of points
62
63 while (is.good())
64 {
65 string line;
66 is.getLine(line);
67
68 // Skip empty or comment
69 if (line.empty() || line[0] == '$')
70 {
71 continue;
72 }
73
74 // Check if character 72 is continuation
75 if (line.size() > 72 && line[72] == '+')
76 {
77 line = line.substr(0, 72);
78
79 while (true)
80 {
81 string buf;
82 is.getLine(buf);
83
84 if (buf.size() > 72 && buf[72] == '+')
85 {
86 line += buf.substr(8, 64);
87 }
88 else
89 {
90 line += buf.substr(8, buf.size()-8);
91 break;
92 }
93 }
94 }
95
96
97 // Read first word
98 IStringStream lineStream(line);
99 word cmd;
100 lineStream >> cmd;
101

Callers 1

NASedgeFormat.CFile · 0.70

Calls 15

readLabelFunction · 0.85
IStringStreamClass · 0.85
parseNASCoordFunction · 0.85
pointClass · 0.85
pointsFunction · 0.85
shrinkMethod · 0.80
getMethod · 0.80
clearFunction · 0.50
exitFunction · 0.50
forAllFunction · 0.50
goodMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected