New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Resized the rotation matrix vector in the weighted outputs for the CPO postprocessor #5332
Conversation
/rebuild |
weighted_rotation_matrices.resize(n_minerals); | ||
std::vector<std::vector<double>> volume_fractions_grains(n_minerals,std::vector<double>(n_grains,-1.)); | ||
for (unsigned int mineral = 0; mineral < n_minerals; ++mineral) | ||
{ | ||
for (unsigned int i_grain = 0; i_grain < n_grains; ++i_grain) | ||
{ | ||
weighted_euler_angles[mineral].resize(n_grains); | ||
weighted_rotation_matrices[mineral].resize(n_grains); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Out of curiosity, why was this necessary? Did you get error messages/segmentation faults without resizing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes.. Had a similar issue on the add_drexpp_V3 branch and this helped so just used it here and it works.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This points to a bigger problem. If the code previously had a bug whereby you'd get error messages without the resize()
calls, then there are not enough tests that test this code. Would you be able to write an input file that triggers the error before, and that is fixed with the addition of the code here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's not delay this bugfix by waiting for an unrelated test. @MFraters can you later look into the testing situation for the CPO code?
Otherwise this looks good to go.
Sorry, I had missed this pull request. I think we (@srivatsvyas and me) had talked about this on the last day of the hackathon when he found the issue. Great that it is merged! |
Pull Request Checklist. Please read and check each box with an X. Delete any part not applicable. Ask on the forum if you need help with any step.
Resized the rotation matrix vector while generating weighted outputs in Crystal preferred orientation postprocessor. Before the fix if the option of generating a weighted CPO was chosen in the input file, a segmentation fault was thrown. This PR looks to fix that
For all pull requests:
For new features/models or changes of existing features: