# gohrhyyan/polymer-brush-monte-carlo architecture

> Architecture diagram of the GitHub repository gohrhyyan/polymer-brush-monte-carlo, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-04-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/gohrhyyan/polymer-brush-monte-carlo
- Repository: https://github.com/gohrhyyan/polymer-brush-monte-carlo

## Overview

##### Project type and purpose
- This is a domain-specific simulation tool written in Python for modeling polymer brushes via Monte Carlo methods.
- The README and file structure confirm it is a headless, scientific computing application rather than a web service or desktop GUI. Its main use case is to configure, run, and analyze polymer brush Monte Carlo simulations.

##### File structure
- Top-level files:
- .gitignore
- README.md
- start_simulation.py (CLI entry point)
- src/ package:
- config.py – holds all user-adjustable simulation parameters
- brush.py – defines PolymerBrush class and data structures
- interactions.py – contains energy and force calculation routines
- monte_carlo.py – core simulation loop and state update logic
- results_analysis.py – post-processing, statistics, and plotting tools
- results/ (populated at runtime) – stores raw output data and figures

##### README for additional insights
- The README lists each module’s responsibility, confirming a clean separation between configuration, model definition, simulation engine, and analysis.
- No external services or microservices are mentioned—this runs entirely as a standalone process.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Components
    CLI["start_simulation.py"]:::io
    Config["config.py"]:::io
    Model["brush.py"]:::compute
    Interact["interactions.py"]:::compute
    Engine["monte_carlo.py"]:::compute
    Results["results/"]:::io
    Analysis["results_analysis.py"]:::analysis

    %% Package boundary
    subgraph "src/"
        direction TB
        Config
        Model
        Interact
        Engine
        Analysis
    end

    %% Connections
    CLI -->|"loads parameters"| Config
    Config -->|"defines polymer state"| Model
    Config -->|"injects parameters"| Engine
    Model -->|"provides model"| Engine
    Interact -->|"computes energies"| Engine
    Engine -->|"writes output"| Results
    Results -->|"reads data & plots"| Analysis

    %% Legend
    subgraph Legend
        direction LR
        A["I/O & CLI"]:::io
        B["Computation"]:::compute
        C["Analysis"]:::analysis
    end

    %% Click Events
    click CLI "https://github.com/gohrhyyan/polymer-brush-monte-carlo/blob/main/start_simulation.py"
    click Config "https://github.com/gohrhyyan/polymer-brush-monte-carlo/blob/main/src/config.py"
    click Model "https://github.com/gohrhyyan/polymer-brush-monte-carlo/blob/main/src/brush.py"
    click Interact "https://github.com/gohrhyyan/polymer-brush-monte-carlo/blob/main/src/interactions.py"
    click Engine "https://github.com/gohrhyyan/polymer-brush-monte-carlo/blob/main/src/monte_carlo.py"
    click Analysis "https://github.com/gohrhyyan/polymer-brush-monte-carlo/blob/main/src/results_analysis.py"

    %% Styles
    classDef io fill:#add8e6,stroke:#000
    classDef compute fill:#90ee90,stroke:#000
    classDef analysis fill:#ffcc99,stroke:#000
```
