-
Notifications
You must be signed in to change notification settings - Fork 78
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
Clean up a couple of friend declarations in CpGridData.hpp #761
base: master
Are you sure you want to change the base?
Conversation
jenkins build this please |
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.
Unfortunately, the cleanup also seems to remove quite some part of the checks. Is that intended?
Normally refactoring should not change the amount of tests. Why is this different here? Might we miss problems due to this?
opm/grid/cpgrid/Entity.hpp
Outdated
{ | ||
// Check if the element belongs to the leaf grid view or the level zero grid. | ||
// leaf_to_level_cells_ [leaf idx] = {level where the entity was born, equivalent cell idx in that level} | ||
if ((pgrid_ -> leaf_to_level_cells_.empty()) || (pgrid_-> level_to_leaf_cells_.empty())) // entity on a level grid, with level>0 |
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.
Please use Entity<0>::isLeaf
for the decision. Should be more readable
It's true that the clean up removed lines on the tests, however, those checked implementation details instead of features. For example, when we use "internally" -1 to denote that an entity does not verify certain property. Or when we check properties of children cells, it should be sufficient to use the hierarchic iterators instead of accessing via parent_to_children_cells_ . Sorry if "Clean up" on the title does not fully describe the PR intend |
I see. Fair enough. I see that we have the checks using child_to_parent as we are checking I think moving more to the standard DUNE interface even in the tests is a very good change. Thanks a lot. |
True, I haven't tried to use the iterators "in the other direction". That's a great idea. I'll draft this PR for now. Thanks for your feedback! |
081749a
to
5f2815d
Compare
Not relevant for the Reference Manual.