Giter Site home page Giter Site logo

Comments (8)

blattms avatar blattms commented on July 24, 2024

Actually, I don't see any relation of the global index of a cell with the extent of one region that would justify the previous version. To me the change looks like a bugfix.

We take the global index and compute i and j to determine whether the connection between the two cells is an NNC or not below.

from opm-common.

bska avatar bska commented on July 24, 2024

Actually, I don't see any relation of the global index of a cell with the extent of one region that would justify the previous version. To me the change looks like a bugfix.

Okay, then there's something I really don't understand. The usual way to compute the linearised Cartesian index of a zero-based IJK-tuple is

$$g = i + n_x\cdot(j + n_y\cdot k)$$

and the way to recover the IJK tuple from $g$ is then

$$i = g\, \mathrm{mod}\, n_x, \quad j = \lfloor g / n_x \rfloor\, \mathrm{mod}\, n_y, \quad k = \lfloor g / (n_x \cdot n_y) \rfloor$$

We take the global index and compute i and j to determine whether the connection between the two cells is an NNC or not below.

Sure, but the derivation of $j$, if it's actually supposed to be the J component of the cell's IJK index tuple, is suspicious to me since it uses nz instead of ny.

from opm-common.

blattms avatar blattms commented on July 24, 2024

Sorry for my sloppy reading. Missed that aspect. That looks indeed strange/wrong. Also: why don't we also need to use k for the determination?

Maybe we should reuseGridDims::getijk here to prevent confusion?

from opm-common.

bska avatar bska commented on July 24, 2024

Missed [the $n_y$ vs. $n_z$] aspect. That looks indeed strange/wrong

Okay, cool. I was beginning to think I was losing my mind.

Maybe we should reuse GridDims::getijk here to prevent confusion?

Yes, I think that'd be a great idea. Unless you want to do the work, I can create a PR to that effect.

Also: why don't we also need to use k for the determination?

I don't know. It is, of course, possible that the original code did need to care about pinched-out layers, but nowadays the possibility that cells (I,J,K) and (I,J,K+3) would be connected across a pinch-out. I think that would classify as a non-neighbouring connection for the purpose of MULTREGT, but I'm not completely sure.

from opm-common.

blattms avatar blattms commented on July 24, 2024

I don't know. It is, of course, possible that the original code did need to care about pinched-out layers, but nowadays the possibility that cells (I,J,K) and (I,J,K+3) would be connected across a pinch-out. I think that would classify as a non-neighbouring connection for the purpose of MULTREGT, but I'm not completely sure.

I think it does. All the documentatuion says so, all the code treats it like this (e.g. when writing out NNCs)

from opm-common.

blattms avatar blattms commented on July 24, 2024

Concerning work: Yes please create the PR.

from opm-common.

bska avatar bska commented on July 24, 2024

Concerning work: Yes please create the PR.

Please see PR #3639 for my proposed change.

from opm-common.

blattms avatar blattms commented on July 24, 2024

Closing this as the PR is merged.

from opm-common.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.