# dmitriy-kats/phasefieldgraingrowthsimulations architecture

> Architecture diagram of the GitHub repository dmitriy-kats/phasefieldgraingrowthsimulations, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-25). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/dmitriy-kats/phasefieldgraingrowthsimulations
- Repository: https://github.com/dmitriy-kats/phasefieldgraingrowthsimulations

## Overview

##### File structure
- Top‐level files:
- GrainGrowth.pdf – documentation or publication describing theory and results.
- README.md – brief project description and example output.
- MatlabPhaseFieldGrainGrowth/ – directory containing all MATLAB scripts:
– EffectofInterfaceThickness.m
– EvolutionofGrainStructure.m
– GrainGrowth.m
– PlanarBoundaryEvolution.m
- There are no subdirectories beyond the main MATLAB folder; configuration is embedded in scripts. No build or deployment scripts, since MATLAB code runs directly in the MATLAB environment.

##### README for additional insights
- Confirms the use of a centered finite‐difference solver.
- Demonstrates a sample run (10 grains).
- No explicit architecture section, but the file names hint at different simulation modules (interface‐thickness study, full growth, planar boundary evolution, grain‐structure evolution).

##### Elements
- Blue for orchestration scripts
- Green for solver routines
- Orange for data storage (arrays)
- Purple for visualization components

- Don’t over-fragment: group closely related routines (Evolution + boundary) in one “Solver Core” if it helps clarity.
- Documentation as a side artifact linked to the scripts.

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph "MATLAB Scripts Directory"
        Dir["MatlabPhaseFieldGrainGrowth/"]:::directory
    end

    subgraph "Orchestration" 
        GrainGrowth["GrainGrowth.m"]:::orchestration
        ParamStudy["EffectofInterfaceThickness.m"]:::orchestration
    end

    subgraph "Solver Core"
        Evolution["EvolutionofGrainStructure.m"]:::solver
        Planar["PlanarBoundaryEvolution.m"]:::solver
    end

    Data["Phase-field Data (arrays)"]:::data
    Visualization["Visualization (image export & plots)"]:::visualization

    DocsPDF["GrainGrowth.pdf"]:::documentation
    Readme["README.md"]:::documentation

    %% Data flow and calls
    GrainGrowth -->|"initial parameters & grid"| Data
    GrainGrowth -->|"calls"| Evolution
    Evolution -->|"enforce boundary conditions"| Planar
    Planar -->|"updated phase data"| Evolution
    Evolution -->|"time-stepping results"| GrainGrowth
    GrainGrowth -->|"image output"| Visualization
    ParamStudy -->|"loops over parameters & invokes GrainGrowth"| GrainGrowth

    %% Containment relationships
    Dir --- GrainGrowth
    Dir --- Evolution
    Dir --- Planar
    Dir --- ParamStudy

    %% Documentation links
    DocsPDF -.-> GrainGrowth
    Readme -.-> GrainGrowth

    %% Click Events
    click GrainGrowth "https://github.com/dmitriy-kats/phasefieldgraingrowthsimulations/blob/master/MatlabPhaseFieldGrainGrowth/GrainGrowth.m"
    click Evolution "https://github.com/dmitriy-kats/phasefieldgraingrowthsimulations/blob/master/MatlabPhaseFieldGrainGrowth/EvolutionofGrainStructure.m"
    click Planar "https://github.com/dmitriy-kats/phasefieldgraingrowthsimulations/blob/master/MatlabPhaseFieldGrainGrowth/PlanarBoundaryEvolution.m"
    click ParamStudy "https://github.com/dmitriy-kats/phasefieldgraingrowthsimulations/blob/master/MatlabPhaseFieldGrainGrowth/EffectofInterfaceThickness.m"
    click DocsPDF "https://github.com/dmitriy-kats/phasefieldgraingrowthsimulations/blob/master/GrainGrowth.pdf"
    click Readme "https://github.com/dmitriy-kats/phasefieldgraingrowthsimulations/blob/master/README.md"
    click Dir "https://github.com/dmitriy-kats/phasefieldgraingrowthsimulations/tree/master/MatlabPhaseFieldGrainGrowth/"

    %% Styles
    classDef orchestration fill:#D0E6FF,stroke:#0366D6,color:#03396C
    classDef solver fill:#D6F5D6,stroke:#2E8B57,color:#196F3D
    classDef data fill:#FFE5B4,stroke:#E69A00,color:#A65F00
    classDef visualization fill:#F3D6FF,stroke:#8E44AD,color:#5B2C6F
    classDef documentation fill:#EEEEEE,stroke:#AAAAAA,color:#555555
    classDef directory fill:#F2F2F2,stroke:#CCCCCC,color:#666666,stroke-dasharray: 2 2
```
