# sahmotaman/damask architecture

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

- Interactive diagram: https://gitdiagram.com/sahmotaman/damask
- Repository: https://github.com/sahmotaman/damask

## Overview

DAMASK is a materials-simulation toolkit with a Fortran simulation core and a Python package for preparing simulation data, representing crystallography and grids, running solver integrations, and working with results. A typical user prepares material and geometry inputs, runs a simulation, then inspects or transforms its output. The tree supports the major solver and processing subsystems, but the supplied excerpts do not show the Fortran runtime call chain; those connections are therefore omitted. Python relationships shown below come from excerpts or SOURCE INDEX references.

Main entry points: [`src`](https://github.com/sahmotaman/damask/tree/master/src) (Fortran solvers), [`python/damask/_result.py`](https://github.com/sahmotaman/damask/blob/master/python/damask/_result.py) (Result analysis), [`python/damask/_rotation.py`](https://github.com/sahmotaman/damask/blob/master/python/damask/_rotation.py) (Rotations), [`python/damask/grid_filters.py`](https://github.com/sahmotaman/damask/blob/master/python/damask/grid_filters.py) (Grid filters)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_simulation["Simulation core"]
  node_solver_core["Fortran solvers"]
  node_solver_grid["Grid solvers"]
  node_solver_mesh["Mesh solvers"]
  node_solver_material["Material models"]
  node_result_store[("HDF5 results")]
end

subgraph group_preparation["Input preparation"]
  node_config["Configuration<br/>[_config.py]"]
  node_material_config["Material config<br/>[_configmaterial.py]"]
  node_mentat_pbc["Marc mesh PBC"]
end

subgraph group_materials["Materials and geometry"]
  node_grid["Grid geometry<br/>[_grid.py]"]
  node_grid_filters["Grid filters<br/>[grid_filters.py]"]
  node_seeds["Seed generation<br/>[seeds.py]"]
  node_crystal["Crystal lattices<br/>[_crystal.py]"]
  node_rotation["Rotations<br/>[_rotation.py]"]
  node_orientation["Orientations<br/>[_orientation.py]"]
end

subgraph group_analysis["Analysis tools"]
  node_result["Result analysis<br/>[_result.py]"]
  node_mechanics["Continuum mechanics<br/>[mechanics.py]"]
  node_tensor["Tensor math<br/>[tensor.py]"]
  node_vtk["VTK data<br/>[_vtk.py]"]
  node_table["Tabular data<br/>[_table.py]"]
  node_colormap["Color maps<br/>[_colormap.py]"]
end

subgraph group_integration["Solver integration"]
  node_marc_wrapper["Marc wrapper<br/>[_marc.py]"]
end

node_user(("Simulation user"))
node_marc["MSC Marc"]

node_user -.->|"defines inputs"| node_config
node_user -.->|"prepares geometry"| node_grid
node_user -.->|"runs simulation"| node_solver_core
node_solver_core -.->|"dispatches grid"| node_solver_grid
node_solver_core -.->|"dispatches mesh"| node_solver_mesh
node_solver_core -.->|"uses models"| node_solver_material
node_solver_core -.->|"writes results"| node_result_store
node_user -.->|"prepares mesh"| node_mentat_pbc
node_user -.->|"opens results"| node_result
node_grid -->|"uses filters"| node_grid_filters
node_seeds -->|"uses filters"| node_grid_filters
node_orientation -->|"uses rotations"| node_rotation
node_orientation -->|"uses lattices"| node_crystal
node_rotation -->|"uses tensor math"| node_tensor
node_rotation -->|"uses filters"| node_grid_filters
node_mechanics -->|"uses tensor math"| node_tensor
node_mechanics -->|"uses rotations"| node_rotation
node_result -->|"uses filters"| node_grid_filters
node_result -->|"uses mechanics"| node_mechanics
node_result -->|"uses tensor math"| node_tensor
node_marc_wrapper -->|"submits jobs"| node_marc
node_user -.->|"submits job"| node_marc_wrapper

click node_solver_core "https://github.com/sahmotaman/damask/tree/master/src"
click node_solver_grid "https://github.com/sahmotaman/damask/tree/master/src/grid"
click node_solver_mesh "https://github.com/sahmotaman/damask/tree/master/src/mesh"
click node_solver_material "https://github.com/sahmotaman/damask/tree/master/src"
click node_config "https://github.com/sahmotaman/damask/blob/master/python/damask/_config.py"
click node_material_config "https://github.com/sahmotaman/damask/blob/master/python/damask/_configmaterial.py"
click node_mentat_pbc "https://github.com/sahmotaman/damask/blob/master/processing/pre/mentat_pbcOnBoxMesh.py"
click node_grid "https://github.com/sahmotaman/damask/blob/master/python/damask/_grid.py"
click node_grid_filters "https://github.com/sahmotaman/damask/blob/master/python/damask/grid_filters.py"
click node_seeds "https://github.com/sahmotaman/damask/blob/master/python/damask/seeds.py"
click node_crystal "https://github.com/sahmotaman/damask/blob/master/python/damask/_crystal.py"
click node_rotation "https://github.com/sahmotaman/damask/blob/master/python/damask/_rotation.py"
click node_orientation "https://github.com/sahmotaman/damask/blob/master/python/damask/_orientation.py"
click node_result "https://github.com/sahmotaman/damask/blob/master/python/damask/_result.py"
click node_mechanics "https://github.com/sahmotaman/damask/blob/master/python/damask/mechanics.py"
click node_tensor "https://github.com/sahmotaman/damask/blob/master/python/damask/tensor.py"
click node_vtk "https://github.com/sahmotaman/damask/blob/master/python/damask/_vtk.py"
click node_table "https://github.com/sahmotaman/damask/blob/master/python/damask/_table.py"
click node_colormap "https://github.com/sahmotaman/damask/blob/master/python/damask/_colormap.py"
click node_marc_wrapper "https://github.com/sahmotaman/damask/blob/master/python/damask/solver/_marc.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_solver_core,node_solver_grid,node_solver_mesh,node_solver_material,node_result_store,node_user toneBlue
class node_config,node_material_config,node_mentat_pbc toneAmber
class node_grid,node_grid_filters,node_seeds,node_crystal,node_rotation,node_orientation toneMint
class node_result,node_mechanics,node_tensor,node_vtk,node_table,node_colormap toneRose
class node_marc_wrapper,node_marc toneIndigo
```

## Components

### Simulation core

- [Fortran solvers](https://github.com/sahmotaman/damask/tree/master/src): `src`
- [Grid solvers](https://github.com/sahmotaman/damask/tree/master/src/grid): `src/grid`
- [Mesh solvers](https://github.com/sahmotaman/damask/tree/master/src/mesh): `src/mesh`
- [Material models](https://github.com/sahmotaman/damask/tree/master/src): `src`
- **HDF5 results**

### Input preparation

- [Configuration](https://github.com/sahmotaman/damask/blob/master/python/damask/_config.py): `python/damask/_config.py`
- [Material config](https://github.com/sahmotaman/damask/blob/master/python/damask/_configmaterial.py): `python/damask/_configmaterial.py`
- [Marc mesh PBC](https://github.com/sahmotaman/damask/blob/master/processing/pre/mentat_pbcOnBoxMesh.py): `processing/pre/mentat_pbcOnBoxMesh.py`

### Materials and geometry

- [Grid geometry](https://github.com/sahmotaman/damask/blob/master/python/damask/_grid.py): `python/damask/_grid.py`
- [Grid filters](https://github.com/sahmotaman/damask/blob/master/python/damask/grid_filters.py): `python/damask/grid_filters.py`
- [Seed generation](https://github.com/sahmotaman/damask/blob/master/python/damask/seeds.py): `python/damask/seeds.py`
- [Crystal lattices](https://github.com/sahmotaman/damask/blob/master/python/damask/_crystal.py): `python/damask/_crystal.py`
- [Rotations](https://github.com/sahmotaman/damask/blob/master/python/damask/_rotation.py): `python/damask/_rotation.py`
- [Orientations](https://github.com/sahmotaman/damask/blob/master/python/damask/_orientation.py): `python/damask/_orientation.py`

### Analysis tools

- [Result analysis](https://github.com/sahmotaman/damask/blob/master/python/damask/_result.py): `python/damask/_result.py`
- [Continuum mechanics](https://github.com/sahmotaman/damask/blob/master/python/damask/mechanics.py): `python/damask/mechanics.py`
- [Tensor math](https://github.com/sahmotaman/damask/blob/master/python/damask/tensor.py): `python/damask/tensor.py`
- [VTK data](https://github.com/sahmotaman/damask/blob/master/python/damask/_vtk.py): `python/damask/_vtk.py`
- [Tabular data](https://github.com/sahmotaman/damask/blob/master/python/damask/_table.py): `python/damask/_table.py`
- [Color maps](https://github.com/sahmotaman/damask/blob/master/python/damask/_colormap.py): `python/damask/_colormap.py`

### Solver integration

- [Marc wrapper](https://github.com/sahmotaman/damask/blob/master/python/damask/solver/_marc.py): `python/damask/solver/_marc.py`

### Other components

- **Simulation user**
- **MSC Marc**

## Connections

- Simulation user → Configuration: defines inputs
- Simulation user → Grid geometry: prepares geometry
- Simulation user → Fortran solvers: runs simulation
- Fortran solvers → Grid solvers: dispatches grid
- Fortran solvers → Mesh solvers: dispatches mesh
- Fortran solvers → Material models: uses models
- Fortran solvers → HDF5 results: writes results
- Simulation user → Marc mesh PBC: prepares mesh
- Simulation user → Result analysis: opens results
- Grid geometry → Grid filters: uses filters (evidence: `python/damask/_grid.py`)
- Seed generation → Grid filters: uses filters (evidence: `python/damask/seeds.py`)
- Orientations → Rotations: uses rotations (evidence: `python/damask/_orientation.py`)
- Orientations → Crystal lattices: uses lattices (evidence: `python/damask/_orientation.py`)
- Rotations → Tensor math: uses tensor math (evidence: `python/damask/_rotation.py`)
- Rotations → Grid filters: uses filters (evidence: `python/damask/_rotation.py`)
- Continuum mechanics → Tensor math: uses tensor math (evidence: `python/damask/mechanics.py`)
- Continuum mechanics → Rotations: uses rotations (evidence: `python/damask/mechanics.py`)
- Result analysis → Grid filters: uses filters (evidence: `python/damask/_result.py`)
- Result analysis → Continuum mechanics: uses mechanics (evidence: `python/damask/_result.py`)
- Result analysis → Tensor math: uses tensor math (evidence: `python/damask/_result.py`)
- Marc wrapper → MSC Marc: submits jobs (evidence: `python/damask/solver/_marc.py`)
- Simulation user → Marc wrapper: submits job
