Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .claude/agents/clean-code-reviewer.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,6 @@ For each issue, provide:
- Follow the commit message format: `MODULE - TAG - Detailed message`
- Be aware of 0-based to 1-based indexing conversions from Fortran
- Ensure compatibility with the existing test structure in `test/`
- Consider whether changes affect diagnostic outputs (jpec.h5, and legacy files gsec.h5, gse.h5, gsei.h5)
- Consider whether changes affect diagnostic outputs or user-facing APIs

Your goal is to help create code that a fusion physicist with moderate Julia experience can read, understand, and maintain confidently.
4 changes: 2 additions & 2 deletions .github/copilot-instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
- Data flow: equilibrium setup → vacuum response → stability analysis (documented in [CLAUDE.md](CLAUDE.md)).

## Architecture and entry points
- Main entry point: `JPEC.main()` in [src/JPEC.jl](src/JPEC.jl).
- Main entry point: `GeneralizedPerturbedEquilibrium.main()` in [src/GeneralizedPerturbedEquilibrium.jl](src/GeneralizedPerturbedEquilibrium.jl).
- Equilibrium: `setup_equilibrium(path|config)`; types in [src/Equilibrium](src/Equilibrium).
- Vacuum: `compute_vacuum_response()`; code in [src/Vacuum](src/Vacuum).
- ForceFreeStates (ideal MHD stability): types and functions in [src/ForceFreeStates](src/ForceFreeStates).
Expand Down Expand Up @@ -39,7 +39,7 @@
- Many routines use 0-based indexing for historical consistency with the original GPEC Fortran code before converting to 1-based Julia indexing (see [CLAUDE.md](CLAUDE.md)).

## Configuration examples
- Unified configuration: `jpec.toml` uses `[Equilibrium]`, `[Wall]`, `[ForceFreeStates]`, `[PerturbedEquilibrium]`, and `[ForcingTerms]` sections.
- Unified configuration: `gpec.toml` uses `[Equilibrium]`, `[Wall]`, `[ForceFreeStates]`, `[PerturbedEquilibrium]`, and `[ForcingTerms]` sections.
- Legacy configs (`equil.toml`, `dcon.toml`, `vac.in`) are deprecated.
- Example configs in [examples/DIIID-like_ideal_example](examples/DIIID-like_ideal_example) and [examples/Solovev_ideal_example](examples/Solovev_ideal_example).

Expand Down
2 changes: 2 additions & 0 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ JLD2 = "033835bb-8acc-5ee8-8aae-3f567f8a3819"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
OrdinaryDiffEq = "1dea7af3-3e70-54e6-95c3-0bf5283fa5ed"
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
PlotlyJS = "f0f68f2c-4968-5e81-91da-67840de0976a"
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7"
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
Expand All @@ -41,6 +42,7 @@ JLD2 = "0.6.3"
LinearAlgebra = "1"
OrdinaryDiffEq = "6.102.0"
Pkg = "1"
PlotlyJS = "0.18.17"
Plots = "1.40.15"
Printf = "1"
SparseArrays = "1"
Expand Down
3 changes: 2 additions & 1 deletion docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ makedocs(;
"Equilibrium" => "equilibrium.md",
"Utilities" => "utilities.md",
"Forcing Terms" => "forcing_terms.md",
"Perturbed Equilibrium" => "perturbed_equilibrium.md"
"Perturbed Equilibrium" => "perturbed_equilibrium.md",
"Analysis" => "analysis.md"
],
"Citations" => "citations.md",
],
Expand Down
24 changes: 24 additions & 0 deletions docs/src/analysis.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Analysis Module

The Analysis module provides post-processing and visualization utilities for GPEC simulation outputs.

## Submodules

- `ForceFreeStates`: Plotting functions for DCON-style ideal MHD stability results
- `Equilibrium`: Plotting functions for equilibrium objects

```@docs
GeneralizedPerturbedEquilibrium.Analysis
```

## ForceFreeStates

```@autodocs
Modules = [GeneralizedPerturbedEquilibrium.Analysis.ForceFreeStates]
```

## Equilibrium

```@autodocs
Modules = [GeneralizedPerturbedEquilibrium.Analysis.Equilibrium]
```
10 changes: 10 additions & 0 deletions examples/DIIID-like_ideal_example/analyze_example.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
using Pkg;
Pkg.activate(joinpath(@__DIR__, "../.."))
using GeneralizedPerturbedEquilibrium, Plots, PlotlyJS
using GeneralizedPerturbedEquilibrium: Analysis
plotlyjs()

h5path = joinpath(@__DIR__, "gpec.h5")
p_modes = Analysis.ForceFreeStates.plot_mode_displacement(h5path; modes=1:5)
p_eigen = Analysis.ForceFreeStates.plot_eigenmode_summary(h5path)
p_stab = Analysis.ForceFreeStates.plot_stability_criterion(h5path)
215 changes: 0 additions & 215 deletions examples/DIIID-like_ideal_example/run_and_analyze.ipynb

This file was deleted.

4 changes: 4 additions & 0 deletions examples/DIIID-like_ideal_example/run_example.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
using Pkg;
Pkg.activate(joinpath(@__DIR__, "../.."))
using GeneralizedPerturbedEquilibrium
GeneralizedPerturbedEquilibrium.main([dirname(@__FILE__)])
10 changes: 10 additions & 0 deletions examples/Solovev_ideal_example/analyze_example.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
using Pkg;
Pkg.activate(joinpath(@__DIR__, "../.."))
using GeneralizedPerturbedEquilibrium, Plots, PlotlyJS
using GeneralizedPerturbedEquilibrium: Analysis
plotlyjs()

h5path = joinpath(@__DIR__, "gpec.h5")
p_modes = Analysis.ForceFreeStates.plot_mode_displacement(h5path; modes=1:5)
p_eigen = Analysis.ForceFreeStates.plot_eigenmode_summary(h5path)
p_stab = Analysis.ForceFreeStates.plot_stability_criterion(h5path)
Loading
Loading