# sorao0921/biaxial-cpfem architecture

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

- Interactive diagram: https://gitdiagram.com/sorao0921/biaxial-cpfem
- Repository: https://github.com/sorao0921/biaxial-cpfem

## Overview

This repository supports a crystal-plasticity research workflow: prepare LS-DYNA models from mesh and orientation inputs, run external analyses, extract and normalize result data, then investigate roughness mechanisms and evaluate height/valley predictions. Separate branches calculate physical indicators and graph-frequency height bands; a catalog and dashboards support comparison and readiness review. The README documents the broad pipeline and capabilities, while excerpts show selected calls; links for unsampled subsystems are included only where the README establishes them.

Main entry points: [`src/make_model_process/write_keyword.py`](https://github.com/sorao0921/biaxial-cpfem/blob/main/src/make_model_process/write_keyword.py) (Model assembly), [`src/postprocess/case_data.py`](https://github.com/sorao0921/biaxial-cpfem/blob/main/src/postprocess/case_data.py) (Case data resolution), [`src/crystal_plasticity/taylor_factor.py`](https://github.com/sorao0921/biaxial-cpfem/blob/main/src/crystal_plasticity/taylor_factor.py) (Crystal-plasticity metrics), [`tools/UI/app.py`](https://github.com/sorao0921/biaxial-cpfem/blob/main/tools/UI/app.py) (Comparison dashboard)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_prep["Model preparation"]
  node_mesh["Mesh processing<br/>[mesh.py]"]
  node_keyword["Keyword formatting<br/>[keyword_format.py]"]
  node_model["Model assembly<br/>[write_keyword.py]"]
  node_spatial["Spatial model<br/>[spatial_model.py]"]
end

subgraph group_analysis["Extraction and indicators"]
  node_extract["Result extraction"]
  node_normalize["Edge and ID processing<br/>[pipeline.py]"]
  node_case_data["Case data resolution<br/>[case_data.py]"]
  node_crystal["Crystal-plasticity metrics<br/>[taylor_factor.py]"]
  node_taylor["State Taylor workflow<br/>[taylor_pipeline.py]"]
  node_slip["Slip activity workflow"]
  node_spectral["Height bands<br/>[graph_spectral.py]"]
end

subgraph group_research["Mechanism and prediction"]
  node_theme1["Mechanism analysis<br/>[contribution.py]"]
  node_initial_taylor["Initial Taylor prediction"]
  node_theme2["Height prediction models<br/>[initial_height.py]"]
  node_valleys["Valley evaluation"]
end

subgraph group_data["Catalog and visualization"]
  node_catalog[("Output catalog<br/>[catalog.py]")]
  node_dashboards["Comparison dashboard<br/>[app.py]"]
  node_plots["Plot rendering<br/>[plots.py]"]
  node_readiness["Readiness dashboard<br/>[readiness_app.py]"]
end

node_researcher(("Researcher"))
node_inputs["Mesh and orientations"]
node_solver{{"LS-DYNA"}}
node_outputs[("Processed results")]

node_researcher -->|"prepares cases"| node_model
node_inputs -->|"provides mesh"| node_mesh
node_mesh -->|"formats geometry"| node_model
node_keyword -->|"formats keywords"| node_model
node_model -->|"runs externally"| node_solver
node_model -->|"exports geometry"| node_spatial
node_solver -->|"produces results"| node_extract
node_extract -->|"supplies CSVs"| node_normalize
node_normalize -->|"writes results"| node_outputs
node_outputs -->|"provides artifacts"| node_case_data
node_outputs -->|"supplies orientations"| node_crystal
node_crystal -->|"solves factors"| node_taylor
node_outputs -->|"supplies shear data"| node_slip
node_case_data -->|"provides height cases"| node_spectral
node_case_data -->|"supports analysis"| node_theme1
node_crystal -->|"solves slip response"| node_initial_taylor
node_outputs -->|"provides reference data"| node_theme2
node_theme2 -->|"evaluates predictions"| node_valleys
node_outputs -->|"scans artifacts"| node_catalog
node_researcher -->|"compares results"| node_dashboards
node_dashboards -->|"selects cases"| node_catalog
node_dashboards -->|"renders comparisons"| node_plots
node_researcher -->|"checks preparation"| node_readiness

click node_mesh "https://github.com/sorao0921/biaxial-cpfem/blob/main/src/pre_process/mesh.py"
click node_keyword "https://github.com/sorao0921/biaxial-cpfem/blob/main/src/pre_process/keyword_format.py"
click node_model "https://github.com/sorao0921/biaxial-cpfem/blob/main/src/make_model_process/write_keyword.py"
click node_spatial "https://github.com/sorao0921/biaxial-cpfem/blob/main/src/mapping/spatial_model.py"
click node_extract "https://github.com/sorao0921/biaxial-cpfem/blob/main/tools/superdyna4/extract_surface_coords.py"
click node_normalize "https://github.com/sorao0921/biaxial-cpfem/blob/main/src/extract_process/pipeline.py"
click node_case_data "https://github.com/sorao0921/biaxial-cpfem/blob/main/src/postprocess/case_data.py"
click node_crystal "https://github.com/sorao0921/biaxial-cpfem/blob/main/src/crystal_plasticity/taylor_factor.py"
click node_taylor "https://github.com/sorao0921/biaxial-cpfem/blob/main/src/crystal_plasticity/taylor_pipeline.py"
click node_slip "https://github.com/sorao0921/biaxial-cpfem/blob/main/src/crystal_plasticity/slip_activity_pipeline.py"
click node_spectral "https://github.com/sorao0921/biaxial-cpfem/blob/main/src/postprocess/graph_spectral.py"
click node_theme1 "https://github.com/sorao0921/biaxial-cpfem/blob/main/src/theme1/contribution.py"
click node_initial_taylor "https://github.com/sorao0921/biaxial-cpfem/blob/main/src/theme1/initial_taylor_prediction.py"
click node_theme2 "https://github.com/sorao0921/biaxial-cpfem/blob/main/src/theme2/initial_height.py"
click node_valleys "https://github.com/sorao0921/biaxial-cpfem/blob/main/src/theme2/valley_evaluation.py"
click node_catalog "https://github.com/sorao0921/biaxial-cpfem/blob/main/src/dashboard/catalog.py"
click node_dashboards "https://github.com/sorao0921/biaxial-cpfem/blob/main/tools/UI/app.py"
click node_plots "https://github.com/sorao0921/biaxial-cpfem/blob/main/src/dashboard/plots.py"
click node_readiness "https://github.com/sorao0921/biaxial-cpfem/blob/main/tools/UI/readiness_app.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_mesh,node_keyword,node_model,node_spatial toneBlue
class node_extract,node_normalize,node_case_data,node_crystal,node_taylor,node_slip,node_spectral,node_outputs toneAmber
class node_theme1,node_initial_taylor,node_theme2,node_valleys toneMint
class node_catalog,node_dashboards,node_plots,node_readiness toneRose
class node_researcher,node_inputs,node_solver toneIndigo
```

## Components

### Model preparation

- [Mesh processing](https://github.com/sorao0921/biaxial-cpfem/blob/main/src/pre_process/mesh.py): `src/pre_process/mesh.py`
- [Keyword formatting](https://github.com/sorao0921/biaxial-cpfem/blob/main/src/pre_process/keyword_format.py): `src/pre_process/keyword_format.py`
- [Model assembly](https://github.com/sorao0921/biaxial-cpfem/blob/main/src/make_model_process/write_keyword.py): `src/make_model_process/write_keyword.py`
- [Spatial model](https://github.com/sorao0921/biaxial-cpfem/blob/main/src/mapping/spatial_model.py): `src/mapping/spatial_model.py`

### Extraction and indicators

- [Result extraction](https://github.com/sorao0921/biaxial-cpfem/blob/main/tools/superdyna4/extract_surface_coords.py): `tools/superdyna4/extract_surface_coords.py`
- [Edge and ID processing](https://github.com/sorao0921/biaxial-cpfem/blob/main/src/extract_process/pipeline.py): `src/extract_process/pipeline.py`
- [Case data resolution](https://github.com/sorao0921/biaxial-cpfem/blob/main/src/postprocess/case_data.py): `src/postprocess/case_data.py`
- [Crystal-plasticity metrics](https://github.com/sorao0921/biaxial-cpfem/blob/main/src/crystal_plasticity/taylor_factor.py): `src/crystal_plasticity/taylor_factor.py`
- [State Taylor workflow](https://github.com/sorao0921/biaxial-cpfem/blob/main/src/crystal_plasticity/taylor_pipeline.py): `src/crystal_plasticity/taylor_pipeline.py`
- [Slip activity workflow](https://github.com/sorao0921/biaxial-cpfem/blob/main/src/crystal_plasticity/slip_activity_pipeline.py): `src/crystal_plasticity/slip_activity_pipeline.py`
- [Height bands](https://github.com/sorao0921/biaxial-cpfem/blob/main/src/postprocess/graph_spectral.py): `src/postprocess/graph_spectral.py`

### Mechanism and prediction

- [Mechanism analysis](https://github.com/sorao0921/biaxial-cpfem/blob/main/src/theme1/contribution.py): `src/theme1/contribution.py`
- [Initial Taylor prediction](https://github.com/sorao0921/biaxial-cpfem/blob/main/src/theme1/initial_taylor_prediction.py): `src/theme1/initial_taylor_prediction.py`
- [Height prediction models](https://github.com/sorao0921/biaxial-cpfem/blob/main/src/theme2/initial_height.py): `src/theme2/initial_height.py`
- [Valley evaluation](https://github.com/sorao0921/biaxial-cpfem/blob/main/src/theme2/valley_evaluation.py): `src/theme2/valley_evaluation.py`

### Catalog and visualization

- [Output catalog](https://github.com/sorao0921/biaxial-cpfem/blob/main/src/dashboard/catalog.py): `src/dashboard/catalog.py`
- [Comparison dashboard](https://github.com/sorao0921/biaxial-cpfem/blob/main/tools/UI/app.py): `tools/UI/app.py`
- [Plot rendering](https://github.com/sorao0921/biaxial-cpfem/blob/main/src/dashboard/plots.py): `src/dashboard/plots.py`
- [Readiness dashboard](https://github.com/sorao0921/biaxial-cpfem/blob/main/tools/UI/readiness_app.py): `tools/UI/readiness_app.py`

### Other components

- **Researcher**
- **Mesh and orientations**
- **LS-DYNA**
- **Processed results**

## Connections

- Researcher → Model assembly: prepares cases (evidence: `README.md`)
- Mesh and orientations → Mesh processing: provides mesh (evidence: `README.md`)
- Mesh processing → Model assembly: formats geometry (evidence: `src/pre_process/mesh.py`)
- Keyword formatting → Model assembly: formats keywords
- Model assembly → LS-DYNA: runs externally (evidence: `README.md`)
- Model assembly → Spatial model: exports geometry (evidence: `README.md`)
- LS-DYNA → Result extraction: produces results (evidence: `README.md`)
- Result extraction → Edge and ID processing: supplies CSVs (evidence: `README.md`)
- Edge and ID processing → Processed results: writes results (evidence: `src/extract_process/pipeline.py`)
- Processed results → Case data resolution: provides artifacts (evidence: `README.md`)
- Processed results → Crystal-plasticity metrics: supplies orientations (evidence: `README.md`)
- Crystal-plasticity metrics → State Taylor workflow: solves factors (evidence: `src/crystal_plasticity/taylor_pipeline.py`)
- Processed results → Slip activity workflow: supplies shear data (evidence: `src/crystal_plasticity/slip_activity_pipeline.py`)
- Case data resolution → Height bands: provides height cases (evidence: `src/postprocess/graph_spectral.py`)
- Case data resolution → Mechanism analysis: supports analysis
- Crystal-plasticity metrics → Initial Taylor prediction: solves slip response (evidence: `src/theme1/initial_taylor_prediction.py`)
- Processed results → Height prediction models: provides reference data (evidence: `README.md`)
- Height prediction models → Valley evaluation: evaluates predictions (evidence: `src/theme2/valley_evaluation.py`)
- Processed results → Output catalog: scans artifacts (evidence: `src/dashboard/catalog.py`)
- Researcher → Comparison dashboard: compares results (evidence: `README.md`)
- Comparison dashboard → Output catalog: selects cases (evidence: `tools/UI/app.py`)
- Comparison dashboard → Plot rendering: renders comparisons (evidence: `tools/UI/app.py`)
- Researcher → Readiness dashboard: checks preparation (evidence: `README.md`)
