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

Minor improvements and fixes to LaplaceIPT #2040

Merged
merged 22 commits into from
Jun 12, 2020

Conversation

ZedThree
Copy link
Member

A couple of important fixes, and some other minor changes because I can't help myself:

  • Fix a bug in is_diagonally_dominant where non-included levels were taking part
  • Add new solver to CMake
  • Make sure to pass a few things by const&
  • Make Level::init overloads constructors
  • Add some helper functions for reused bits
  • Various fixes suggested by clang-tidy

Non-included levels have zero-sized ar, br, cr arrays but were trying
to index them
`all` can be local lambda, `tranpose` static and in anonymous namespace
Because Array(size_type) is not explicit, this assignment ends up
changing the size of first_call to 1, via implicitly converting the
bool to an int, and calling the copy-assignment operator.

Also use std::fill to assign converged too
Also move to immediately before use
- Use Array/Matrix/Tensor::reallocate to set size of container
- Use `1 << n` instead of `pow(2, n)` for integral types
Comment on lines 225 to 233
bool isGlobalFlagSet(int flag) {
return (global_flags & flag) != 0;
}
bool isInnerBoundaryFlagSet(int flag) {
return (inner_boundary_flags & flag) != 0;
}
bool isOuterBoundaryFlagSet(int flag) {
return (outer_boundary_flags & flag) != 0;
}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These helper functions might actually be more generally useful, and could maybe be moved to Laplace base class? Could then make the flag members private rather than protected

And I've just noticed these methods should all be const too

@JosephThomasParker JosephThomasParker merged commit d6145fa into feature/ipt+next Jun 12, 2020
@ZedThree ZedThree deleted the ipt_polish branch November 9, 2020 11:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants