My Project
|
Holds the implementation of the CpGrid as a pimple. More...
Classes | |
class | CellQuadrature |
A class providing numerical quadrature for cells. More... | |
class | ElementChunks |
Class to simplify creating parallel yet performant threaded loops over a grid. More... | |
class | FaceQuadrature |
A class providing numerical quadrature for faces. More... | |
class | GraphOfGrid |
A class storing a graph representation of the grid. More... | |
class | GridManager |
This class manages an Opm::UnstructuredGrid in the sense that it encapsulates creation and destruction of the grid. More... | |
struct | iterator_range |
struct | iterator_range_pod |
class | LevelCartesianIndexMapper |
class | LevelCartesianIndexMapper< Dune::CpGrid > |
class | LevelCartesianIndexMapper< Dune::PolyhedralGrid< dim, dimworld, coord_t > > |
class | LookUpCartesianData |
LookUpCartesianData - To search field properties of leaf grid view elements via CartesianIndex (cartesianMapper) More... | |
struct | LookUpCellCentroid |
LookUpCellCentroid struct - To search cell centroids via element index. More... | |
class | LookUpData |
LookUpData class - To search field properties of leaf grid view elements via element/elementIndex. More... | |
class | MinpvProcessor |
Transform a corner-point grid ZCORN field to account for MINPV processing. More... | |
struct | mutable_iterator_range |
class | RegionMapping |
Forward and reverse mappings between cells and regions/partitions (e.g., the ECLIPSE-style 'SATNUM', 'PVTNUM', or 'EQUILNUM' arrays). More... | |
class | SparseTable |
A SparseTable stores a table with rows of varying size as efficiently as possible. More... | |
class | VelocityInterpolationConstant |
A constant velocity approximation. More... | |
class | VelocityInterpolationECVI |
Interpolate velocity using the extended CVI scheme: compute a corner velocity for each cell corner that is consistent with fluxes of adjacent faces, then interpolate with generalized barycentric coordinates. More... | |
class | VelocityInterpolationInterface |
Abstract interface for velocity interpolation method classes. More... | |
class | WachspressCoord |
Class capable of computing Wachspress coordinates in 2d and 3d. More... | |
Functions | |
void | extractColumn (const UnstructuredGrid &grid, std::vector< std::vector< int > > &columns) |
Extract each column of the grid. | |
template<class T , class A , class C > | |
std::pair< std::vector< T, A >, std::vector< int > > | allGatherv (const std::vector< T, A > &input, const C &comm) |
Gathers vectors from all processes on all processes. | |
template<class T , class A , class C > | |
std::pair< std::vector< T, A >, std::vector< int > > | gatherv (const std::vector< T, A > &input, const C &comm, int root) |
Gathers vectors from all processes on a root process. | |
std::pair< std::unordered_map< int, int >, std::vector< std::array< int, 3 > > > | lgrIJK (const Dune::CpGrid &grid, const std::string &lgr_name) |
Retrieves Cartesian indices for a specified Local Grid Refinement (LGR) level in a Dune::CpGrid. | |
std::pair< std::vector< double >, std::vector< double > > | lgrCOORDandZCORN (const Dune::CpGrid &grid, int level, const std::unordered_map< int, int > &lgrCartesianIdxToCellIdx, const std::vector< std::array< int, 3 > > &lgrIJK) |
Extracts the COORD and ZCORN values for the LGR (Local Grid Refinement) block. | |
void | setPillarCoordinates (int i, int j, int nx, int topCorner, int bottomCorner, int positionIdx, const Dune::cpgrid::Entity< 0 > &topElem, const Dune::cpgrid::Entity< 0 > &bottomElem, std::vector< double > &lgrCOORD) |
Sets the coordinates for a pillar. | |
void | processPillars (int i, int j, int nx, const Dune::cpgrid::Entity< 0 > &topElem, const Dune::cpgrid::Entity< 0 > &bottomElem, std::vector< double > &lgrCOORD) |
Processes and sets the coordinates for all four pillars of a given "(i,j) column of cells". | |
void | addFutureConnectionWells (GraphOfGrid< Dune::CpGrid > &gog, const std::unordered_map< std::string, std::set< int > > &wells, bool checkWellIntersections=true) |
Adds well to the GraphOfGrid. | |
void | addWellConnections (GraphOfGrid< Dune::CpGrid > &gog, const Dune::cpgrid::WellConnections &wells, bool checkWellIntersections=true) |
Add WellConnections to the GraphOfGrid. | |
void | extendGIDtoRank (const GraphOfGrid< Dune::CpGrid > &gog, std::vector< int > &gIDtoRank, const int &root=-1) |
Correct gIDtoRank's data about well cells. | |
std::vector< int > | getWellRanks (const std::vector< int > &gIDtoRank, const Dune::cpgrid::WellConnections &wellConnections) |
Find to which ranks wells were assigned. | |
SparseTable< int > | cellNeighboursAcrossVertices (const UnstructuredGrid &grid) |
For each cell, find indices of all other cells sharing a vertex with it. | |
void | orderCounterClockwise (const UnstructuredGrid &grid, SparseTable< int > &nb) |
For each cell, order the (cell) neighbours counterclockwise. | |
std::unordered_map< int, int > | cartesianToCompressed (const int num_cells, const int *global_cell) |
std::vector< int > | compressedToCartesian (const int num_cells, const int *global_cell) |
template<class Range > | |
auto | createChunkIterators (const Range &r, const std::size_t num_elem, const std::size_t num_chunks) |
Create a vector containing a spread of iterators into the elements of the range, to facilitate for example OpenMP parallelization of iterations over the elements. | |
template<class Range > | |
auto | createThreadIterators (const Range &r, const std::size_t num_elem, const std::size_t num_threads, const std::size_t max_chunk_size, int &chunk_size) |
Create a vector containing a spread of iterators into the elements of the range, to facilitate for example OpenMP parallelization of iterations over the elements. | |
template<class GridView > | |
auto | createThreadIterators (const GridView &gv, const std::size_t num_threads, const std::size_t max_chunk_size, int &chunk_size) |
Convenience function for using createThreadIterators() with the cells in a grid view. | |
Holds the implementation of the CpGrid as a pimple.
void Opm::addFutureConnectionWells | ( | GraphOfGrid< Dune::CpGrid > & | gog, |
const std::unordered_map< std::string, std::set< int > > & | wells, | ||
bool | checkWellIntersections = true |
||
) |
Adds well to the GraphOfGrid.
Translates wells' cartesian ID to global ID used in the graph. Adding the well contracts vertices of the well into one vertex.
checkWellIntersections==true makes the algorithm check if wells intersect and if their cell IDs are present in the graph. Setting it to false makes the algorithm faster but leaves user responsible for keeping wells disjoint.
void Opm::addWellConnections | ( | GraphOfGrid< Dune::CpGrid > & | gog, |
const Dune::cpgrid::WellConnections & | wells, | ||
bool | checkWellIntersections = true |
||
) |
Add WellConnections to the GraphOfGrid.
checkWellIntersections==true makes the algorithm check if wells intersect and if their cell IDs are present in the graph. Setting it to false makes the algorithm faster but leaves user responsible for keeping wells disjoint.
std::pair< std::vector< T, A >, std::vector< int > > Opm::allGatherv | ( | const std::vector< T, A > & | input, |
const C & | comm | ||
) |
Gathers vectors from all processes on all processes.
In parallel this will call MPI_Allgatherv. Has to be called on all ranks.
input | The input vector to gather from the rank. |
comm | The Dune::Communication object. |
SparseTable< int > Opm::cellNeighboursAcrossVertices | ( | const UnstructuredGrid & | grid | ) |
For each cell, find indices of all other cells sharing a vertex with it.
For each cell, find indices of all cells sharing a vertex with it.
[in] | grid | A grid object. |
auto Opm::createChunkIterators | ( | const Range & | r, |
const std::size_t | num_elem, | ||
const std::size_t | num_chunks | ||
) |
Create a vector containing a spread of iterators into the elements of the range, to facilitate for example OpenMP parallelization of iterations over the elements.
While the original range may have only forward iterators to the individual elements, the returned vector will provide random access to the chunks.
Range | Range of elements that supports (multipass) forward iteration. |
[in] | r | Range to be iterated over. |
[in] | num_elem | The number of elements in r. |
[in] | num_chunks | The number of chunks to create. |
auto Opm::createThreadIterators | ( | const Range & | r, |
const std::size_t | num_elem, | ||
const std::size_t | num_threads, | ||
const std::size_t | max_chunk_size, | ||
int & | chunk_size | ||
) |
Create a vector containing a spread of iterators into the elements of the range, to facilitate for example OpenMP parallelization of iterations over the elements.
While the original range may have only forward iterators to the individual elements, the returned vector will provide random access to the chunks.
Range | Range of elements that supports (multipass) forward iteration. |
[in] | r | Range to be iterated over. |
[in] | num_elem | The number of elements in r. |
[in] | num_threads | The number of threads to target. |
[in] | max_chunk_size | The maximum allowed chunk size. |
[out] | chunk_size | The chunk size found by the algorithm. |
void Opm::extendGIDtoRank | ( | const GraphOfGrid< Dune::CpGrid > & | gog, |
std::vector< int > & | gIDtoRank, | ||
const int & | root = -1 |
||
) |
Correct gIDtoRank's data about well cells.
gIDtoRank's entries come from Zoltan partitioner's export list that does not contain all well cells. Default value is root's rank. parameter root allows skipping wells that are correct.
void Opm::extractColumn | ( | const UnstructuredGrid & | grid, |
std::vector< std::vector< int > > & | columns | ||
) |
Extract each column of the grid.
grid | The grid from which to extract the columns. |
columns | will for each (i, j) where (i, j) represents a non-empty column, contain the cell indices contained in the column centered at (i, j) in the second variable, and i+jN in the first variable. |
std::pair< std::vector< T, A >, std::vector< int > > Opm::gatherv | ( | const std::vector< T, A > & | input, |
const C & | comm, | ||
int | root | ||
) |
Gathers vectors from all processes on a root process.
In parallel this will call MPI_Gatherv. Has to be called on all ranks.
input | The input vector to gather from the rank. |
comm | The Dune::Communication object. |
root | The rank of the processes to gather the values- |
std::vector< int > Opm::getWellRanks | ( | const std::vector< int > & | gIDtoRank, |
const Dune::cpgrid::WellConnections & | wellConnections | ||
) |
Find to which ranks wells were assigned.
returns the vector of ranks, ordering is given by wellConnections
gIDtoRank | Takes global ID and returns rank |
wellConnections | Has global IDs of well cells |
std::pair< std::vector< double >, std::vector< double > > Opm::lgrCOORDandZCORN | ( | const Dune::CpGrid & | grid, |
int | level, | ||
const std::unordered_map< int, int > & | lgrCartesianIdxToCellIdx, | ||
const std::vector< std::array< int, 3 > > & | lgrIJK | ||
) |
Extracts the COORD and ZCORN values for the LGR (Local Grid Refinement) block.
COORD: This retrieves a vector of std::array<double, 6>, where each element represents the coordinate values of a pillar in the LGR block. The values correspond to the COORD keyword, which defines the corner-point geometry of the grid. ZCORN: It is initialized to inactive values, i.e. set to std::numeric_limits<double>::max(), and then calculates the bottom and top ZCORN values for each cell in the LGR based on its geometry. It determines the active cell layers and assigns ZCORN values accordingly.
Special Cases:
[in] | grid | |
[in] | level | The refinement level of the LGR block. |
[in] | lgrCartesianIdxToCellIdx | Mapping from LGR Cartesian indices to level cell indices. |
[in] | lgrIJK | The IJK indices corresponding to the LGR block active cells. |
std::pair< std::unordered_map< int, int >, std::vector< std::array< int, 3 > > > Opm::lgrIJK | ( | const Dune::CpGrid & | grid, |
const std::string & | lgr_name | ||
) |
Retrieves Cartesian indices for a specified Local Grid Refinement (LGR) level in a Dune::CpGrid.
This function extracts the mapping between active cell indices and Cartesian indices for a given LGR name. If the specified name is not found, an exception is thrown.
[in] | grid | The Dune::CpGrid |
[in] | lgr_name | The name of the LGR whose indices are to be retrieved. |
void Opm::orderCounterClockwise | ( | const UnstructuredGrid & | grid, |
SparseTable< int > & | nb | ||
) |
For each cell, order the (cell) neighbours counterclockwise.
[in] | grid | A 2d grid object. |
[in,out] | nb | A cell-cell neighbourhood table, such as from cellNeighboursAcrossVertices(). |
[in] | grid | A 2d grid object. |
[in,out] | nb | A cell-cell neighbourhood table, such as from vertexNeighbours(). |
void Opm::processPillars | ( | int | i, |
int | j, | ||
int | nx, | ||
const Dune::cpgrid::Entity< 0 > & | topElem, | ||
const Dune::cpgrid::Entity< 0 > & | bottomElem, | ||
std::vector< double > & | lgrCOORD | ||
) |
Processes and sets the coordinates for all four pillars of a given "(i,j) column of cells".
This function calls setPillarCoordinates for each of the four pillars (i,j), (i+1,j), (i,j+1), and (i+1,j+1), assigning the correct top and bottom coordinates from the given elements.
[in] | i | Column index of the current element. |
[in] | j | Row index of the current element. |
[in] | nx | Number of elements in the x-direction. |
[in] | topElem | Reference to the top element. |
[in] | bottomElem | Reference to the bottom element. |
[out] | lgrCOORD | Reference to the array storing the pillar coordinates. |
void Opm::setPillarCoordinates | ( | int | i, |
int | j, | ||
int | nx, | ||
int | topCorner, | ||
int | bottomCorner, | ||
int | positionIdx, | ||
const Dune::cpgrid::Entity< 0 > & | topElem, | ||
const Dune::cpgrid::Entity< 0 > & | bottomElem, | ||
std::vector< double > & | lgrCOORD | ||
) |
Sets the coordinates for a pillar.
This function calculates the pillar index based on the given (i, j) position and assigns the top and bottom coordinates from the corresponding element corners.
[in] | i | Column index of the pillar. |
[in] | j | Row index of the pillar. |
[in] | nx | Number of elements in the x-direction. |
[in] | topCorner | Index of the top element corner associated with the pillar. |
[in] | bottomCorner | Index of the bottom element corner associated with the pillar. |
[in] | positionIdx | To determine the correct pillar index (0-3). |
[in] | topElem | Reference to the top element. |
[in] | bottomElem | Reference to the bottom element. |
[out] | lgrCOORD | Reference to the array storing the pillar coordinates. |