# emreturkoz/sjs architecture

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

- Interactive diagram: https://gitdiagram.com/emreturkoz/sjs
- Repository: https://github.com/emreturkoz/sjs

## Overview

##### Project type and purpose
- This is a domain-specific, open-source scientific tool (a “Slender jet solver”) written in C++. It compiles into one or more command-line executables.
- The solver computes fluid-jet models (Laplace, Newtonian, viscoelastic) by plugging in different model classes into a common solver framework.

##### File structure
- Top-level files only—no subdirectories.
- Makefile: build orchestration.
- README.md: project description.
- main / sjsMain.cpp: entry point(s).
- sjsCommon.h: shared macros, typedefs, constants.
- sjsModel.*: base Model interface (virtual methods, parameters).
- sjsLaplaceModel.*, sjsNewtonianJet.*, sjsViscoelasticJet.*: concrete Model subclasses.
- sjsSolvers.*: core solver framework (time‐stepper, discretization loops).
- sjsSolverHelpers.*: utility routines (linear algebra, I/O, parameter parsing).

##### Detail
- Dependencies at both compile-time (headers/includes) and run-time (object interactions).
- This granular breakdown makes it easy to see where to extend, test, or refactor.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% CLI Layer
    subgraph "CLI Layer"
        CLI["sjsMain.cpp"]:::external
    end

    %% Solver Core
    subgraph "Solver Core"
        SC["sjsSolvers.h/.cpp"]:::core
    end

    %% Model Layer
    subgraph "Model Layer"
        MI["sjsModel.h/.cpp"]:::interface
        Lap["sjsLaplaceModel.h/.cpp"]:::model
        Newt["sjsNewtonianJet.h/.cpp"]:::model
        Vis["sjsViscoelasticJet.h/.cpp"]:::model
    end

    %% Helper Utilities
    subgraph "Helper Utilities"
        HU["sjsSolverHelpers.h/.cpp"]:::utils
        Common["sjsCommon.h"]:::common
    end

    %% Build System and Documentation
    Build["Makefile"]:::external
    Doc["README.md"]:::docs

    %% Relationships
    CLI -->|"invoke solve()"| SC
    SC -->|"calls evaluateTerms()"| MI
    MI -->|"implemented by"| Lap
    MI -->|"implemented by"| Newt
    MI -->|"implemented by"| Vis
    SC -->|"uses"| HU

    %% Include dependencies
    CLI -.->|"includes sjsCommon.h"| Common
    SC -.->|"includes sjsCommon.h"| Common
    MI -.->|"includes sjsCommon.h"| Common
    Lap -.->|"includes sjsCommon.h"| Common
    Newt -.->|"includes sjsCommon.h"| Common
    Vis -.->|"includes sjsCommon.h"| Common
    HU -.->|"includes sjsCommon.h"| Common

    %% Build links
    Build --> CLI
    Build --> SC
    Build --> MI
    Build --> Lap
    Build --> Newt
    Build --> Vis
    Build --> HU

    %% Documentation
    Doc -.-> CLI
    Doc -.-> SC
    Doc -.-> MI
    Doc -.-> HU

    %% Click Events
    click CLI "https://github.com/emreturkoz/sjs/blob/master/sjsMain.cpp"
    click SC "https://github.com/emreturkoz/sjs/blob/master/sjsSolvers.h"
    click SC "https://github.com/emreturkoz/sjs/blob/master/sjsSolvers.cpp"
    click MI "https://github.com/emreturkoz/sjs/blob/master/sjsModel.h"
    click MI "https://github.com/emreturkoz/sjs/blob/master/sjsModel.cpp"
    click Lap "https://github.com/emreturkoz/sjs/blob/master/sjsLaplaceModel.h"
    click Lap "https://github.com/emreturkoz/sjs/blob/master/sjsLaplaceModel.cpp"
    click Newt "https://github.com/emreturkoz/sjs/blob/master/sjsNewtonianJet.h"
    click Newt "https://github.com/emreturkoz/sjs/blob/master/sjsNewtonianJet.cpp"
    click Vis "https://github.com/emreturkoz/sjs/blob/master/sjsViscoelasticJet.h"
    click Vis "https://github.com/emreturkoz/sjs/blob/master/sjsViscoelasticJet.cpp"
    click HU "https://github.com/emreturkoz/sjs/blob/master/sjsSolverHelpers.h"
    click HU "https://github.com/emreturkoz/sjs/blob/master/sjsSolverHelpers.cpp"
    click Common "https://github.com/emreturkoz/sjs/blob/master/sjsCommon.h"
    click Build "https://github.com/emreturkoz/sjs/tree/master/Makefile"
    click Doc "https://github.com/emreturkoz/sjs/blob/master/README.md"

    %% Styles
    classDef external fill:#aed9e0,stroke:#03658c,color:#002626
    classDef core fill:#b9fbc0,stroke:#1b763b,color:#0b3d02
    classDef interface fill:#e0f7fa,stroke:#00796b,color:#004d40
    classDef model fill:#ffcc80,stroke:#ef6c00,color:#4e2a04
    classDef utils fill:#fff59d,stroke:#f9a825,color:#5d4037
    classDef common fill:#eeeeee,stroke:#9e9e9e,color:#424242
    classDef docs fill:#f0f0f0,stroke:#bbbbbb,color:#666666
```
