Metadata-Version: 2.4
Name: struphy
Version: 3.0.0
Summary: Multi-model plasma physics package
Author: Max Planck Institute for Plasma Physics
Author-email: stefan.possanner@ipp.mpg.de, max.lindqvist@ipp.mpg.de, eric.sonnendruecker@ipp.mpg.de
License: Copyright (c) 2019-2025, Struphy developers, Max Planck Institute for Plasma Physics
        
        Permission is hereby granted, free of charge, to any person obtaining a copy of this software and 
        associated documentation files (the "Software"), to deal in the Software without restriction, 
        including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, 
        and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, 
        subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all copies or substantial 
        portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT 
        NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 
        IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
        WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
        SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Project-URL: homepage, https://struphy-hub.github.io/struphy/index.html
Project-URL: documentation, https://struphy-hub.github.io/struphy/index.html
Project-URL: repository, https://github.com/struphy-hub/struphy
Project-URL: changelog, https://github.com/struphy-hub/struphy/blob/devel/CHANGELOG.md
Project-URL: Bug Tracker, https://github.com/struphy-hub/struphy/issues
Keywords: plasma physics, fusion, numerical modeling, partial differential equations, energetic particles
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy<=2.2.6
Requires-Dist: cunumpy<=0.1
Requires-Dist: pyccel<=2.0.1,>=2.0
Requires-Dist: scipy<=1.15.3
Requires-Dist: h5py<=3.14.0
Requires-Dist: matplotlib<=3.10.5
Requires-Dist: pyyaml<=6.0.3
Requires-Dist: vtk<=9.5.2
Requires-Dist: tqdm<=4.67.1
Requires-Dist: argcomplete<=3.6.3
Requires-Dist: pytest<=9.0.1
Requires-Dist: pytest-mpi<=0.6
Requires-Dist: line_profiler<=5.0.0
Provides-Extra: phys
Requires-Dist: gvec<=1.2.0,>=1.1.0; extra == "phys"
Requires-Dist: desc-opt<=0.15.0; extra == "phys"
Provides-Extra: dev
Requires-Dist: struphy[mpi]; extra == "dev"
Requires-Dist: notebook<=7.4.7; extra == "dev"
Requires-Dist: autopep8<=2.3.2; extra == "dev"
Requires-Dist: isort<=7.0.0; extra == "dev"
Requires-Dist: flake8<=7.3.0; extra == "dev"
Requires-Dist: pylint<=4.0.2; extra == "dev"
Requires-Dist: ssort<=0.15.0; extra == "dev"
Requires-Dist: add-trailing-comma<=4.0.0; extra == "dev"
Requires-Dist: ruff<=0.14.4,>=0.9.1; extra == "dev"
Requires-Dist: pre-commit<=4.4.0; extra == "dev"
Requires-Dist: nbstripout<=0.8.1; extra == "dev"
Requires-Dist: tabulate<=0.9.0; extra == "dev"
Requires-Dist: tomli-w<=1.2.0; extra == "dev"
Requires-Dist: kaleido<=1.2.0; extra == "dev"
Requires-Dist: pandas<=2.3.3; extra == "dev"
Requires-Dist: plotly<=6.3.0; extra == "dev"
Provides-Extra: mpi
Requires-Dist: mpi4py<=4.1.1; extra == "mpi"
Provides-Extra: doc
Requires-Dist: struphy[phys]; extra == "doc"
Requires-Dist: jupyter<=1.1.1; extra == "doc"
Requires-Dist: nbconvert<=6.5.4; extra == "doc"
Requires-Dist: ipykernel<=7.1.0; extra == "doc"
Requires-Dist: sphinx<=8.1.3; extra == "doc"
Requires-Dist: sphinx-design<=0.6.1; extra == "doc"
Requires-Dist: lxml_html_clean<=0.4.3; extra == "doc"
Requires-Dist: sphinxcontrib-napoleon<=0.7; extra == "doc"
Requires-Dist: sphinx-copybutton<=0.5.2; extra == "doc"
Requires-Dist: pydata-sphinx-theme<=0.16.1; extra == "doc"
Requires-Dist: nbsphinx<=0.9.7; extra == "doc"
Requires-Dist: m2r2<=0.3.4; extra == "doc"
Requires-Dist: myst-parser<=4.0.1; extra == "doc"
Requires-Dist: mistune<=0.8.4; extra == "doc"
Requires-Dist: docutils<=0.21.2; extra == "doc"
Requires-Dist: ipyparallel<=9.0.2; extra == "doc"
Provides-Extra: likwid
Requires-Dist: struphy[dev]; extra == "likwid"
Requires-Dist: pylikwid; extra == "likwid"
Provides-Extra: all
Requires-Dist: struphy[phys]; extra == "all"
Requires-Dist: struphy[dev]; extra == "all"
Requires-Dist: struphy[mpi]; extra == "all"
Requires-Dist: struphy[doc]; extra == "all"
Dynamic: license-file

<h1 align="center">
<img src="https://raw.githubusercontent.com/struphy-hub/.github/refs/heads/main/profile/struphy_header_with_subs.png">
</h1><br>

[![Release](https://img.shields.io/github/v/release/struphy-hub/struphy?label=Release)](https://github.com/struphy-hub/struphy/releases)
[![License](https://img.shields.io/badge/License-MIT-violet)](https://github.com/struphy-hub/struphy/blob/devel/LICENSE)
[![badge](https://img.shields.io/badge/launch-tutorials-579ACA.svg?logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFkAAABZCAMAAABi1XidAAAB8lBMVEX///9XmsrmZYH1olJXmsr1olJXmsrmZYH1olJXmsr1olJXmsrmZYH1olL1olJXmsr1olJXmsrmZYH1olL1olJXmsrmZYH1olJXmsr1olL1olJXmsrmZYH1olL1olJXmsrmZYH1olL1olL0nFf1olJXmsrmZYH1olJXmsq8dZb1olJXmsrmZYH1olJXmspXmspXmsr1olL1olJXmsrmZYH1olJXmsr1olL1olJXmsrmZYH1olL1olLeaIVXmsrmZYH1olL1olL1olJXmsrmZYH1olLna31Xmsr1olJXmsr1olJXmsrmZYH1olLqoVr1olJXmsr1olJXmsrmZYH1olL1olKkfaPobXvviGabgadXmsqThKuofKHmZ4Dobnr1olJXmsr1olJXmspXmsr1olJXmsrfZ4T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kGduJTNHG72zcW9LoJgqQxpP3/Tj//c3yB0tqzaml05/+orHLksVO+95kX7/7qgJvnjlrfr2Ggsyx0eoy9uPzN5SPd86aXggOsEKW2Prz7du3VID3/tzs/sSRs2w7ovVHKtjrX2pd7ZMlTxAYfBAL9jiDwfLkq55Tm7ifhMlTGPyCAs7RFRhn47JnlcB9RM5T97ASuZXIcVNuUDIndpDbdsfrqsOppeXl5Y+XVKdjFCTh+zGaVuj0d9zy05PPK3QzBamxdwtTCrzyg/2Rvf2EstUjordGwa/kx9mSJLr8mLLtCW8HHGJc2R5hS219IiF6PnTusOqcMl57gm0Z8kanKMAQg0qSyuZfn7zItsbGyO9QlnxY0eCuD1XL2ys/MsrQhltE7Ug0uFOzufJFE2PxBo/YAx8XPPdDwWN0MrDRYIZF0mSMKCNHgaIVFoBbNoLJ7tEQDKxGF0kcLQimojCZopv0OkNOyWCCg9XMVAi7ARJzQdM2QUh0gmBozjc3Skg6dSBRqDGYSUOu66Zg+I2fNZs/M3/f/Grl/XnyF1Gw3VKCez0PN5IUfFLqvgUN4C0qNqYs5YhPL+aVZYDE4IpUk57oSFnJm4FyCqqOE0jhY2SMyLFoo56zyo6becOS5UVDdj7Vih0zp+tcMhwRpBeLyqtIjlJKAIZSbI8SGSF3k0pA3mR5tHuwPFoa7N7reoq2bqCsAk1HqCu5uvI1n6JuRXI+S1Mco54YmYTwcn6Aeic+kssXi8XpXC4V3t7/ADuTNKaQJdScAAAAAElFTkSuQmCC)](https://mybinder.org/v2/gh/struphy-hub/struphy-tutorials/main)
[![Ubuntu latest](https://github.com/struphy-hub/struphy/actions/workflows/ubuntu-latest.yml/badge.svg)](https://github.com/struphy-hub/struphy/actions/workflows/ubuntu-latest.yml)
[![MacOS latest](https://github.com/struphy-hub/struphy/actions/workflows/macos-latest.yml/badge.svg)](https://github.com/struphy-hub/struphy/actions/workflows/macos-latest.yml)
[![isort and ruff](https://github.com/struphy-hub/struphy/actions/workflows/static_analysis.yml/badge.svg)](https://github.com/struphy-hub/struphy/actions/workflows/static_analysis.yml)
[![PyPI](https://img.shields.io/pypi/v/struphy?label=PyPI)](https://pypi.org/project/struphy/)
[![PyPI Downloads](https://img.shields.io/pypi/dm/struphy.svg?label=PyPI%20downloads)](
https://pypi.org/project/struphy/)



# Welcome!

**This is a Python package for solving partial differential equations (PDEs) mainly - but not exclusively - for plasma physics.**

**STRUPHY** stands for **STRU**cture-**P**reserving **HY**brid code (or **STRU**cture-preserving **PHY**sics code). The package provides off-the-shelf models for plasma physics problems, such as

* Maxwell's equations
* Magneto-hydrodynamics (MHD)
* Vlasov-Poisson and Vlasov-Maxwell kinetic models
* Drift-kinetic models for strongly magnetized plasma
* MHD-kinetic hybrid models 

All models can be run on multiple cores through MPI (distributed memory) and OpenMP (shared memory). The compute-intensive parts of the code are translated and compiled ("transpiled") using [pyccel](https://github.com/pyccel/pyccel), giving you the speed of Fortran or C while working within the familiar Python environment. 

Particles in a Tokamak <br> (model "Vlasov")             |  Toroidal Alfvén eigenmode <br> (model "LinearMHDDriftKineticCC") 
:-------------------------:|:-------------------------:
![](https://raw.githubusercontent.com/struphy-hub/.github/refs/heads/main/profile/gallery_struphy_tracer6D.png)  |  ![](https://raw.githubusercontent.com/struphy-hub/.github/refs/heads/main/profile/gallery_frontpage_bk.png) 
**Strong Landau damping <br>(model "VlasovAmpereOneSpecies")** | **Anisotropic diffusion <br> (propagator "ImplicitDiffusion")**
![](https://raw.githubusercontent.com/struphy-hub/.github/refs/heads/main/profile/gallery_step_1496.png) | ![](https://raw.githubusercontent.com/struphy-hub/.github/refs/heads/main/profile/gallery_struphy_heat.png)


The code is freely available under an [MIT license](https://github.com/struphy-hub/struphy/blob/devel/LICENSE) - Copyright (c) 2019-2025, Struphy developers, Max Planck Institute for Plasma Physics.

<h1 align="center">
<img src="https://raw.githubusercontent.com/struphy-hub/.github/refs/heads/main/profile/MPI_PP_Logo_Vertical_E_green_rgb.png" width="200">
</h1>

## Tutorials

Get familiar with Struphy right away on [mybinder](https://mybinder.org/v2/gh/struphy-hub/struphy-tutorials/main) - no installation needed.


## Quick install

Quick install on your computer (using a virtual environment):

```
python -m venv struphy_env
source struphy_env/bin/activate
pip install -U pip
pip install -U struphy
struphy compile
```

In case you face troubles with install/compile:

1. check the [prerequisites](https://struphy-hub.github.io/struphy/sections/install.html#requirements)
2. visit [trouble shooting](https://struphy-hub.github.io/struphy/sections/install.html#trouble-shooting)


## Quick run

As an example, let's say we want to solve Maxwell's equations. We can use the CLI and generate a default launch file via

```
struphy params Maxwell
```
Hit yes when prompted - this will create the file `params_Maxwell.py` in your current working directory (cwd). You can open the file and - if you feel like it already - change some parameters, then run

```
python params_Maxwell.py
```

The default output is in `sim_1/` in your cwd. You can change the output path via the class `EnvironmentOptions` in the parameter file.

Parallel simulations are run for example with

```
pip install -U mpi4py
mpirun -n 4 python params_Maxwell.py
```

You can also put the run command in a batch script.


## Documentation

The doc is on [Github pages](https://struphy-hub.github.io/struphy/index.html), we recommend in particular to visit:

* [Install](https://struphy-hub.github.io/struphy/sections/install.html)
* [Userguide](https://struphy-hub.github.io/struphy/sections/userguide.html)
* [Available models](https://struphy-hub.github.io/struphy/sections/models.html)
* [Numerical methods](https://struphy-hub.github.io/struphy/sections/numerics.html)


## Get in touch

* [Issues](https://github.com/struphy-hub/struphy/issues)
* [Discussions](https://github.com/struphy-hub/struphy/discussions)
* [@spossann](https://github.com/spossann) [stefan.possanner@ipp.mpg.de](mailto:spossann@ipp.mpg.de) (Maintainer)
* [@max-models](https://github.com/max-models) [max.lindqvist@ipp.mpg.de](mailto:Max.Lindqvist@ipp.mpg.de) (Maintainer)
* [LinkedIn profile](https://www.linkedin.com/company/struphy/)


## Citing Struphy

* S. Possanner, F. Holderied, Y. Li, B.-K. Na, D. Bell, S. Hadjout and Y. Güçlü, [**High-Order Structure-Preserving Algorithms for Plasma Hybrid Models**](https://link.springer.com/chapter/10.1007/978-3-031-38299-4_28), International Conference on Geometric Science of Information 2023, 263-271, Springer Nature Switzerland.

