# bastiensauty/cornea_simple_mech_model architecture

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

- Interactive diagram: https://gitdiagram.com/bastiensauty/cornea_simple_mech_model
- Repository: https://github.com/bastiensauty/cornea_simple_mech_model

## Overview

This repository is an axisymmetric corneal hyperelastic finite-element model. Its main workflow loads a tagged mesh and material parameters, applies an intraocular-pressure load with boundary conditions, solves successive load steps, and records field and scalar results. A separate plotting workflow reads those results to produce histories, field maps, profiles, and animations, and can compare runs. The mesh reader, material-parameter model, mechanics solver, output manager, and plotting manager are distinct internal layers. Plotting-source excerpts are partial, so the graph shows documented capabilities without inferring their internal call structure.

Main entry points: [`main_cornea_axi.py`](https://github.com/bastiensauty/cornea_simple_mech_model/blob/main/main_cornea_axi.py) (Run simulation), [`Simulation_Framework/mechanical_axisymmetric_framework.py`](https://github.com/bastiensauty/cornea_simple_mech_model/blob/main/Simulation_Framework/mechanical_axisymmetric_framework.py) (Hyperelastic framework), [`Simulation_Framework/outputs_manager.py`](https://github.com/bastiensauty/cornea_simple_mech_model/blob/main/Simulation_Framework/outputs_manager.py) (Output manager), [`plot_cornea.py`](https://github.com/bastiensauty/cornea_simple_mech_model/blob/main/plot_cornea.py) (Plot example run)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_simulation["Simulation workflow"]
  node_run_script["Run simulation<br/>[main_cornea_axi.py]"]
  node_output_manager["Output manager<br/>[outputs_manager.py]"]
end

subgraph group_mechanics["Mechanical model"]
  node_mesh_io["Axisymmetric mesh reader"]
  node_mech_params["Material parameters"]
  node_framework["Hyperelastic framework"]
end

subgraph group_postprocess["Post-processing"]
  node_plot_script["Plot example run<br/>[plot_cornea.py]"]
  node_plot_manager["Plot manager<br/>[plots_manager.py]"]
end

subgraph group_data["Inputs and results"]
  node_mesh["Cornea mesh<br/>[cornea.msh]"]
  node_params_file["Material JSON<br/>[mech_params.json]"]
  node_field_results[("XDMF and HDF5 fields")]
  node_scalar_results["Scalar CSV"]
  node_figures["Plots and animations"]
end

node_engineer(("Simulation user"))

node_engineer -->|"runs"| node_run_script
node_engineer -->|"runs"| node_plot_script
node_run_script -->|"constructs"| node_framework
node_run_script -->|"selects"| node_params_file
node_run_script -->|"selects"| node_mesh
node_framework -->|"loads mesh"| node_mesh_io
node_mesh_io -->|"reads"| node_mesh
node_framework -->|"loads parameters"| node_mech_params
node_mech_params -->|"reads"| node_params_file
node_run_script -->|"sets conditions and solves"| node_framework
node_run_script -->|"writes each step"| node_output_manager
node_output_manager -->|"evaluates fields and scalars"| node_framework
node_output_manager -->|"writes fields"| node_field_results
node_output_manager -->|"writes scalars"| node_scalar_results
node_plot_script -->|"uses plotting API"| node_plot_manager
node_plot_manager -->|"reads fields"| node_field_results
node_plot_manager -->|"reads scalars"| node_scalar_results
node_plot_script -->|"saves figures"| node_figures

click node_run_script "https://github.com/bastiensauty/cornea_simple_mech_model/blob/main/main_cornea_axi.py"
click node_plot_script "https://github.com/bastiensauty/cornea_simple_mech_model/blob/main/plot_cornea.py"
click node_mesh "https://github.com/bastiensauty/cornea_simple_mech_model/blob/main/cornea.msh"
click node_params_file "https://github.com/bastiensauty/cornea_simple_mech_model/blob/main/mech_params.json"
click node_mesh_io "https://github.com/bastiensauty/cornea_simple_mech_model/blob/main/Simulation_Framework/axisymmetric_mesh_io.py"
click node_mech_params "https://github.com/bastiensauty/cornea_simple_mech_model/blob/main/Simulation_Framework/parameters_class.py"
click node_framework "https://github.com/bastiensauty/cornea_simple_mech_model/blob/main/Simulation_Framework/mechanical_axisymmetric_framework.py"
click node_output_manager "https://github.com/bastiensauty/cornea_simple_mech_model/blob/main/Simulation_Framework/outputs_manager.py"
click node_plot_manager "https://github.com/bastiensauty/cornea_simple_mech_model/blob/main/Simulation_Framework/plots_manager.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_run_script,node_output_manager,node_engineer toneBlue
class node_mesh_io,node_mech_params,node_framework toneAmber
class node_plot_script,node_plot_manager toneMint
class node_mesh,node_params_file,node_field_results,node_scalar_results,node_figures toneRose
```

## Components

### Simulation workflow

- [Run simulation](https://github.com/bastiensauty/cornea_simple_mech_model/blob/main/main_cornea_axi.py): `main_cornea_axi.py`
- [Output manager](https://github.com/bastiensauty/cornea_simple_mech_model/blob/main/Simulation_Framework/outputs_manager.py): `Simulation_Framework/outputs_manager.py`

### Mechanical model

- [Axisymmetric mesh reader](https://github.com/bastiensauty/cornea_simple_mech_model/blob/main/Simulation_Framework/axisymmetric_mesh_io.py): `Simulation_Framework/axisymmetric_mesh_io.py`
- [Material parameters](https://github.com/bastiensauty/cornea_simple_mech_model/blob/main/Simulation_Framework/parameters_class.py): `Simulation_Framework/parameters_class.py`
- [Hyperelastic framework](https://github.com/bastiensauty/cornea_simple_mech_model/blob/main/Simulation_Framework/mechanical_axisymmetric_framework.py): `Simulation_Framework/mechanical_axisymmetric_framework.py`

### Post-processing

- [Plot example run](https://github.com/bastiensauty/cornea_simple_mech_model/blob/main/plot_cornea.py): `plot_cornea.py`
- [Plot manager](https://github.com/bastiensauty/cornea_simple_mech_model/blob/main/Simulation_Framework/plots_manager.py): `Simulation_Framework/plots_manager.py`

### Inputs and results

- [Cornea mesh](https://github.com/bastiensauty/cornea_simple_mech_model/blob/main/cornea.msh): `cornea.msh`
- [Material JSON](https://github.com/bastiensauty/cornea_simple_mech_model/blob/main/mech_params.json): `mech_params.json`
- **XDMF and HDF5 fields**
- **Scalar CSV**
- **Plots and animations**

### Other components

- **Simulation user**

## Connections

- Simulation user → Run simulation: runs
- Simulation user → Plot example run: runs
- Run simulation → Hyperelastic framework: constructs
- Run simulation → Material JSON: selects
- Run simulation → Cornea mesh: selects
- Hyperelastic framework → Axisymmetric mesh reader: loads mesh
- Axisymmetric mesh reader → Cornea mesh: reads
- Hyperelastic framework → Material parameters: loads parameters
- Material parameters → Material JSON: reads
- Run simulation → Hyperelastic framework: sets conditions and solves
- Run simulation → Output manager: writes each step
- Output manager → Hyperelastic framework: evaluates fields and scalars
- Output manager → XDMF and HDF5 fields: writes fields
- Output manager → Scalar CSV: writes scalars
- Plot example run → Plot manager: uses plotting API
- Plot manager → XDMF and HDF5 fields: reads fields
- Plot manager → Scalar CSV: reads scalars
- Plot example run → Plots and animations: saves figures
