# gasyok/immersed-interface architecture

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

- Interactive diagram: https://gitdiagram.com/gasyok/immersed-interface
- Repository: https://github.com/gasyok/immersed-interface

## Overview

This repository contains separate one- and two-dimensional C++ immersed-interface solvers for acoustic wave propagation across heterogeneous media. The workflow initializes a wave and material/grid parameters, prepares interface corrections, advances the numerical solution, and (in the 2D executable) writes per-step pressure data. The README describes ordinary Rusanov treatment away from interfaces and extrapolation/Taylor-based interface treatment. Edges are limited to relationships visible in the excerpts or README; some implementation details, especially for 1D, were not sampled.

Main entry points: [`2d_iim/src/system/system.cpp`](https://github.com/gasyok/immersed-interface/blob/main/2d_iim/src/system/system.cpp) (2D solver), [`1d_iim/src/main.cpp`](https://github.com/gasyok/immersed-interface/blob/main/1d_iim/src/main.cpp) (1D runner), [`2d_iim/src/main.cpp`](https://github.com/gasyok/immersed-interface/blob/main/2d_iim/src/main.cpp) (2D runner), [`2d_iim/src/preprocess/preprocess.cpp`](https://github.com/gasyok/immersed-interface/blob/main/2d_iim/src/preprocess/preprocess.cpp) (2D correction setup)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_setup["Problem setup"]
  node_init1d["1D initialization<br/>[init.cpp]"]
  node_init2d["2D initialization<br/>[init.h]"]
end

subgraph group_interface["Interface treatment"]
  node_prep1d["1D correction setup<br/>[preprocess.cpp]"]
  node_curve2d["Interface geometry<br/>[curve.cpp]"]
  node_prep2d["2D correction setup<br/>[preprocess.cpp]"]
end

subgraph group_solver["Time stepping"]
  node_entry1d["1D runner<br/>[main.cpp]"]
  node_system1d["1D solver<br/>[system.cpp]"]
  node_entry2d["2D runner<br/>[main.cpp]"]
  node_system2d["2D solver<br/>[system.cpp]"]
end

subgraph group_output["Results"]
  node_result["Pressure time-series files"]
end

node_user(("User"))

node_user -->|"runs"| node_entry1d
node_entry1d -->|"constructs"| node_system1d
node_entry1d -->|"samples"| node_system1d
node_user -->|"runs"| node_entry2d
node_entry2d -->|"constructs"| node_init2d
node_entry2d -->|"constructs"| node_system2d
node_entry2d -->|"advances"| node_system2d
node_system2d -->|"writes"| node_result
node_system2d -->|"inherits"| node_prep2d
node_prep2d -->|"inherits"| node_curve2d
node_prep2d -->|"queries geometry"| node_curve2d
node_system2d -->|"uses corrections"| node_prep2d
node_entry1d -->|"configures"| node_init1d
node_prep1d -->|"inherits"| node_init1d

click node_init1d "https://github.com/gasyok/immersed-interface/blob/main/1d_iim/src/init/init.cpp"
click node_entry1d "https://github.com/gasyok/immersed-interface/blob/main/1d_iim/src/main.cpp"
click node_prep1d "https://github.com/gasyok/immersed-interface/blob/main/1d_iim/src/preprocess/preprocess.cpp"
click node_system1d "https://github.com/gasyok/immersed-interface/blob/main/1d_iim/src/system/system.cpp"
click node_init2d "https://github.com/gasyok/immersed-interface/blob/main/2d_iim/include/init/init.h"
click node_entry2d "https://github.com/gasyok/immersed-interface/blob/main/2d_iim/src/main.cpp"
click node_curve2d "https://github.com/gasyok/immersed-interface/blob/main/2d_iim/src/curve/curve.cpp"
click node_prep2d "https://github.com/gasyok/immersed-interface/blob/main/2d_iim/src/preprocess/preprocess.cpp"
click node_system2d "https://github.com/gasyok/immersed-interface/blob/main/2d_iim/src/system/system.cpp"

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_init1d,node_init2d,node_user toneBlue
class node_prep1d,node_curve2d,node_prep2d toneAmber
class node_entry1d,node_system1d,node_entry2d,node_system2d toneMint
class node_result toneRose
```

## Components

### Problem setup

- [1D initialization](https://github.com/gasyok/immersed-interface/blob/main/1d_iim/src/init/init.cpp): `1d_iim/src/init/init.cpp`
- [2D initialization](https://github.com/gasyok/immersed-interface/blob/main/2d_iim/include/init/init.h): `2d_iim/include/init/init.h`

### Interface treatment

- [1D correction setup](https://github.com/gasyok/immersed-interface/blob/main/1d_iim/src/preprocess/preprocess.cpp): `1d_iim/src/preprocess/preprocess.cpp`
- [Interface geometry](https://github.com/gasyok/immersed-interface/blob/main/2d_iim/src/curve/curve.cpp): `2d_iim/src/curve/curve.cpp`
- [2D correction setup](https://github.com/gasyok/immersed-interface/blob/main/2d_iim/src/preprocess/preprocess.cpp): `2d_iim/src/preprocess/preprocess.cpp`

### Time stepping

- [1D runner](https://github.com/gasyok/immersed-interface/blob/main/1d_iim/src/main.cpp): `1d_iim/src/main.cpp`
- [1D solver](https://github.com/gasyok/immersed-interface/blob/main/1d_iim/src/system/system.cpp): `1d_iim/src/system/system.cpp`
- [2D runner](https://github.com/gasyok/immersed-interface/blob/main/2d_iim/src/main.cpp): `2d_iim/src/main.cpp`
- [2D solver](https://github.com/gasyok/immersed-interface/blob/main/2d_iim/src/system/system.cpp): `2d_iim/src/system/system.cpp`

### Results

- **Pressure time-series files**

### Other components

- **User**

## Connections

- User → 1D runner: runs (evidence: `1d_iim/src/main.cpp`)
- 1D runner → 1D solver: constructs (evidence: `1d_iim/src/main.cpp`)
- 1D runner → 1D solver: samples (evidence: `1d_iim/src/main.cpp`)
- User → 2D runner: runs (evidence: `2d_iim/src/main.cpp`)
- 2D runner → 2D initialization: constructs (evidence: `2d_iim/src/main.cpp`)
- 2D runner → 2D solver: constructs (evidence: `2d_iim/src/main.cpp`)
- 2D runner → 2D solver: advances (evidence: `2d_iim/src/main.cpp`)
- 2D solver → Pressure time-series files: writes
- 2D solver → 2D correction setup: inherits (evidence: `2d_iim/src/system/system.cpp`)
- 2D correction setup → Interface geometry: inherits
- 2D correction setup → Interface geometry: queries geometry (evidence: `2d_iim/src/preprocess/preprocess.cpp`)
- 2D solver → 2D correction setup: uses corrections (evidence: `2d_iim/src/system/system.cpp`)
- 1D runner → 1D initialization: configures (evidence: `1d_iim/src/main.cpp`)
- 1D correction setup → 1D initialization: inherits
