# manteapi/hokusai architecture

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

- Interactive diagram: https://gitdiagram.com/manteapi/hokusai
- Repository: https://github.com/manteapi/hokusai

## Overview

##### Project Type Analysis
This is a specialized scientific computing/physics simulation library implementing the Implicit Incompressible SPH model (IISPH). It's a C++ library with visualization capabilities and Blender integration.

##### Main Components

Core Components:
- Simulation Core
- Particle System
- Physics Solver (IISPH)
- Boundary Handling
- Math/Linear Algebra Library (aljabr)
- I/O System
- Visualization/Export System

**┌─────────────────────────────────┐**
- Examples & Demo Applications    │
- (damBreak, sphere, etc.)       │
- ┘

**┌─────────────────────────────────────────────────┐**
- Hokusai Core Library               │
- ┬──────────────┬──────────────────┤
- Particle     │ Physics      │ Boundary         │
- System       │ Solver       │ Handler          │
- ┴──────────────┴──────────────────┤
- Aljabr Math Library               │
- ┘

**┌─────────────┬─────────────┬─────────────────┐**
- File I/O    │ Blender     │ Visualization   │
- System      │ Integration │ System          │
- ┴─────────────┴─────────────────┘

##### Component Details

- Blue rectangles for core simulation components
- Green rectangles for math/utility libraries
- Orange rectangles for I/O components
- Purple rectangles for visualization/export components

Following interactions:
- Particle data flow between components
- Boundary condition information flow
- Export/import data paths
- Visualization data pipeline

##### Key Elements to Highlight

a. Core Components:
- Particle System (particle.hpp)
- Solver Parameters (solverParams.hpp)
- Boundary Handling (boundary.hpp)
- Grid Utilities (gridUtility.hpp)

b. Math Library:
- Vector/Matrix Operations
- Mathematical Utilities
- Kernel Functions

c. I/O and Integration:
- File I/O (io.hpp)
- Blender Export/Import
- Mesh Handling (triMesh.hpp)

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Applications
        Demo["Demo Applications"]
        Examples["Example Simulations"]
    end

    subgraph Core["Core Library"]
        PS["Particle System"]:::core
        click PS "https://github.com/manteapi/hokusai/blob/master/hokusai/include/hokusai/particle.hpp"
        
        Solver["Physics Solver (IISPH)"]:::core
        click Solver "https://github.com/manteapi/hokusai/blob/master/hokusai/include/hokusai/system.hpp"
        
        BH["Boundary Handler"]:::core
        click BH "https://github.com/manteapi/hokusai/blob/master/hokusai/include/hokusai/boundary.hpp"
        
        Grid["Grid Utilities"]:::core
        click Grid "https://github.com/manteapi/hokusai/blob/master/hokusai/include/hokusai/gridUtility.hpp"
        
        SP["Solver Parameters"]:::core
        click SP "https://github.com/manteapi/hokusai/blob/master/hokusai/include/hokusai/solverParams.hpp"
        
        KF["Kernel Functions"]:::core
        click KF "https://github.com/manteapi/hokusai/blob/master/hokusai/include/hokusai/kernel.hpp"
        
        PSS["Particle Source/Sink"]:::core
        click PSS "https://github.com/manteapi/hokusai/blob/master/hokusai/include/hokusai/particleSource.hpp"
    end

    subgraph Math["Math Library"]
        Aljabr["Aljabr Math Library"]:::math
        click Aljabr "https://github.com/manteapi/hokusai/tree/master/hokusai/include/hokusai/aljabr/"
    end

    subgraph IO["I/O and Visualization"]
        FileIO["File I/O System"]:::io
        click FileIO "https://github.com/manteapi/hokusai/blob/master/hokusai/include/hokusai/io.hpp"
        
        Vis["Visualization System"]:::vis
        click Vis "https://github.com/manteapi/hokusai/blob/master/hokusai/include/hokusai/rasterizer.hpp"
        
        Mesh["Mesh Handler"]:::io
        click Mesh "https://github.com/manteapi/hokusai/blob/master/hokusai/include/hokusai/triMesh.hpp"
        
        Blender["Blender Integration"]:::io
    end

    %% Relationships
    Demo --> PS
    Examples --> PS
    PS --> Solver
    Solver --> BH
    PS --> Grid
    Solver --> Grid
    SP --> Solver
    KF --> Solver
    PSS --> PS
    
    PS --> Aljabr
    Solver --> Aljabr
    BH --> Aljabr
    
    PS --> FileIO
    FileIO --> Blender
    PS --> Vis
    Mesh --> BH
    Mesh --> Vis

    %% Styles
    classDef core fill:#3498db,stroke:#2980b9,color:white
    classDef math fill:#2ecc71,stroke:#27ae60,color:white
    classDef io fill:#e67e22,stroke:#d35400,color:white
    classDef vis fill:#9b59b6,stroke:#8e44ad,color:white

    %% Legend
    subgraph Legend
        L1["Core Components"]:::core
        L2["Math Library"]:::math
        L3["I/O Components"]:::io
        L4["Visualization"]:::vis
    end
```
