# stfs-tuda/blastamr architecture

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

- Interactive diagram: https://gitdiagram.com/stfs-tuda/blastamr
- Repository: https://github.com/stfs-tuda/blastamr

## Overview

##### Main Components (Top Level)
a) Applications Layer (Top)
b) Core AMR Framework Layer (Middle)
c) Infrastructure Layer (Bottom)

##### Component Breakdown

a) Applications Layer:
- Solvers (reactingDyMFoam)
- Utilities (reconstructParMesh, updateMesh)

b) Core AMR Framework Layer:
- Create interconnected modules for:
- Dynamic Mesh Management
- adaptiveFvMesh
- fvMeshRefiner (with subcomponents for Hex/Poly refinement)
- fvMeshBalance
- Error Estimation
- errorEstimator base class
- Various estimators (Lohner, delta, fieldValue, etc.)
- Mesh Tools
- locationMapper
- dynMeshTools
- newCellCuts

c) Infrastructure Layer:
- OpenFOAM Core Libraries
- Parallel Computing Infrastructure
- File I/O Systems

##### Interaction Flows
- Data flow between components
- Inheritance relationships
- Dependencies between modules

##### Key Features to Emphasize
- Load balancing capabilities
- Polyhedral mesh support
- Dynamic mesh refinement
- Error estimation framework
- OpenFOAM integration points

##### Implementation Details
- Relationship between:
- Dynamic mesh updates
- Error estimation
- Load balancing decisions
- Mesh refinement operations

Key Relationships to Highlight:
##### Solver Integration Points

Remember to include version compatibility notes (OpenFOAM v2112 or newer vs. v2012) as this is crucial for implementation.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Style Definitions
    classDef app fill:#90EE90,stroke:#333,stroke-width:2px
    classDef core fill:#ADD8E6,stroke:#333,stroke-width:2px
    classDef infra fill:#D3D3D3,stroke:#333,stroke-width:2px
    classDef error fill:#FFE4B5,stroke:#333,stroke-width:2px
    classDef test fill:#FFA07A,stroke:#333,stroke-width:2px

    %% Applications Layer
    subgraph AL["Applications Layer"]
        RS["Reacting Flow Solver"]
        MRU["Mesh Reconstruction Utility"]
        MUU["Mesh Update Utility"]
    end
    click RS "https://github.com/STFS-TUDa/blastAMR/tree/v2212/applications/solvers/combustion/reactingDyMFoam"
    click MRU "https://github.com/STFS-TUDa/blastAMR/tree/v2212/applications/utilities/reconstructParMesh"
    click MUU "https://github.com/STFS-TUDa/blastAMR/tree/v2212/applications/utilities/updateMesh"

    %% Core AMR Framework Layer
    subgraph CORE["Core AMR Framework"]
        %% Dynamic Mesh Management
        subgraph DMM["Dynamic Mesh Management"]
            AFM["Adaptive FV Mesh"]
            FMR["FV Mesh Refiner"]
            FMB["FV Mesh Balance"]
            HMR["Hex Mesh Refiner"]
            PMR["Poly Mesh Refiner"]
        end
        click AFM "https://github.com/STFS-TUDa/blastAMR/tree/v2212/src/dynamicFvMesh/adaptiveFvMesh"
        click FMB "https://github.com/STFS-TUDa/blastAMR/tree/v2212/src/dynamicMesh/fvMeshBalance"
        click HMR "https://github.com/STFS-TUDa/blastAMR/tree/v2212/src/dynamicMesh/fvMeshRefiner/fvMeshHexRefiner"
        click PMR "https://github.com/STFS-TUDa/blastAMR/tree/v2212/src/dynamicMesh/fvMeshRefiner/fvMeshPolyRefiner"

        %% Error Estimation
        subgraph EE["Error Estimation"]
            EEB["Error Estimator Base"]
            LE["Lohner Estimator"]
            DE["Delta Estimator"]
            FVE["Field Value Estimator"]
            GRE["Gradient Range Estimator"]
            CEE["Coded Error Estimator"]
        end
        click EEB "https://github.com/STFS-TUDa/blastAMR/tree/v2212/src/errorEstimators/errorEstimator"
        click LE "https://github.com/STFS-TUDa/blastAMR/tree/v2212/src/errorEstimators/Lohner"
        click DE "https://github.com/STFS-TUDa/blastAMR/tree/v2212/src/errorEstimators/delta"
        click FVE "https://github.com/STFS-TUDa/blastAMR/tree/v2212/src/errorEstimators/fieldValue"
        click GRE "https://github.com/STFS-TUDa/blastAMR/tree/v2212/src/errorEstimators/gradientRange"
        click CEE "https://github.com/STFS-TUDa/blastAMR/tree/v2212/src/errorEstimators/codedErrorEstimator"

        %% Mesh Tools
        subgraph MT["Mesh Tools"]
            LM["Location Mapper"]
            DMT["Dynamic Mesh Tools"]
            NCC["New Cell Cuts"]
            RI["Refinement Iterator"]
        end
        click LM "https://github.com/STFS-TUDa/blastAMR/tree/v2212/src/dynamicMesh/locationMapper"
        click MT "https://github.com/STFS-TUDa/blastAMR/tree/v2212/src/dynamicMesh/meshTools"
        click NCC "https://github.com/STFS-TUDa/blastAMR/tree/v2212/src/dynamicMesh/newCellCuts"
        click RI "https://github.com/STFS-TUDa/blastAMR/tree/v2212/src/dynamicMesh/newRefinementIterator"
    end

    %% Infrastructure Layer
    subgraph IL["Infrastructure Layer"]
        OCL["OpenFOAM Core Libraries"]
        PCI["Parallel Computing Infrastructure"]
        FIO["File I/O Systems"]
        RBM["Refine Balance Mesh Object"]
    end
    click RBM "https://github.com/STFS-TUDa/blastAMR/tree/v2212/src/dynamicMesh/RefineBalanceMeshObject"

    %% Test Infrastructure
    subgraph TI["Test Infrastructure"]
        AMT["Adaptive Mesh Tests"]
        TC["Test Cases"]
    end
    click AMT "https://github.com/STFS-TUDa/blastAMR/tree/v2212/tests/adaptiveFvMeshTests"
    click TC "https://github.com/STFS-TUDa/blastAMR/tree/v2212/tests/testCases"

    %% Relationships
    AL --> CORE
    CORE --> IL
    EE --> DMM
    MT --> DMM
    DMM --> PCI
    TI --> CORE

    %% Style Applications
    class RS,MRU,MUU app
    class AFM,FMR,FMB,HMR,PMR,LM,DMT,NCC core
    class EEB,LE,DE,FVE,GRE,CEE error
    class OCL,PCI,FIO,RBM infra
    class AMT,TC test

    %% Legend
    subgraph Legend
        L1["Application Component"]:::app
        L2["Core Component"]:::core
        L3["Infrastructure Component"]:::infra
        L4["Error Estimation Component"]:::error
        L5["Test Component"]:::test
    end
```
