# filippo-masi/tann-multiscale architecture

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

- Interactive diagram: https://gitdiagram.com/filippo-masi/tann-multiscale
- Repository: https://github.com/filippo-masi/tann-multiscale

## Overview

This repository implements a two-scale inelastic-material workflow: lattice finite-element simulations generate homogenized and microstructural response data, while a trained thermodynamics-based neural-network material is applied in a Numerical Geolab finite-element torsion analysis. The scripts also provide prescribed-path data generation and direct lattice torsion simulation. The sampled sources support the lattice build/solve and the AI material invocation; the documented training process and parts of the Geolab solver internals are not present in the excerpts, so those links are limited to explicit entry-point usage.

Main entry points: [`TANN - Numerical Geolab/numerical_geolab/Numerical_Geolab/AI_example/TANN_application.py`](https://github.com/filippo-masi/tann-multiscale/blob/main/TANN%20-%20Numerical%20Geolab/numerical_geolab/Numerical_Geolab/AI_example/TANN_application.py) (Torsion FE application), [`lattice/lattice_class/lattice_material.py`](https://github.com/filippo-masi/tann-multiscale/blob/main/lattice/lattice_class/lattice_material.py) (Lattice FE core), [`lattice/lattice_data_gen.py`](https://github.com/filippo-masi/tann-multiscale/blob/main/lattice/lattice_data_gen.py) (Data generation), [`lattice/lattice_torsional.py`](https://github.com/filippo-masi/tann-multiscale/blob/main/lattice/lattice_torsional.py) (Lattice torsion)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_lattice["Lattice mechanics"]
  node_path_run["Prescribed path"]
  node_data_run["Data generation"]
  node_torsion_run["Lattice torsion"]
  node_lattice_core["Lattice FE core"]
  node_samples["Lattice response"]
end

subgraph group_ai["TANN material"]
  node_training["TANN training"]
  node_saved_model["Saved network<br/>[saved_model.pb]"]
  node_ai_material["AI material adapter<br/>[AI_material.py]"]
end

subgraph group_macro["Geolab simulation"]
  node_application["Torsion FE application"]
  node_geolab["Geolab FE engine"]
end

subgraph group_outputs["Results"]
  node_fe_results["FE response"]
  node_result_files["Exported results"]
  node_visualization["Deformation plots"]
end

node_researcher(("Analyst"))

node_researcher -->|"runs path"| node_path_run
node_researcher -->|"generates data"| node_data_run
node_researcher -->|"runs torsion"| node_torsion_run
node_path_run -->|"calls solver"| node_lattice_core
node_data_run -->|"calls solver"| node_lattice_core
node_torsion_run -->|"calls solver"| node_lattice_core
node_lattice_core -->|"returns response"| node_samples
node_data_run -->|"extracts response"| node_samples
node_researcher -.->|"trains model"| node_training
node_training -.->|"exports model"| node_saved_model
node_researcher -->|"runs analysis"| node_application
node_application -->|"solves FE problem"| node_geolab
node_application -->|"instantiates material"| node_ai_material
node_ai_material -->|"loads network"| node_saved_model
node_geolab -->|"requests material response"| node_ai_material
node_geolab -->|"produces fields"| node_fe_results
node_application -->|"exports arrays"| node_result_files
node_application -->|"plots deformation"| node_visualization
node_torsion_run -->|"plots deformation"| node_visualization

click node_path_run "https://github.com/filippo-masi/tann-multiscale/blob/main/lattice/lattice_prescribed_path.py"
click node_data_run "https://github.com/filippo-masi/tann-multiscale/blob/main/lattice/lattice_data_gen.py"
click node_torsion_run "https://github.com/filippo-masi/tann-multiscale/blob/main/lattice/lattice_torsional.py"
click node_lattice_core "https://github.com/filippo-masi/tann-multiscale/blob/main/lattice/lattice_class/lattice_material.py"
click node_training "https://github.com/filippo-masi/tann-multiscale/tree/main/TANN%20-%20Numerical%20Geolab/numerical_geolab/Numerical_Geolab"
click node_saved_model "https://github.com/filippo-masi/tann-multiscale/blob/main/TANN%20-%20Numerical%20Geolab/numerical_geolab_materials/UMATERIALS/TANN_material/saved_model.pb"
click node_ai_material "https://github.com/filippo-masi/tann-multiscale/blob/main/TANN%20-%20Numerical%20Geolab/numerical_geolab/Numerical_Geolab/ngeoAI/AI_material.py"
click node_application "https://github.com/filippo-masi/tann-multiscale/blob/main/TANN%20-%20Numerical%20Geolab/numerical_geolab/Numerical_Geolab/AI_example/TANN_application.py"
click node_geolab "https://github.com/filippo-masi/tann-multiscale/tree/main/TANN%20-%20Numerical%20Geolab/numerical_geolab/Numerical_Geolab"
click node_result_files "https://github.com/filippo-masi/tann-multiscale/tree/main/TANN%20-%20Numerical%20Geolab/numerical_geolab/Numerical_Geolab/AI_example/results"

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_path_run,node_data_run,node_torsion_run,node_lattice_core,node_samples toneBlue
class node_training,node_saved_model,node_ai_material toneAmber
class node_application,node_geolab toneMint
class node_fe_results,node_result_files,node_visualization toneRose
class node_researcher toneIndigo
```

## Components

### Lattice mechanics

- [Prescribed path](https://github.com/filippo-masi/tann-multiscale/blob/main/lattice/lattice_prescribed_path.py): `lattice/lattice_prescribed_path.py`
- [Data generation](https://github.com/filippo-masi/tann-multiscale/blob/main/lattice/lattice_data_gen.py): `lattice/lattice_data_gen.py`
- [Lattice torsion](https://github.com/filippo-masi/tann-multiscale/blob/main/lattice/lattice_torsional.py): `lattice/lattice_torsional.py`
- [Lattice FE core](https://github.com/filippo-masi/tann-multiscale/blob/main/lattice/lattice_class/lattice_material.py): `lattice/lattice_class/lattice_material.py`
- **Lattice response**

### TANN material

- [TANN training](https://github.com/filippo-masi/tann-multiscale/tree/main/TANN%20-%20Numerical%20Geolab/numerical_geolab/Numerical_Geolab): `TANN - Numerical Geolab/numerical_geolab/Numerical_Geolab`
- [Saved network](https://github.com/filippo-masi/tann-multiscale/blob/main/TANN%20-%20Numerical%20Geolab/numerical_geolab_materials/UMATERIALS/TANN_material/saved_model.pb): `TANN - Numerical Geolab/numerical_geolab_materials/UMATERIALS/TANN_material/saved_model.pb`
- [AI material adapter](https://github.com/filippo-masi/tann-multiscale/blob/main/TANN%20-%20Numerical%20Geolab/numerical_geolab/Numerical_Geolab/ngeoAI/AI_material.py): `TANN - Numerical Geolab/numerical_geolab/Numerical_Geolab/ngeoAI/AI_material.py`

### Geolab simulation

- [Torsion FE application](https://github.com/filippo-masi/tann-multiscale/blob/main/TANN%20-%20Numerical%20Geolab/numerical_geolab/Numerical_Geolab/AI_example/TANN_application.py): `TANN - Numerical Geolab/numerical_geolab/Numerical_Geolab/AI_example/TANN_application.py`
- [Geolab FE engine](https://github.com/filippo-masi/tann-multiscale/tree/main/TANN%20-%20Numerical%20Geolab/numerical_geolab/Numerical_Geolab): `TANN - Numerical Geolab/numerical_geolab/Numerical_Geolab`

### Results

- **FE response**
- [Exported results](https://github.com/filippo-masi/tann-multiscale/tree/main/TANN%20-%20Numerical%20Geolab/numerical_geolab/Numerical_Geolab/AI_example/results): `TANN - Numerical Geolab/numerical_geolab/Numerical_Geolab/AI_example/results`
- **Deformation plots**

### Other components

- **Analyst**

## Connections

- Analyst → Prescribed path: runs path
- Analyst → Data generation: generates data
- Analyst → Lattice torsion: runs torsion
- Prescribed path → Lattice FE core: calls solver
- Data generation → Lattice FE core: calls solver
- Lattice torsion → Lattice FE core: calls solver
- Lattice FE core → Lattice response: returns response
- Data generation → Lattice response: extracts response
- Analyst → TANN training: trains model
- TANN training → Saved network: exports model
- Analyst → Torsion FE application: runs analysis
- Torsion FE application → Geolab FE engine: solves FE problem
- Torsion FE application → AI material adapter: instantiates material
- AI material adapter → Saved network: loads network
- Geolab FE engine → AI material adapter: requests material response
- Geolab FE engine → FE response: produces fields
- Torsion FE application → Exported results: exports arrays
- Torsion FE application → Deformation plots: plots deformation
- Lattice torsion → Deformation plots: plots deformation
