[LGR] Aquifer cells/connections refinement is not supported or ignored for CpGrid#1008
Open
aritorto wants to merge 4 commits intoOPM:masterfrom
Open
[LGR] Aquifer cells/connections refinement is not supported or ignored for CpGrid#1008aritorto wants to merge 4 commits intoOPM:masterfrom
aritorto wants to merge 4 commits intoOPM:masterfrom
Conversation
Member
Author
|
jenkins build this serial please |
fe14642 to
f5726fa
Compare
…gnored for globalRefine() and adapt()
Member
Author
|
jenkins build this serial please |
blattms
reviewed
Mar 17, 2026
opm/grid/cpgrid/LgrHelpers.cpp
Outdated
Comment on lines
+2276
to
+2291
| bool throwIfAquiferCell(const std::vector<int>& levelAquiferCells, | ||
| const Dune::cpgrid::Entity<0>& element, | ||
| bool throwOnFailure) | ||
| { | ||
| if (!levelAquiferCells.empty()) { | ||
| bool isAquifer = std::ranges::find(levelAquiferCells, element.getLevelElem().index()) != levelAquiferCells.end(); | ||
| if (isAquifer) { | ||
| if (throwOnFailure) | ||
| OPM_THROW(std::invalid_argument, "Refinement of aquifer cells is not supported, yet."); | ||
| else | ||
| return false; | ||
| } | ||
| } | ||
| return true; | ||
| } | ||
|
|
Member
There was a problem hiding this comment.
This seems unused. Should we remove it?
|
|
||
| #include <config.h> | ||
|
|
||
| #define NVERBOSE |
Member
Author
There was a problem hiding this comment.
Thanks for pointing that out. I’m not sure what it’s for. It’s a leftover (copy-paste issue) from older tests and shouldn’t be here. I’ll remove it.
|
|
||
| grid.globalRefine(2); | ||
|
|
||
| Opm::checkGridWithLgrs(grid, |
Member
There was a problem hiding this comment.
Do we check that cells connected to aquifer are not refined?
| grid.adapt(); | ||
| grid.postAdapt(); | ||
|
|
||
| Opm::checkGridWithLgrs(grid, |
tests/cpgrid/lgr/LgrChecks.hpp
Outdated
|
|
||
| grid.processEclipseFormat(&eclipse_grid, &ecl_state, false, false, false); | ||
| } | ||
| #endif |
Member
There was a problem hiding this comment.
Please do not waste too much time on this comment of mine, but I think the next function should also be inside the #if ... #endif
Member
Author
There was a problem hiding this comment.
You're right. Now both methods are guarded.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Local Grid Refinement (LGR) in CpGrid does not support refinement of aquifer cells or cells that have neighboring aquifer connections.
The following methods will throw an exception if aquifer cells or aquifer connections occur inside an LGR region:
In contrast, DUNE Grid refinement methods:
ignore aquifer cells and aquifer connections during refinement and perform the refinement only on the remaining cells.
Additionally, and unrelated to aquifer cells/connections, a small refactor was implemented to reduce code duplication across LGR tests. This introduces a new method createGridFromDeck and its usage in a few tests.