-
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
Retrieve local ijk's of an LGR, given its name #828
base: master
Are you sure you want to change the base?
Conversation
jenkins build this please |
1a44eec
to
482e329
Compare
opm/grid/cpgrid/CpGrid.cpp
Outdated
|
||
for (const auto& element : elements(levelGridView(level))) { | ||
std::array<int, 3> local_ijk; | ||
levelCartMapp.cartesianCoordinate(element.getEquivLevelElem().index(), local_ijk, element.level()); |
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 looks a bit to complicated. element
should be on the level and should be passed directly.
Why do we need to specify the last parameter? Shouldn't the level should be implied by the element.
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.
Indeed, it's enough with element.index(). The last parameter we need since the LevelCartesianIndexMapper takes a CpGrid in it's constructor, instead of a CpGridaData. Then, you should specify the level.
I'll check any improvements on LevelCartesianIndexMapper to avoid this last argument.
opm/grid/cpgrid/CpGrid.cpp
Outdated
@@ -713,6 +714,30 @@ std::vector<std::array<int,2>> CpGrid::mapLeafIndexSetToLocalCartesianIndexSets( | |||
return leafIdx_to_localCartesianIdxSets; | |||
} | |||
|
|||
std::vector<std::array<int,3>> CpGrid::localIJK(const std::string& lgr_name) const |
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.
Should we make this a free function instead of a member function?
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, we should. Then lgr_names_ could be replace by a call of getLgrNameToLevel()
@blattms At some point, some methods related to refinement can be moved into CpGridUtilities, in case the header is kept |
23d1b90
to
57114b2
Compare
jenkins build this please |
1 similar comment
jenkins build this please |
1db6f0a
to
bd231ba
Compare
jenkins build this please |
bd231ba
to
6fea239
Compare
6fea239
to
24d41ea
Compare
jenkins build this please |
@blattms if checks are green, then it's ready for review. In the test file, I'm using the essentially the same deck_string only modifying the ACTNUM part. Is there a way to shorten the file using some methods to change the ACTNUM input in each case? |
To facilitate output file generation, it is beneficial to retrieve the local IJK coordinates from each refined level grid based on its name.
Currently, inactive cells in LGRs are not supported in "opm-common." Nevertheless, an lgrIJK() test for a grid containing inactive cells within the LGR block has been added (and commented out). This case test passes if initLgr() is not invoked in opm-common/opm/input/eclipse/EclipseState/EclipseState.cpp.