Skip to content
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

Fix the bounds of an index computation. #8743

Merged
merged 1 commit into from Sep 13, 2019
Merged

Conversation

bangerth
Copy link
Member

In #8648, I had used the wrong variable to query a loop bound. I can't think of a case where this would lead to wrong results, but conceptually we ought to terminate the loop based on the array we're reading/writing.

Part of #1894.

@bangerth
Copy link
Member Author

/rebuild

@masterleinad
Copy link
Member

Can't you just use a range-based for loop?

@masterleinad
Copy link
Member

Ah, I see you are accessing both

scratch_data.patch_values_system.solution_hessians[i]

and

scratch_data.patch_values_scalar.solution_hessians[i]

. I didn't spot the difference on first sight.

@bangerth
Copy link
Member Author

Yes, that's exactly the reason for not using the range-based for.

@kronbichler kronbichler merged commit dc47db4 into dealii:master Sep 13, 2019
@bangerth bangerth deleted the fix branch September 13, 2019 05:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants