Skip to content

Conversation

@aritorto
Copy link
Member

This PR provides a method to extract TRANS* from the leaf grid to the level zero grid. For now, refined cells and cells that vanished during refinement, i.e., parent cells, are not considered. This will be improved and corrected in future PRs.

Keywords: LGRs, output file INIT

@aritorto aritorto added the manual:irrelevant This PR is a minor fix and should not appear in the manual label Dec 22, 2025
@aritorto
Copy link
Member Author

jenkins build this opm-simulators=6661 serial please

@aritorto
Copy link
Member Author

jenkins build this opm-simulators=6661 serial please

@aritorto
Copy link
Member Author

jenkins build this opm-simulators=6661 serial please

Copy link
Member

@blattms blattms left a comment

Choose a reason for hiding this comment

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

If it turns out that we need this, then we will need to address the issue with the superfluous container.

int maxCartIdx = std::max(cartIdxIn, cartIdxOut);

if (maxCartIdx - minCartIdx == 1 && cartDims[0] > 1 ) {
tranx.template data<double>()[cartIdxIn] += leafTrans.transmissibility(leafIdxIn, leafIdxOut);
Copy link
Member

Choose a reason for hiding this comment

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

Assignment would also work.

if constexpr (std::is_same_v<Grid, Dune::CpGrid>) {
// To detect direct vertical neighboring cells:
const Opm::LevelCartesianIndexMapper<Dune::CpGrid> levelCartMapp(grid);
const auto levelCartToLevelCompressed = Opm::Lgr::levelCartesianToLevelCompressedMaps(grid, levelCartMapp);
Copy link
Member

Choose a reason for hiding this comment

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

Two comments here:

  • If we only need level 0 then we should not set up all the other levels
  • The map that we are using in opm-simulators already seems the one that we need here. This due to our cartesian index on the leaf grid (same as the one of the parent on level 0) and the fact that this map from global to compressed index is only used to check whether it contains a global index (See function directVerticalNeighbour

Hence I think that we do not need this container at all.

Comment on lines 397 to 398
int minCartIdx = std::min(cartIdxIn, cartIdxOut);
int maxCartIdx = std::max(cartIdxIn, cartIdxOut);
Copy link
Member

Choose a reason for hiding this comment

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

Nitpic: I think the result should be clear because of the if statement above.

@aritorto
Copy link
Member Author

aritorto commented Jan 8, 2026

Closing since OPM/opm-simulators#6706 does the job

@aritorto aritorto closed this Jan 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

manual:irrelevant This PR is a minor fix and should not appear in the manual

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants