Merged
Conversation
pcarruscag
commented
Aug 28, 2021
Comment on lines
+228
to
+230
| if (current_section_idx != 2) { | ||
| SU2_MPI::Error("Markers must be listed after points and elements in the SU2 mesh file.", CURRENT_FUNCTION); | ||
| } |
Member
Author
There was a problem hiding this comment.
This PR introduces this restriction. It could be avoided if we stop checking for v6-style periodicity in the mesh file.
WallyMaier
reviewed
Aug 30, 2021
Contributor
WallyMaier
left a comment
There was a problem hiding this comment.
Thanks for this work, Pedro! This looks good to me!
|
|
||
| if (iProcessor >= (unsigned long)size) | ||
| iProcessor = (unsigned long)size-1; | ||
| unsigned long iProcessor = min<unsigned long>(index/sizeOnRank[0], size-1); |
| text_line.erase (0,11); | ||
| string::size_type position; | ||
|
|
||
| for (unsigned short iChar = 0; iChar < 20; iChar++) { |
Contributor
There was a problem hiding this comment.
Where does 20 come from?
pcarruscag
commented
Aug 30, 2021
Comment on lines
-1213
to
-1222
| string::size_type position; | ||
|
|
||
| for (unsigned short iChar = 0; iChar < 20; iChar++) { | ||
| position = text_line.find( " ", 0 ); | ||
| if (position != string::npos) text_line.erase (position,1); | ||
| position = text_line.find( "\r", 0 ); | ||
| if (position != string::npos) text_line.erase (position,1); | ||
| position = text_line.find( "\n", 0 ); | ||
| if (position != string::npos) text_line.erase (position,1); | ||
| } |
Member
Author
There was a problem hiding this comment.
Comes from the ancient ones, I suppose we strip up to 20 spaces anywhere from the marker names 🤷
I doubt the \r and \n ever do anything, because these are used by getline to know what is a line.
This should not be performance or correctness critical, so if it ain't broke...
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Proposed Changes
Reduce duplication and maybe make it a bit faster.
We were reading the entire mesh file in four passes (open-close, open-close, ...) one for metadata (NDIME, NELEM, etc.) one for points, one for elements, and then one for markers.
Now we have a maximum of 2 (meta + reading) and if the points are listed before the elements we do it in 1 pass (there are some meshes like that in TestCases).
If we need to split actuator disk surfaces there are more passes, don't ask me how many because I'm not going to touch that function (it is probably not used often).
We still do a lot of reading for single-file multizone meshes to get to each zone, and usually we put smaller meshes at the end right 😅 I won't get into that now.
Related Work
#1345
PR Checklist