|
| void | edgeConformalizeLeaf (Dune::cpgrid::CpGridData &leaf) |
| |
| std::vector< BoundaryConnection > | boxBoundaryConnections (const std::array< int, 3 > &parentDims, const double *coord, const double *zcorn, const int *actnum, const BlockRefinement &box, int axis, int side, const std::optional< CellRange > &across) |
| |
| RefinedBlockGrdecl | refineBlock (const std::array< int, 3 > &parentDims, const double *coord, const double *zcorn, const int *actnum, const BlockRefinement &request) |
| |
| std::shared_ptr< Dune::cpgrid::CpGridData > | assembleBlockLevelGrid (const Dune::cpgrid::CpGridData &parentGrid, const std::array< int, 3 > &parentDims, const double *coord, const double *zcorn, const int *actnum, const BlockRefinement &request, int levelIndex, int parentLevel, const std::vector< std::shared_ptr< Dune::cpgrid::CpGridData > > &levelStorage, RefinedBlockGrdecl *outRefined=nullptr, bool pinchActive=false) |
| |
| std::shared_ptr< Dune::cpgrid::CpGridData > | assembleEmptyLevelGrid (const BlockRefinement &request, int levelIndex, const std::vector< std::shared_ptr< Dune::cpgrid::CpGridData > > &levelStorage) |
| |
| AxisSubdivision | axisSubdivision (const BlockRefinement &request, int dim) |
| |
| std::array< int, 3 > | refinedDims (const BlockRefinement &request) |
| |
| bool | contains (const BlockRefinement &request, const std::array< int, 3 > &ijk) |
| |
| AxisPositions | axisPositions (const AxisSubdivision &sub) |
| |
| std::vector< BlockRefinement > | blockRefinements (const std::vector< std::array< int, 3 > > &cellsPerDim, const std::vector< std::array< int, 3 > > &startIJK, const std::vector< std::array< int, 3 > > &endIJK, const std::vector< std::string > &names, const std::vector< std::string > &parentGridNames) |
| |
| void | validateBlockRefinements (const std::vector< BlockRefinement > &requests, const std::map< std::string, int > &nameToLevel) |
| |
◆ Backend
Which algorithm refines a CpGrid: the existing cell-by-cell trilinear refinement (the default), or a conforming Builder.
| Enumerator |
|---|
| Trilinear | |
| Conforming | |
◆ assembleBlockLevelGrid()
| std::shared_ptr< Dune::cpgrid::CpGridData > Opm::Refinement::assembleBlockLevelGrid |
( |
const Dune::cpgrid::CpGridData & |
parentGrid, |
|
|
const std::array< int, 3 > & |
parentDims, |
|
|
const double * |
coord, |
|
|
const double * |
zcorn, |
|
|
const int * |
actnum, |
|
|
const BlockRefinement & |
request, |
|
|
int |
levelIndex, |
|
|
int |
parentLevel, |
|
|
const std::vector< std::shared_ptr< Dune::cpgrid::CpGridData > > & |
levelStorage, |
|
|
RefinedBlockGrdecl * |
outRefined = nullptr, |
|
|
bool |
pinchActive = false |
|
) |
| |
Turn one block request into a fully processed refined level grid.
The block is resampled onto sub-pillars (refineBlock), run through the corner-point preprocessor (so faults and pinch-outs inside the block are matched by the same code that handles them on level zero), and equipped with the parent relations the rest of CpGrid reads (father(), geometryInFather(), CARFIN-local Cartesian indices).
The caller must put the returned grid at index levelIndex of levelStorage, with level zero at index 0; this function does not add it. The grid keeps a pointer to levelStorage and finds every level grid there by its level index, its own included. Its communicator is the self-communicator, as for assembleEmptyLevelGrid.
- Parameters
-
| parentGrid | The grid the parents live in (level zero for a top-level box, or an LGR level grid for a nested box). |
| parentDims | Cartesian dimensions of the parent description. |
| coord,zcorn | Parent COORD/ZCORN arrays. |
| actnum | Parent ACTNUM or nullptr (all active). |
| request | The block to refine (IJK in parentGrid's space). |
| levelIndex | Index this level grid will occupy in the hierarchy. |
| parentLevel | Level index of parentGrid (0 = GLOBAL); recorded in the child->parent relation so nested grids point at the LGR level they refine rather than always level zero. |
| levelStorage | The hierarchy vector the grid will live in. |
| outRefined | If non-null, receives the resampled refined corner-point description of this level (its own children, if any, are refined from it). |
| pinchActive | Level zero's PINCH state, so the level grid joins cells across removed children exactly when level zero would. |
◆ assembleEmptyLevelGrid()
An empty (zero-cell) refined level grid for a box that has no cells on this rank (distributed runs, rank-interior LGRs). All ranks must carry the same number of level grids, so absent boxes still need a placeholder with consistent level index, subdivision factors and logical Cartesian size.
◆ axisPositions()
◆ axisSubdivision()
The request's subdivision in one direction, uniform tables filled in when the request carries none.
◆ blockRefinements()
| std::vector< BlockRefinement > Opm::Refinement::blockRefinements |
( |
const std::vector< std::array< int, 3 > > & |
cellsPerDim, |
|
|
const std::vector< std::array< int, 3 > > & |
startIJK, |
|
|
const std::vector< std::array< int, 3 > > & |
endIJK, |
|
|
const std::vector< std::string > & |
names, |
|
|
const std::vector< std::string > & |
parentGridNames |
|
) |
| |
The vector form of CpGrid::addLgrsUpdateLeafView as block requests; parent names default to "GLOBAL". Throws std::invalid_argument when the sizes differ.
◆ boxBoundaryConnections()
| std::vector< BoundaryConnection > Opm::Refinement::boxBoundaryConnections |
( |
const std::array< int, 3 > & |
parentDims, |
|
|
const double * |
coord, |
|
|
const double * |
zcorn, |
|
|
const int * |
actnum, |
|
|
const BlockRefinement & |
box, |
|
|
int |
axis, |
|
|
int |
side, |
|
|
const std::optional< CellRange > & |
across |
|
) |
| |
Compute the connections at one box side, faulted or not, using the corner-point processor, so faults on that boundary are handled the same way faults elsewhere are: a refined boundary cell may connect to more than one coarse neighbour (the throw splits the face).
Builds a mini-grdecl covering the box plus a one-cell coarse shell on the (axis, side) side, refined to cellsPerDim, runs process_grdecl (which splits faces at faults and resolution jumps), and returns the faces between the box boundary cells and the shell (coarse-neighbour) cells, with the box's own sub-pillars. A piece facing the domain has no neighbour; on the edge of the grid there is no shell and every piece faces the domain.
axis in {0,1,2}; side in {-1, +1}. The side is processed edge-conformally, so the pieces of one cell pair list the same points along the edges they share and can be merged into one face. across holds the parent cells actually across the side; the mini region grows to cover it, since a throw puts them outside the box's own layers when it is taller than one cell next to them: thin cells across a fault, or a throw of two or more whole layers. It is std::nullopt only where no cell is across the side, at the edge of the grid.
◆ contains()
| bool Opm::Refinement::contains |
( |
const BlockRefinement & |
request, |
|
|
const std::array< int, 3 > & |
ijk |
|
) |
| |
Whether the parent cell with Cartesian index triplet ijk lies in the box: startIJK <= ijk < endIJK in every direction.
◆ edgeConformalizeLeaf()
Make a (refined) leaf grid edge-conformal: insert every leaf node that lies on the interior of a face's edge into that face's node list.
Local grid refinement introduces subdivision nodes on the pillars and lateral edges at the LGR boundary. Coarse cells that touch those edges (but are not the box's face-neighbour) carry the original 4-node faces, leaving those subdivision nodes "hanging" on the edges — fine for TPFA, but not edge-conformal (needed by VEM). This pass closes that gap.
Only face_to_point_ changes: no new corners are created (existing leaf nodes are inserted into face node lists, in order along each edge), so cell geometry, face area and normal are unchanged. Only corners some face uses are inserted. Each face edge looks at the corners in the buckets its bounding box covers, with buckets sized per direction to hold about one corner each.
◆ refineBlock()
| RefinedBlockGrdecl Opm::Refinement::refineBlock |
( |
const std::array< int, 3 > & |
parentDims, |
|
|
const double * |
coord, |
|
|
const double * |
zcorn, |
|
|
const int * |
actnum, |
|
|
const BlockRefinement & |
request |
|
) |
| |
Resample a block of a corner-point description onto refined sub-pillars.
Semantics are corner-point-native (what deck LGRs mean):
- COORD and ZCORN come from Opm::CornerPointRefinement, the functions the LGR grids opm-common builds use. A sub-pillar is, at every depth, the bilinear interpolation of its parent column's four pillar lines at that depth; refined pillars on parent pillar positions lie on the parent pillars.
- Refined zcorn values interpolate the parent cell's eight zcorn values trilinearly in the lateral/vertical fractions, and stay flat under a parent of zero thickness.
Faults and pinch-outs inside the block survive by construction: zcorn jumps across columns and collapsed cells resample to jumps/collapses on the refined lattice; matching them into faces is the (later) processing stage's job. Note that on inclined pillars this differs slightly from refining each hexahedron by its trilinear map (the old CpGrid approach); on vertical or parallel pillars the two coincide exactly.
- Parameters
-
| parentDims | Cartesian dimensions of the parent description. |
| coord | Parent COORD, 6*(nx+1)*(ny+1) doubles. |
| zcorn | Parent ZCORN, 8*nx*ny*nz doubles. |
| actnum | Parent ACTNUM (nx*ny*nz ints) or nullptr (all active). |
| request | The block to refine (startIJK/endIJK within parentDims). |
◆ refinedDims()
| std::array< int, 3 > Opm::Refinement::refinedDims |
( |
const BlockRefinement & |
request | ) |
|
Refined dimensions of the block: the subdivision sizes, which for a uniform request are box size times cellsPerDim.
◆ validateBlockRefinements()
| void Opm::Refinement::validateBlockRefinements |
( |
const std::vector< BlockRefinement > & |
requests, |
|
|
const std::map< std::string, int > & |
nameToLevel |
|
) |
| |
Validate a set of block requests: matching sizes are the caller's responsibility; this checks per-box consistency (start < end, positive subdivisions, graded columns that cover each parent cell from 0 to 1 in order, a MINPV mask with one entry per refined cell or none), pairwise disjointness of boxes sharing a parent grid, and that each box's parent grid exists already (a name in nameToLevel, the grid's CpGrid::getLgrNameToLevel()) or comes earlier in requests. Throws std::invalid_argument with a message naming the offending box(es).
|