# geos-dev/geos architecture

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

- Interactive diagram: https://gitdiagram.com/geos-dev/geos
- Repository: https://github.com/geos-dev/geos

## Overview

GEOS is a subsurface simulation framework for coupled flow, transport, and geomechanics, with applications including carbon sequestration and geothermal energy. The main workflow is to launch a simulation, initialize its problem state and mesh, apply initial conditions, run the simulation, and produce results. The graph preserves the major physics and numerical subsystems named by the README and source tree. Some subsystem links are dashed because the available excerpts do not show their runtime wiring.

Main entry points: [`src/coreComponents/mainInterface/ProblemManager.cpp`](https://github.com/geos-dev/geos/blob/develop/src/coreComponents/mainInterface/ProblemManager.cpp) (Problem manager), [`src/coreComponents/physicsSolvers/PhysicsSolverManager.cpp`](https://github.com/geos-dev/geos/blob/develop/src/coreComponents/physicsSolvers/PhysicsSolverManager.cpp) (Physics solver manager), [`src/main/main.cpp`](https://github.com/geos-dev/geos/blob/develop/src/main/main.cpp) (CLI entry point), [`src/coreComponents/constitutive/ConstitutiveManager.hpp`](https://github.com/geos-dev/geos/blob/develop/src/coreComponents/constitutive/ConstitutiveManager.hpp) (Constitutive models)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Runtime orchestration"]
  node_main["CLI entry point<br/>[main.cpp]"]
  node_init["Runtime initialization<br/>[initialization.hpp]"]
  node_state["Simulation state<br/>[GeosxState.hpp]"]
  node_problem["Problem manager<br/>[ProblemManager.cpp]"]
  node_events["Simulation tasks<br/>[TasksManager.cpp]"]
end

subgraph group_domain["Problem and mesh"]
  node_input["Problem input<br/>[ProblemManager.cpp]"]
  node_meshgen["Mesh generation"]
  node_domainpart["Domain partition"]
  node_regions["Element regions"]
end

subgraph group_physics["Physics models"]
  node_solvermgr["Physics solver manager"]
  node_flow["Flow and transport"]
  node_wells["Well controls<br/>[WellManager.cpp]"]
  node_geomech["Geomechanics"]
  node_constitutive["Constitutive models"]
end

subgraph group_numerics["Numerics and results"]
  node_discretization["Discretization"]
  node_dofs["DOF management<br/>[DofManager.cpp]"]
  node_outputs["Result output<br/>[OutputManager.hpp]"]
end

node_user(("Simulation user"))

node_user -->|"launches"| node_main
node_main -->|"initializes"| node_init
node_main -->|"creates state"| node_state
node_state -.->|"runs problem"| node_problem
node_problem -->|"parses"| node_input
node_problem -->|"generates mesh"| node_meshgen
node_problem -->|"configures domain"| node_domainpart
node_domainpart -.->|"organizes regions"| node_regions
node_problem -->|"configures solvers"| node_solvermgr
node_solvermgr -.->|"dispatches physics"| node_flow
node_solvermgr -.->|"dispatches physics"| node_geomech
node_solvermgr -->|"uses methods"| node_discretization
node_solvermgr -->|"configures tasks"| node_events
node_wells -->|"registers fields"| node_dofs
node_problem -->|"configures models"| node_constitutive
node_problem -.->|"writes results"| node_outputs
node_flow -.->|"uses models"| node_constitutive
node_geomech -.->|"uses models"| node_constitutive

click node_main "https://github.com/geos-dev/geos/blob/develop/src/main/main.cpp"
click node_init "https://github.com/geos-dev/geos/blob/develop/src/coreComponents/mainInterface/initialization.hpp"
click node_state "https://github.com/geos-dev/geos/blob/develop/src/coreComponents/mainInterface/GeosxState.hpp"
click node_problem "https://github.com/geos-dev/geos/blob/develop/src/coreComponents/mainInterface/ProblemManager.cpp"
click node_input "https://github.com/geos-dev/geos/blob/develop/src/coreComponents/mainInterface/ProblemManager.cpp"
click node_meshgen "https://github.com/geos-dev/geos/blob/develop/src/coreComponents/mesh/generators/CellBlockManager.cpp"
click node_domainpart "https://github.com/geos-dev/geos/blob/develop/src/coreComponents/mesh/DomainPartition.hpp"
click node_regions "https://github.com/geos-dev/geos/blob/develop/src/coreComponents/mesh/ElementRegionManager.hpp"
click node_solvermgr "https://github.com/geos-dev/geos/blob/develop/src/coreComponents/physicsSolvers/PhysicsSolverManager.cpp"
click node_flow "https://github.com/geos-dev/geos/tree/develop/src/coreComponents/physicsSolvers"
click node_wells "https://github.com/geos-dev/geos/blob/develop/src/coreComponents/physicsSolvers/fluidFlow/wells/WellManager.cpp"
click node_geomech "https://github.com/geos-dev/geos/tree/develop/src/coreComponents/physicsSolvers"
click node_constitutive "https://github.com/geos-dev/geos/blob/develop/src/coreComponents/constitutive/ConstitutiveManager.hpp"
click node_discretization "https://github.com/geos-dev/geos/blob/develop/src/coreComponents/discretizationMethods/NumericalMethodsManager.hpp"
click node_dofs "https://github.com/geos-dev/geos/blob/develop/src/coreComponents/linearAlgebra/DofManager.cpp"
click node_events "https://github.com/geos-dev/geos/blob/develop/src/coreComponents/events/tasks/TasksManager.cpp"
click node_outputs "https://github.com/geos-dev/geos/blob/develop/src/coreComponents/fileIO/Outputs/OutputManager.hpp"

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_main,node_init,node_state,node_problem,node_events,node_user toneBlue
class node_input,node_meshgen,node_domainpart,node_regions toneAmber
class node_solvermgr,node_flow,node_wells,node_geomech,node_constitutive toneMint
class node_discretization,node_dofs,node_outputs toneRose
```

## Components

### Runtime orchestration

- [CLI entry point](https://github.com/geos-dev/geos/blob/develop/src/main/main.cpp): `src/main/main.cpp`
- [Runtime initialization](https://github.com/geos-dev/geos/blob/develop/src/coreComponents/mainInterface/initialization.hpp): `src/coreComponents/mainInterface/initialization.hpp`
- [Simulation state](https://github.com/geos-dev/geos/blob/develop/src/coreComponents/mainInterface/GeosxState.hpp): `src/coreComponents/mainInterface/GeosxState.hpp`
- [Problem manager](https://github.com/geos-dev/geos/blob/develop/src/coreComponents/mainInterface/ProblemManager.cpp): `src/coreComponents/mainInterface/ProblemManager.cpp`
- [Simulation tasks](https://github.com/geos-dev/geos/blob/develop/src/coreComponents/events/tasks/TasksManager.cpp): `src/coreComponents/events/tasks/TasksManager.cpp`

### Problem and mesh

- [Problem input](https://github.com/geos-dev/geos/blob/develop/src/coreComponents/mainInterface/ProblemManager.cpp): `src/coreComponents/mainInterface/ProblemManager.cpp`
- [Mesh generation](https://github.com/geos-dev/geos/blob/develop/src/coreComponents/mesh/generators/CellBlockManager.cpp): `src/coreComponents/mesh/generators/CellBlockManager.cpp`
- [Domain partition](https://github.com/geos-dev/geos/blob/develop/src/coreComponents/mesh/DomainPartition.hpp): `src/coreComponents/mesh/DomainPartition.hpp`
- [Element regions](https://github.com/geos-dev/geos/blob/develop/src/coreComponents/mesh/ElementRegionManager.hpp): `src/coreComponents/mesh/ElementRegionManager.hpp`

### Physics models

- [Physics solver manager](https://github.com/geos-dev/geos/blob/develop/src/coreComponents/physicsSolvers/PhysicsSolverManager.cpp): `src/coreComponents/physicsSolvers/PhysicsSolverManager.cpp`
- [Flow and transport](https://github.com/geos-dev/geos/tree/develop/src/coreComponents/physicsSolvers): `src/coreComponents/physicsSolvers`
- [Well controls](https://github.com/geos-dev/geos/blob/develop/src/coreComponents/physicsSolvers/fluidFlow/wells/WellManager.cpp): `src/coreComponents/physicsSolvers/fluidFlow/wells/WellManager.cpp`
- [Geomechanics](https://github.com/geos-dev/geos/tree/develop/src/coreComponents/physicsSolvers): `src/coreComponents/physicsSolvers`
- [Constitutive models](https://github.com/geos-dev/geos/blob/develop/src/coreComponents/constitutive/ConstitutiveManager.hpp): `src/coreComponents/constitutive/ConstitutiveManager.hpp`

### Numerics and results

- [Discretization](https://github.com/geos-dev/geos/blob/develop/src/coreComponents/discretizationMethods/NumericalMethodsManager.hpp): `src/coreComponents/discretizationMethods/NumericalMethodsManager.hpp`
- [DOF management](https://github.com/geos-dev/geos/blob/develop/src/coreComponents/linearAlgebra/DofManager.cpp): `src/coreComponents/linearAlgebra/DofManager.cpp`
- [Result output](https://github.com/geos-dev/geos/blob/develop/src/coreComponents/fileIO/Outputs/OutputManager.hpp): `src/coreComponents/fileIO/Outputs/OutputManager.hpp`

### Other components

- **Simulation user**

## Connections

- Simulation user → CLI entry point: launches (evidence: `src/main/main.cpp`)
- CLI entry point → Runtime initialization: initializes (evidence: `src/main/main.cpp`)
- CLI entry point → Simulation state: creates state (evidence: `src/main/main.cpp`)
- Simulation state → Problem manager: runs problem (evidence: `src/coreComponents/mainInterface/ProblemManager.cpp`)
- Problem manager → Problem input: parses (evidence: `src/coreComponents/mainInterface/ProblemManager.cpp`)
- Problem manager → Mesh generation: generates mesh (evidence: `src/coreComponents/mainInterface/ProblemManager.cpp`)
- Problem manager → Domain partition: configures domain (evidence: `src/coreComponents/mainInterface/ProblemManager.cpp`)
- Domain partition → Element regions: organizes regions
- Problem manager → Physics solver manager: configures solvers (evidence: `src/coreComponents/mainInterface/ProblemManager.cpp`)
- Physics solver manager → Flow and transport: dispatches physics
- Physics solver manager → Geomechanics: dispatches physics
- Physics solver manager → Discretization: uses methods
- Physics solver manager → Simulation tasks: configures tasks
- Well controls → DOF management: registers fields (evidence: `src/coreComponents/physicsSolvers/fluidFlow/wells/WellManager.cpp`)
- Problem manager → Constitutive models: configures models (evidence: `src/coreComponents/mainInterface/ProblemManager.cpp`)
- Problem manager → Result output: writes results (evidence: `src/coreComponents/mainInterface/ProblemManager.cpp`)
- Flow and transport → Constitutive models: uses models
- Geomechanics → Constitutive models: uses models
