I'm hoping someone here can enlighten me on a sort of esoteric NASTRAN file format question. In our source code (src/Mod/Mesh/App/Core/MeshIO.cpp line 1659) we have small section of code that looks like this:
Code: Select all
if (line.find("GRID*") == 0) {
}
else if (line.find('*') == 0) {
}
else if (line.find("GRID") == 0) {
// Actually do stuff in this one...
...
I've looked through the NASTRAN95 user manual, and a bunch of input files, trying to figure out in particular what that "GRID*" search is supposed to be accomplishing. I can't find any evidence that the literal text "GRID*" (that is, the word GRID followed by an asterisk) is valid NASTRAN input, and I am wondering if it's possible that what that code is intended to do is eliminate the GRIDS and GRIDF elements. That's not what it's doing... but is that maybe what it's
supposed to be doing? (I should note that because GRID element itself is parsed via regular expressions, this test would be purely an optimization if that was its intent, the regex would reject a line with the asterisk in it).
As a follow on, what does it mean for a line to begin with an asterisk, that we're bypassing the regex checks and skipping the line entirely?
Finally, if these are important optimizations, isn't using string::find to see if a string starts with an asterisk basically the slowest possible way of doing that?
(As a side note, I'm only bringing this up because LGTM complains about the empty blocks, so I was going to drop comments in there explaining why we're skipping those lines... then I started looking at them!)