Implementing corner point grids meshes in GEOSX
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 287
- Forks
- 109
- Avg merge
- 4d 41m
- Merged PRs (30d)
- 5
Description
What is the requested feature?
Hello, @francoishamon and myself need to get Corner Point Grids (CPG) inside of GEOSX (see COORD, ZCORN, ACTNUM).
CPG have lots of crazy cells, some with 22 faces… In a nutshell, those cells follow no rule.
So we surely to modify GEOSX to support this kind of meshes.
Below a first proposition, please give me your comments.
Summary of the current situation. On top, an abstract base class MeshGeneratorBase, imposes virtual void generateMesh(DomainPartition&domain)=0 as unique API.
The 3 implementations of MeshGeneratorBase (PAMELAMeshGenerator, InternalMeshGenerator, InternalWellboreGenerator) mainly respect the following same pattern.
- Register some parallel split information; retrieve
cellBlockMgrandnodeMgr. - The
nodeMgris filled with node positions, node sets, local->global mappings - For each type of cell, we fill a
CellBlockwith the node list, some local->global mappings, some properties/fields. - Surfaces are registered in node sets
After the MeshGeneratorBase::generateMesh( domain ) has been called, inside of ProblemManager::generateMesh
- Node data is already in the
nodeMgr - Contents of
cellBlocksare copied intoelementMgr
Followed by
faceMgrbuilds facesedgeMgrbuilds edgeselementMgr,faceMgr,nodeMgrbuild theirelementMaps,faceMaps,edgeMaps, etc.
Describe the solution you'd like
This is the current hierarchy
ObjectManagerBase
├── ElementRegionBase
│ ├── CellElementRegionBase
│ ├── SurfaceElementRegion
│ └── WellElementRegion
├── ElementSubRegionBase
│ ├── CellBlock
│ │ └── CellElementSubRegion
│ ├── SurfaceElementSubRegion
│ │ ├── EmbeddedSurfaceSubRegion
│ │ └── FaceElementSubRegion
│ └── WellElementSubRegion
├── EdgeManager
├── ElementRegionManager
├── FaceManager
└── NodeManager
Because of corner point grids (CPG), we cannot not always build faces and edges anymore (it contains lots of cells that obey no rule, no convention). I would like to be able to use an abstracted mesh in our "populating process" in order not to rely on if/then/else that are hell to maintain.
My proposition is to remove the building of cell/face/edge/node connections from the managers and make it be implemented behind an abstract API around the MeshGeneratorBase.
- Today
CellBlockis unique in theElementSubRegionBasehierarchy (SurfaceandWelldon't really have it). I suggest to remove it from the hierarchy to get symmetry back.- The lost features of
CellBlockare transferred inCellElementSubRegionnot to break everything
- The lost features of
- Then we could create an abstract
CellBlockBase,FaceBlockBase,EdgeBlockBasehierarchy asideMeshGeneratorBase. The current mesh generators will use the currentbuildFaces,buildEdgesin their implementations. CPG implementation will simply return a list read from a file, or any other implementation.- Build the abstract API to plug into current managers implementation
- Move the
FaceManager::buildFaces,EdgeManager::buildEdgesinto theCellBlock,FaceBlock,EdgeBlockhierarchy. - Maybe move the
nodeList,faceListetc. maps construction there too? I don't know.
- Adapt
MeshGeneratorBase::generateMeshaccordingly (maybe returns someCellBlockBase,FaceBlockBase,EdgeBlockBasecontainers?)
This new design must be validated w.r.t. current meshes before implementing CPG.
For CPG we have a lot of crazy cells -> it's not really possible to keep one cell type per ElementSubRegion. Do we want to introduce an ElementHeterogeneousSubRegion and ElementHomegeneousSubRegion (or something like this?). Can we accept one ElementSubRegion with some mixed cells (dangerous I think)?
Are there strong implicit commitments for this homogeneous assumption throughout the code that needs attention?
Do we need to have one version for homogenous and another for heterogeneous? Is it worth the price?
Please feel free to comment.
We can set up an on-line meeting if needed.
Describe alternatives you've considered
None
Additional context
PS Partition: We have an abstract base class PartitionBase with one unique implementation, SpatialPartition. At some locations here and there we seem to assume implicitly that we are using SpatialPartition and not the abstraction. And we do some tricks when using metis. I do not know if we'll have to modify this (it's next to the path, but maybe not on the path), but having a MetisPartition and using PartitionBase seems to be a promising solution.
We must try to provide some results on mid-june. Which means that wee have both some time and lots of word 🤷
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading MeshGeneratorBase::generateMesh and the current PAMELAMeshGenerator, InternalMeshGenerator, and InternalWellboreGenerator implementations. Then trace FaceManager::buildFaces, EdgeManager::buildEdges, and the CellBlock hierarchy to understand their assumptions about homogeneous cells and connectivity. Done means agreeing on an abstraction that preserves current mesh behavior and can represent Corner Point Grid connectivity.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- hpc
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100