# binwang0213/pygrdecl architecture

> Architecture diagram of the GitHub repository binwang0213/pygrdecl, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-15). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/binwang0213/pygrdecl
- Repository: https://github.com/binwang0213/pygrdecl

## Overview

PyGRDECL is a Python library for parsing Eclipse/Petrel GRDECL reservoir grids and properties, converting them to VTK unstructured-grid output, and optionally decomposing grids at faults or adding custom cell data. The documented workflow is driven through GeologyModel in GRDECL2VTK.py; GRDECL_Parser.py and GRDECL_FaultProcess.py provide distinct parsing and fault-processing responsibilities. The main conversion and fault-processing sources were not sampled, so their internal calls are not asserted; relationships shown between them follow the README workflow.

Main entry points: [`GRDECL2VTK.py`](https://github.com/binwang0213/pygrdecl/blob/master/GRDECL2VTK.py) (GeologyModel), [`GRDECL_Parser.py`](https://github.com/binwang0213/pygrdecl/blob/master/GRDECL_Parser.py) (GRDECL parser), [`GRDECL_FaultProcess.py`](https://github.com/binwang0213/pygrdecl/blob/master/GRDECL_FaultProcess.py) (Fault decomposition), [`utils.py`](https://github.com/binwang0213/pygrdecl/blob/master/utils.py) (Grid utilities)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_input["Grid input"]
  node_grdecl["GRDECL files"]
  node_custom_data["Custom cell data"]
  node_parser["GRDECL parser<br/>[GRDECL_Parser.py]"]
end

subgraph group_processing["Model processing"]
  node_model["GeologyModel<br/>[GRDECL2VTK.py]"]
  node_faults["Fault decomposition"]
  node_grid_utils["Grid utilities<br/>[utils.py]"]
end

subgraph group_output["VTK output"]
  node_vtk_file["VTU file"]
end

node_user(("Library user"))
node_paraview(("ParaView"))

node_user -->|"uses"| node_model
node_grdecl -->|"loads"| node_model
node_model -->|"parses"| node_parser
node_model -->|"decomposes"| node_faults
node_custom_data -->|"loads data"| node_model
node_model -.->|"uses"| node_grid_utils
node_model -->|"writes"| node_vtk_file
node_vtk_file -->|"opens"| node_paraview

click node_parser "https://github.com/binwang0213/pygrdecl/blob/master/GRDECL_Parser.py"
click node_model "https://github.com/binwang0213/pygrdecl/blob/master/GRDECL2VTK.py"
click node_faults "https://github.com/binwang0213/pygrdecl/blob/master/GRDECL_FaultProcess.py"
click node_grid_utils "https://github.com/binwang0213/pygrdecl/blob/master/utils.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_grdecl,node_custom_data,node_parser,node_user,node_paraview toneBlue
class node_model,node_faults,node_grid_utils toneAmber
class node_vtk_file toneMint
```

## Components

### Grid input

- **GRDECL files**
- **Custom cell data**
- [GRDECL parser](https://github.com/binwang0213/pygrdecl/blob/master/GRDECL_Parser.py): `GRDECL_Parser.py`

### Model processing

- [GeologyModel](https://github.com/binwang0213/pygrdecl/blob/master/GRDECL2VTK.py): `GRDECL2VTK.py`
- [Fault decomposition](https://github.com/binwang0213/pygrdecl/blob/master/GRDECL_FaultProcess.py): `GRDECL_FaultProcess.py`
- [Grid utilities](https://github.com/binwang0213/pygrdecl/blob/master/utils.py): `utils.py`

### VTK output

- **VTU file**

### Other components

- **Library user**
- **ParaView**

## Connections

- Library user → GeologyModel: uses (evidence: `README.md`)
- GRDECL files → GeologyModel: loads (evidence: `README.md`)
- GeologyModel → GRDECL parser: parses (evidence: `README.md`)
- GeologyModel → Fault decomposition: decomposes (evidence: `README.md`)
- Custom cell data → GeologyModel: loads data (evidence: `README.md`)
- GeologyModel → Grid utilities: uses
- GeologyModel → VTU file: writes (evidence: `README.md`)
- VTU file → ParaView: opens (evidence: `README.md`)
