# openfcst/openfcstv03 architecture

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

- Interactive diagram: https://gitdiagram.com/openfcst/openfcstv03
- Repository: https://github.com/openfcst/openfcstv03
- Video tour (about a minute): https://gitdiagram.com/openfcst/openfcstv03/video

## Overview

OpenFCST is a modular finite-element modeling toolbox for polymer electrolyte fuel cells. Its principal workflow is an engineer providing simulation parameters and a mesh, the command-line entry point selecting an application, and that application assembling fuel-cell physics for a nonlinear solve before writing visualization and response data. Separate capabilities include GUI parameter editing, mesh generation, and postprocessing/optimization utilities. The README and sampled sources support the main application and solve flow; links for unsampled integrations are omitted or shown only where documented.

Main entry points: [`src/fcst/source/applications/app_pemfc.cc`](https://github.com/openfcst/openfcstv03/blob/master/src/fcst/source/applications/app_pemfc.cc) (PEMFC application), [`src/fcst/source/utils/simulation_selector.cc`](https://github.com/openfcst/openfcstv03/blob/master/src/fcst/source/utils/simulation_selector.cc) (Simulation selector), [`src/fcst/source/application_core`](https://github.com/openfcst/openfcstv03/tree/master/src/fcst/source/application_core) (Application core), [`src/fcst/source/postprocessing/data_out.cc`](https://github.com/openfcst/openfcstv03/blob/master/src/fcst/source/postprocessing/data_out.cc) (Simulation output)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Simulation runtime"]
  node_cli["FCST command line<br/>[main.cc]"]
  node_builder["Simulator builder"]
  node_selector["Simulation selector"]
  node_app["PEMFC application<br/>[app_pemfc.cc]"]
  node_appvariants["Application variants"]
  node_appcore["Application core"]
  node_solver["Nonlinear solvers"]
end

subgraph group_physics["Fuel-cell physics"]
  node_equations["Transport equations"]
  node_layers["Fuel-cell layers"]
  node_materials["Materials and gases"]
  node_kinetics["Reaction kinetics"]
  node_micro["Microscale models"]
end

subgraph group_inputs["Model inputs"]
  node_input["Parameters"]
  node_meshgen["MEA mesh tools<br/>[mkMEAmesh.py]"]
  node_meshread["Mesh reader<br/>[app_read_mesh.cc]"]
end

subgraph group_analysis["Results and optimization"]
  node_responses["Responses"]
  node_dataout["Simulation output<br/>[data_out.cc]"]
  node_python["Python analysis tools"]
  node_paraview["ParaView plotting"]
  node_dakota["Dakota interface"]
end

subgraph group_gui["Parameter GUI"]
  node_guiapp["Parameter editor<br/>[main_window.cc]"]
  node_xmlread["XML parameter reader"]
  node_xmlwrite["XML parameter writer"]
end

node_engineer(("Engineer"))

node_engineer -->|"provides settings"| node_input
node_engineer -->|"configures geometry"| node_meshgen
node_meshgen -->|"exports mesh"| node_meshread
node_input -->|"supplies parameters"| node_cli
node_cli -->|"parses and runs"| node_builder
node_builder -->|"selects simulation"| node_selector
node_selector -->|"dispatches application"| node_app
node_selector -->|"dispatches application"| node_appvariants
node_app -->|"uses framework"| node_appcore
node_appvariants -->|"uses framework"| node_appcore
node_app -->|"reads mesh"| node_meshread
node_app -->|"assembles physics"| node_equations
node_app -->|"selects layer models"| node_layers
node_app -->|"initializes materials"| node_materials
node_app -->|"uses reaction models"| node_kinetics
node_app -.->|"uses microscale models"| node_micro
node_solver -->|"requests residual and solve"| node_appcore
node_appcore -->|"assembles system"| node_equations
node_app -->|"runs nonlinear solve"| node_solver
node_app -->|"computes responses"| node_responses
node_app -->|"writes solution"| node_dataout
node_dataout -->|"exports analysis data"| node_python
node_dataout -->|"exports VTK data"| node_paraview
node_engineer -->|"edits parameters"| node_guiapp
node_guiapp -->|"reads XML"| node_xmlread
node_guiapp -->|"writes XML"| node_xmlwrite
node_dakota -.->|"drives simulations"| node_selector

click node_meshgen "https://github.com/openfcst/openfcstv03/blob/master/pre_processing/mkMEAmesh.py"
click node_meshread "https://github.com/openfcst/openfcstv03/blob/master/src/fcst/source/applications/app_read_mesh.cc"
click node_cli "https://github.com/openfcst/openfcstv03/blob/master/src/fcst/source/main.cc"
click node_builder "https://github.com/openfcst/openfcstv03/blob/master/src/fcst/source/utils/simulator_builder.cc"
click node_selector "https://github.com/openfcst/openfcstv03/blob/master/src/fcst/source/utils/simulation_selector.cc"
click node_app "https://github.com/openfcst/openfcstv03/blob/master/src/fcst/source/applications/app_pemfc.cc"
click node_appvariants "https://github.com/openfcst/openfcstv03/tree/master/src/fcst/source/applications"
click node_appcore "https://github.com/openfcst/openfcstv03/tree/master/src/fcst/source/application_core"
click node_equations "https://github.com/openfcst/openfcstv03/tree/master/src/fcst/source/equations"
click node_layers "https://github.com/openfcst/openfcstv03/tree/master/src/fcst/source/layers"
click node_materials "https://github.com/openfcst/openfcstv03/tree/master/src/fcst/source/materials"
click node_kinetics "https://github.com/openfcst/openfcstv03/tree/master/src/fcst/source/reactions"
click node_micro "https://github.com/openfcst/openfcstv03/tree/master/src/fcst/source/microscale"
click node_solver "https://github.com/openfcst/openfcstv03/tree/master/src/fcst/source/solvers"
click node_responses "https://github.com/openfcst/openfcstv03/tree/master/src/fcst/source/postprocessing"
click node_dataout "https://github.com/openfcst/openfcstv03/blob/master/src/fcst/source/postprocessing/data_out.cc"
click node_python "https://github.com/openfcst/openfcstv03/tree/master/python/bin"
click node_paraview "https://github.com/openfcst/openfcstv03/blob/master/post_processing/PEMFC_Paraview_Plots.py"
click node_dakota "https://github.com/openfcst/openfcstv03/blob/master/src/fcst/source/contribs/dakota_application.cc"
click node_guiapp "https://github.com/openfcst/openfcstv03/blob/master/src/fcst/GUI/source/main_window.cc"
click node_xmlread "https://github.com/openfcst/openfcstv03/blob/master/src/fcst/GUI/contrib/xml_parameter_reader.cpp"
click node_xmlwrite "https://github.com/openfcst/openfcstv03/blob/master/src/fcst/GUI/contrib/xml_parameter_writer.cpp"

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_cli,node_builder,node_selector,node_app,node_appvariants,node_appcore,node_solver toneBlue
class node_equations,node_layers,node_materials,node_kinetics,node_micro toneAmber
class node_input,node_meshgen,node_meshread toneMint
class node_responses,node_dataout,node_python,node_paraview,node_dakota toneRose
class node_guiapp,node_xmlread,node_xmlwrite,node_engineer toneIndigo
```

## Components

### Simulation runtime

- [FCST command line](https://github.com/openfcst/openfcstv03/blob/master/src/fcst/source/main.cc): `src/fcst/source/main.cc`
- [Simulator builder](https://github.com/openfcst/openfcstv03/blob/master/src/fcst/source/utils/simulator_builder.cc): `src/fcst/source/utils/simulator_builder.cc`
- [Simulation selector](https://github.com/openfcst/openfcstv03/blob/master/src/fcst/source/utils/simulation_selector.cc): `src/fcst/source/utils/simulation_selector.cc`
- [PEMFC application](https://github.com/openfcst/openfcstv03/blob/master/src/fcst/source/applications/app_pemfc.cc): `src/fcst/source/applications/app_pemfc.cc`
- [Application variants](https://github.com/openfcst/openfcstv03/tree/master/src/fcst/source/applications): `src/fcst/source/applications`
- [Application core](https://github.com/openfcst/openfcstv03/tree/master/src/fcst/source/application_core): `src/fcst/source/application_core`
- [Nonlinear solvers](https://github.com/openfcst/openfcstv03/tree/master/src/fcst/source/solvers): `src/fcst/source/solvers`

### Fuel-cell physics

- [Transport equations](https://github.com/openfcst/openfcstv03/tree/master/src/fcst/source/equations): `src/fcst/source/equations`
- [Fuel-cell layers](https://github.com/openfcst/openfcstv03/tree/master/src/fcst/source/layers): `src/fcst/source/layers`
- [Materials and gases](https://github.com/openfcst/openfcstv03/tree/master/src/fcst/source/materials): `src/fcst/source/materials`
- [Reaction kinetics](https://github.com/openfcst/openfcstv03/tree/master/src/fcst/source/reactions): `src/fcst/source/reactions`
- [Microscale models](https://github.com/openfcst/openfcstv03/tree/master/src/fcst/source/microscale): `src/fcst/source/microscale`

### Model inputs

- **Parameters**
- [MEA mesh tools](https://github.com/openfcst/openfcstv03/blob/master/pre_processing/mkMEAmesh.py): `pre_processing/mkMEAmesh.py`
- [Mesh reader](https://github.com/openfcst/openfcstv03/blob/master/src/fcst/source/applications/app_read_mesh.cc): `src/fcst/source/applications/app_read_mesh.cc`

### Results and optimization

- [Responses](https://github.com/openfcst/openfcstv03/tree/master/src/fcst/source/postprocessing): `src/fcst/source/postprocessing`
- [Simulation output](https://github.com/openfcst/openfcstv03/blob/master/src/fcst/source/postprocessing/data_out.cc): `src/fcst/source/postprocessing/data_out.cc`
- [Python analysis tools](https://github.com/openfcst/openfcstv03/tree/master/python/bin): `python/bin`
- [ParaView plotting](https://github.com/openfcst/openfcstv03/blob/master/post_processing/PEMFC_Paraview_Plots.py): `post_processing/PEMFC_Paraview_Plots.py`
- [Dakota interface](https://github.com/openfcst/openfcstv03/blob/master/src/fcst/source/contribs/dakota_application.cc): `src/fcst/source/contribs/dakota_application.cc`

### Parameter GUI

- [Parameter editor](https://github.com/openfcst/openfcstv03/blob/master/src/fcst/GUI/source/main_window.cc): `src/fcst/GUI/source/main_window.cc`
- [XML parameter reader](https://github.com/openfcst/openfcstv03/blob/master/src/fcst/GUI/contrib/xml_parameter_reader.cpp): `src/fcst/GUI/contrib/xml_parameter_reader.cpp`
- [XML parameter writer](https://github.com/openfcst/openfcstv03/blob/master/src/fcst/GUI/contrib/xml_parameter_writer.cpp): `src/fcst/GUI/contrib/xml_parameter_writer.cpp`

### Other components

- **Engineer**

## Connections

- Engineer → Parameters: provides settings
- Engineer → MEA mesh tools: configures geometry
- MEA mesh tools → Mesh reader: exports mesh
- Parameters → FCST command line: supplies parameters
- FCST command line → Simulator builder: parses and runs
- Simulator builder → Simulation selector: selects simulation
- Simulation selector → PEMFC application: dispatches application
- Simulation selector → Application variants: dispatches application
- PEMFC application → Application core: uses framework
- Application variants → Application core: uses framework
- PEMFC application → Mesh reader: reads mesh
- PEMFC application → Transport equations: assembles physics
- PEMFC application → Fuel-cell layers: selects layer models
- PEMFC application → Materials and gases: initializes materials
- PEMFC application → Reaction kinetics: uses reaction models
- PEMFC application → Microscale models: uses microscale models
- Nonlinear solvers → Application core: requests residual and solve
- Application core → Transport equations: assembles system
- PEMFC application → Nonlinear solvers: runs nonlinear solve
- PEMFC application → Responses: computes responses
- PEMFC application → Simulation output: writes solution
- Simulation output → Python analysis tools: exports analysis data
- Simulation output → ParaView plotting: exports VTK data
- Engineer → Parameter editor: edits parameters
- Parameter editor → XML parameter reader: reads XML
- Parameter editor → XML parameter writer: writes XML
- Dakota interface → Simulation selector: drives simulations
