GEOS-DEV / GEOS

GEOS Simulation Framework
GNU Lesser General Public License v2.1
207 stars 83 forks source link

Implement a structured mesh with an IJK interface. #899

Open rrsettgast opened 4 years ago

rrsettgast commented 4 years ago

In order to most effeciently run a wellbore simulation, we should have a structured mesh option with an IJK interface. Key components are:

  1. Structured mesh in cartesian and cylindrical coordinate frames.
  2. IJK interface for maps. For instance elementToNode map can just be a layer that accesses data using IJK backend.

@corbett5 I am thinking you would be most qualified to do this.

TotoGaz commented 2 years ago

After the refactoring of #1418 we have a CellBlockManagerABC with the following interface (this is a subset chosen for the discussion).

class CellBlockManagerABC
{
public:
...
  virtual array2d< real64, nodes::REFERENCE_POSITION_PERM > getNodePositions() const = 0;
...
};

Here abstraction depend on the implementation of the mappings (that are done as LvArrays).

For example, if I consider the CellBlockManagerABC::getNodePositions() member function, the mapping is implemented under the form of an array2d. But conceptually, it’s a N -> R^3 mapping. So we could imagine implementing some kind of

class NtoR3
{
public:
    virtual inputSize() const = 0; // ~ to numNodes
    virtual void operator( localIndex n, real64 & x, real64 & y, real64 & z ) const = 0 ;
}

and this class could be implemented, using an array2d< real64, nodes::REFERENCE_POSITION_PERM >, but another implementation could be using the IJK information not to store an array but recompute the positions on the fly on the GPU. And this is for position, but it’s valid for more or less any mapping that we’re interested in.

So we could end up with some code like

class CellBlockManagerABC
{
public:
...
  virtual NtoR3 getNodePositions() const = 0;
...
};

Obviously,