Simple class capturing active cells of a grid. More...

#include <ActiveGridCells.hpp>

Inheritance diagram for Opm::ActiveGridCells:
Inheritance graph

Public Member Functions

 ActiveGridCells (std::array< int, 3 > xyz, const int *globalCell, std::size_t nc)
 Constructs mapping of active cells. More...
 
 ActiveGridCells (std::size_t nx, std::size_t ny, std::size_t nz, const int *globalCell, std::size_t nc)
 Constructs mapping of active cells. More...
 
bool cellActive (std::size_t i, std::size_t j, std::size_t k) const
 
bool cellActive (std::size_t cartesianIndex) const
 
std::vector< int > actNum () const
 
int localCell (std::size_t cartesianIndex) const
 Get the local index of a cell. More...
 
int localCell (std::size_t i, std::size_t j, std::size_t k) const
 Get the local index of a cell. More...
 
size_t getNX () const
 
size_t getNY () const
 
size_t getNZ () const
 
size_t operator[] (int dim) const
 
const std::array< int, 3 > getNXYZ () const
 
size_t getGlobalIndex (size_t i, size_t j, size_t k) const
 
const std::array< int, 3 > getIJK (size_t globalIndex) const
 
size_t getCartesianSize () const
 
void assertGlobalIndex (size_t globalIndex) const
 
void assertIJK (size_t i, size_t j, size_t k) const
 
bool operator== (const GridDims &data) const
 
template<class Serializer >
void serializeOp (Serializer &serializer)
 

Static Public Member Functions

static GridDims serializeObject ()
 

Protected Attributes

std::vector< int > localCell_
 Maps the cartesian index to a compressed local index. More...
 
size_t m_nx
 
size_t m_ny
 
size_t m_nz
 

Detailed Description

Simple class capturing active cells of a grid.

Constructor & Destructor Documentation

◆ ActiveGridCells() [1/2]

Opm::ActiveGridCells::ActiveGridCells ( std::array< int, 3 >  xyz,
const int *  globalCell,
std::size_t  nc 
)

Constructs mapping of active cells.

Parameters
xyzThe cartesian dimensions of the grid
globalCellPointer to first entry of contiguous array mapping local index to cartesian one.
ncThe number of cells of a grid.

◆ ActiveGridCells() [2/2]

Opm::ActiveGridCells::ActiveGridCells ( std::size_t  nx,
std::size_t  ny,
std::size_t  nz,
const int *  globalCell,
std::size_t  nc 
)

Constructs mapping of active cells.

Parameters
nxNumber of cells in x
nyNumber of cells in y
nzNumber of cells in z
globalCellPointer to first entry of contiguous array mapping local index to cartesian one.
ncThe number of cells of a grid.

Member Function Documentation

◆ actNum()

std::vector< int > Opm::ActiveGridCells::actNum ( ) const

◆ assertGlobalIndex()

void Opm::GridDims::assertGlobalIndex ( size_t  globalIndex) const
inherited

◆ assertIJK()

void Opm::GridDims::assertIJK ( size_t  i,
size_t  j,
size_t  k 
) const
inherited

◆ cellActive() [1/2]

bool Opm::ActiveGridCells::cellActive ( std::size_t  cartesianIndex) const

◆ cellActive() [2/2]

bool Opm::ActiveGridCells::cellActive ( std::size_t  i,
std::size_t  j,
std::size_t  k 
) const

◆ getCartesianSize()

size_t Opm::GridDims::getCartesianSize ( ) const
inherited

◆ getGlobalIndex()

size_t Opm::GridDims::getGlobalIndex ( size_t  i,
size_t  j,
size_t  k 
) const
inherited

◆ getIJK()

const std::array< int, 3 > Opm::GridDims::getIJK ( size_t  globalIndex) const
inherited

◆ getNX()

size_t Opm::GridDims::getNX ( ) const
inherited

◆ getNXYZ()

const std::array< int, 3 > Opm::GridDims::getNXYZ ( ) const
inherited

◆ getNY()

size_t Opm::GridDims::getNY ( ) const
inherited

◆ getNZ()

size_t Opm::GridDims::getNZ ( ) const
inherited

◆ localCell() [1/2]

int Opm::ActiveGridCells::localCell ( std::size_t  cartesianIndex) const

Get the local index of a cell.

Parameters
cartesianIndexThe cartesian index of the cell
Returns
The local index or -1 if the cell is inactive

◆ localCell() [2/2]

int Opm::ActiveGridCells::localCell ( std::size_t  i,
std::size_t  j,
std::size_t  k 
) const

Get the local index of a cell.

Parameters
iThe index in the i direction
jThe index in the j direction
kThe index in the k direction
Returns
The local index or -1 if the cell is inactive

◆ operator==()

bool Opm::GridDims::operator== ( const GridDims data) const
inherited

◆ operator[]()

size_t Opm::GridDims::operator[] ( int  dim) const
inherited

◆ serializeObject()

static GridDims Opm::GridDims::serializeObject ( )
staticinherited

◆ serializeOp()

template<class Serializer >
void Opm::GridDims::serializeOp ( Serializer serializer)
inlineinherited

Member Data Documentation

◆ localCell_

std::vector<int> Opm::ActiveGridCells::localCell_
protected

Maps the cartesian index to a compressed local index.

nonactive cells are marked with -1.

◆ m_nx

size_t Opm::GridDims::m_nx
protectedinherited

◆ m_ny

size_t Opm::GridDims::m_ny
protectedinherited

◆ m_nz

size_t Opm::GridDims::m_nz
protectedinherited

The documentation for this class was generated from the following file: