# dbarnali/propagation_effect_magnetosphere architecture

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

- Interactive diagram: https://gitdiagram.com/dbarnali/propagation_effect_magnetosphere
- Repository: https://github.com/dbarnali/propagation_effect_magnetosphere

## Overview

#### Purpose and Entry Points
This repository implements a 3D propagation-effect simulation, likely modeling wave/field evolution through a spatial density medium. Primary executable entry points are:
- `propagation_effect_full_simulation_3D.py` — end-to-end 3D simulation driver.
- `use_ray_paths.py` — ray-path-oriented execution or post-processing workflow.
- `test.py` — lightweight validation or experiment runner.

#### Simulation Orchestration
`propagation_effect_full_simulation_3D.py` is the top-level control boundary: it likely assembles global parameters, initializes the 3D field, selects density behavior, invokes grid integration, and emits simulation results. It is the central integration point for the compiled numerical kernels.
- `propagation_effect_full_simulation_3D.py`
- `global_vars.py`
- `instructions_on_which_codes_to_use.txt`

#### Global Model Parameters
`global_vars.py` centralizes shared physical, numerical, or scenario parameters. This creates a repository-wide mutable configuration boundary: numerical kernels and drivers likely depend on compatible dimensional conventions, grid sizing, and propagation constants.
- `global_vars.py`
- `propagation_effect_full_simulation_3D.py`

#### Initial-Condition Construction
Initial complex 3D fields are generated in a Cython kernel. This is the starting data boundary for the numerical pipeline: source/incident-field definitions are converted into arrays suitable for repeated propagation updates.
- `propagation_effect_tools_initial_condition_3D_complex_IM_cython.pyx`
- `propagation_effect_full_simulation_3D.py`

#### Density / Medium Models
The medium density is represented by two performance-oriented Cython implementations: a general density function and an analytical variant. The analytical implementation likely supports closed-form or idealized density profiles, while the other supports the simulation’s primary density calculation path.
- `propagation_effect_tools_density_func.pyx`
- `propagation_effect_tools_density_func_analytical.pyx`
- `propagation_effect_full_simulation_3D.py`

#### 3D Grid Propagation Solver
The core numerical evolution is handled by a Python grid-integration module. It likely consumes the initialized complex field and density samples, then advances propagation across the 3D computational grid. This is the main control/data-flow junction between Python orchestration and Cython numerical kernels.
- `propagation_effect_tools_solve_integration_3D_grid.py`
- `propagation_effect_tools_density_func.pyx`
- `propagation_effect_tools_initial_condition_3D_complex_IM_cython.pyx`

#### Ray-Path Workflow
`use_ray_paths.py` provides a distinct execution boundary for calculations based on ray trajectories. It may use simulation outputs or shared medium definitions to evaluate path-dependent propagation effects, rather than running only the full grid-field workflow.
- `use_ray_paths.py`
- `propagation_effect_tools_density_func.pyx`
- `global_vars.py`

#### Runtime and Build Boundary
The repository uses Python as the orchestration runtime and Cython (`.pyx`) for computationally expensive density and initial-condition operations. `setup_cypython.py` is the build/install boundary required before Python drivers can import compiled extension modules. No external hosted services or deployment infrastructure are represented in the repository tree.
- `setup_cypython.py`
- `propagation_effect_tools_density_func.pyx`
- `propagation_effect_tools_initial_condition_3D_complex_IM_cython.pyx`

Main entry points: [`propagation_effect_full_simulation_3D.py`](https://github.com/dbarnali/propagation_effect_magnetosphere/blob/main/propagation_effect_full_simulation_3D.py) (Full 3D simulation), [`propagation_effect_tools_solve_integration_3D_grid.py`](https://github.com/dbarnali/propagation_effect_magnetosphere/blob/main/propagation_effect_tools_solve_integration_3D_grid.py) (3D grid solver), [`propagation_effect_tools_density_func.pyx`](https://github.com/dbarnali/propagation_effect_magnetosphere/blob/main/propagation_effect_tools_density_func.pyx) (Density model), [`use_ray_paths.py`](https://github.com/dbarnali/propagation_effect_magnetosphere/blob/main/use_ray_paths.py) (Ray-path workflow)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_drivers["Execution workflows"]
  node_full_sim["Full 3D simulation<br/>Python driver"]
  node_ray_paths["Ray-path workflow<br/>Python driver<br/>[use_ray_paths.py]"]
end

subgraph group_python["Python control layer"]
  node_global_vars["Global parameters<br/>shared state<br/>[global_vars.py]"]
  node_grid_solver["3D grid solver<br/>Python solver"]
  node_cython_build{{"Cython build<br/>build script<br/>[setup_cypython.py]"}}
end

subgraph group_cython["Compiled numerical kernels"]
  node_initial_field["Initial complex field<br/>Cython kernel"]
  node_density["Density model<br/>Cython kernel"]
  node_analytical_density["Analytical density model<br/>Cython kernel"]
end

node_simulation_results["Simulation results<br/>field output"]

node_cython_build -->|"builds"| node_initial_field
node_cython_build -->|"builds"| node_density
node_cython_build -->|"builds"| node_analytical_density
node_full_sim -->|"loads parameters"| node_global_vars
node_full_sim -->|"initializes"| node_initial_field
node_full_sim -->|"selects medium"| node_density
node_full_sim -.->|"can select"| node_analytical_density
node_full_sim -->|"runs"| node_grid_solver
node_global_vars -->|"sets conventions"| node_grid_solver
node_initial_field -->|"initial field"| node_grid_solver
node_density -->|"density samples"| node_grid_solver
node_grid_solver -->|"evolves field"| node_simulation_results
node_ray_paths -->|"loads parameters"| node_global_vars
node_ray_paths -->|"evaluates medium"| node_density
node_ray_paths -.->|"produces path effects"| node_simulation_results

click node_full_sim "https://github.com/dbarnali/propagation_effect_magnetosphere/blob/main/propagation_effect_full_simulation_3D.py"
click node_ray_paths "https://github.com/dbarnali/propagation_effect_magnetosphere/blob/main/use_ray_paths.py"
click node_global_vars "https://github.com/dbarnali/propagation_effect_magnetosphere/blob/main/global_vars.py"
click node_grid_solver "https://github.com/dbarnali/propagation_effect_magnetosphere/blob/main/propagation_effect_tools_solve_integration_3D_grid.py"
click node_cython_build "https://github.com/dbarnali/propagation_effect_magnetosphere/blob/main/setup_cypython.py"
click node_initial_field "https://github.com/dbarnali/propagation_effect_magnetosphere/blob/main/propagation_effect_tools_initial_condition_3D_complex_IM_cython.pyx"
click node_density "https://github.com/dbarnali/propagation_effect_magnetosphere/blob/main/propagation_effect_tools_density_func.pyx"
click node_analytical_density "https://github.com/dbarnali/propagation_effect_magnetosphere/blob/main/propagation_effect_tools_density_func_analytical.pyx"

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_full_sim,node_ray_paths toneBlue
class node_global_vars,node_grid_solver,node_cython_build toneAmber
class node_initial_field,node_density,node_analytical_density toneMint
class node_simulation_results toneNeutral
```

## Components

### Execution workflows

- [Full 3D simulation](https://github.com/dbarnali/propagation_effect_magnetosphere/blob/main/propagation_effect_full_simulation_3D.py): Python driver · End-to-end field propagation workflow. · `propagation_effect_full_simulation_3D.py`
- [Ray-path workflow](https://github.com/dbarnali/propagation_effect_magnetosphere/blob/main/use_ray_paths.py): Python driver · Path-dependent propagation calculations. · `use_ray_paths.py`

### Python control layer

- [Global parameters](https://github.com/dbarnali/propagation_effect_magnetosphere/blob/main/global_vars.py): shared state · Physical, numerical, and scenario parameters. · `global_vars.py`
- [3D grid solver](https://github.com/dbarnali/propagation_effect_magnetosphere/blob/main/propagation_effect_tools_solve_integration_3D_grid.py): Python solver · Advances the complex field through the computational grid. · `propagation_effect_tools_solve_integration_3D_grid.py`
- [Cython build](https://github.com/dbarnali/propagation_effect_magnetosphere/blob/main/setup_cypython.py): build script · Builds extension modules for Python workflows. · `setup_cypython.py`

### Compiled numerical kernels

- [Initial complex field](https://github.com/dbarnali/propagation_effect_magnetosphere/blob/main/propagation_effect_tools_initial_condition_3D_complex_IM_cython.pyx): Cython kernel · Constructs source/incident 3D field arrays. · `propagation_effect_tools_initial_condition_3D_complex_IM_cython.pyx`
- [Density model](https://github.com/dbarnali/propagation_effect_magnetosphere/blob/main/propagation_effect_tools_density_func.pyx): Cython kernel · Primary medium-density calculation. · `propagation_effect_tools_density_func.pyx`
- [Analytical density model](https://github.com/dbarnali/propagation_effect_magnetosphere/blob/main/propagation_effect_tools_density_func_analytical.pyx): Cython kernel · Idealized or closed-form density profile. · `propagation_effect_tools_density_func_analytical.pyx`

### Other components

- **Simulation results**: field output · Evolved 3D propagation field and derived results.

## Connections

- Cython build → Initial complex field: builds
- Cython build → Density model: builds
- Cython build → Analytical density model: builds
- Full 3D simulation → Global parameters: loads parameters
- Full 3D simulation → Initial complex field: initializes
- Full 3D simulation → Density model: selects medium
- Full 3D simulation → Analytical density model: can select
- Full 3D simulation → 3D grid solver: runs
- Global parameters → 3D grid solver: sets conventions
- Initial complex field → 3D grid solver: initial field
- Density model → 3D grid solver: density samples
- 3D grid solver → Simulation results: evolves field
- Ray-path workflow → Global parameters: loads parameters
- Ray-path workflow → Density model: evaluates medium
- Ray-path workflow → Simulation results: produces path effects
