DipolEq equilibrium solver python bindings.
Project description
DipolEq
Dipole equilibrium design code
Based on "TokaMac v2.0" by L. Bai and M. Mauel at Columbia University.
Can be used to show high beta equilibria in a dipole confined plasma. In other words, solve the Grad-Shafranov equation in a machine with an "first closed flux surface" and no toroidal field.
The code is licensed under the MIT license. (Except for the ClibPDF code, which no longer is available but was licensed for free use in academic use. This code is not linked into the python package version of this code.)
If you use this code, please reference this paper as source.
D. T. Garnier, J. Kesner, and M. E. Mauel, “Magnetohydrodynamic stability in a levitated dipole,” Phys. Plasmas, vol. 6, no. 9, pp. 3431–3434, Jan. 1999, doi: 10.1063/1.873601.
C Code - Command Line Version
Compilation
The original code is written in C (and some C++) and gives a command line interface, that outputs a PDF, HDF5 and other output files. The code can be compiled with cmake. There are example codes for how to process hdf5 files (into, for example an EFIT gfile) in the postprocess
directory.
Dependencies
Ubuntu
The recommended build is for hdf5, zlib and libjpeg libraries to be installed:
sudo apt install cmake gcc zlib1g-dev libjpeg-dev libhdf5-dev
macOS
cmake
and hdf5
can be installed with macports or homebrew and should be enough to compile the code.
brew install cmake hdf5
or
sudo port install cmake hdf5
Build and Install
The code can be configured and compiled with cmake. The recommended way to compile is to create a build directory and run cmake from there:
cd dipoleq
mkdir build
cd build
cmake ..
cmake --build .
sudo cmake --install .
Usage
The code can be run from the command line with the following command:
dipoleq -f <input_file>
See the Testing
directories for examples of input files [*.in
].
There is a second command line tool that can be used to generate a EFIT gfile from the output hdf5 file:
dipoleq_geqdsk <output.h5>
Python Module Interface
A python version of the code is now available. This relies on the pybind11
library to wrap the C code into a python module. This wraps the main features of the code into a python module, although the outer loop of the code is now in python. The python module is not yet fully documented, but the main features are available, and regularly tested against the original C code. For packaging, the "scikit-build-core" package is used to build the code using a standard pyproject.toml
file.
Complilation
The python module can be compiled with the following command:
pip install .
This may install in your user directory or in a virtual environment. It will also install the dipoleq
and dipoleq_geqdsk
command line tools as well, though these are actually calls to the python / pybind11 version of the code and no longer include ClibPDF or HDF5 directly. This may become the preferred way to install the code in the future.
Usage
Python usage is still in development. More on this soon.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
File details
Details for the file dipoleq-0.9.4.tar.gz
.
File metadata
- Download URL: dipoleq-0.9.4.tar.gz
- Upload date:
- Size: 1.3 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.0 CPython/3.12.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a0b8e6977243340299e4323bf382ac70fb07ed36154eb6b20f148bebe918591e |
|
MD5 | 5942be6f415a762027788384f60a7ada |
|
BLAKE2b-256 | 2d34a60243ed45d194f49a45129a47633bf22bc4d11aef307123f6eedaca9ea6 |
File details
Details for the file dipoleq-0.9.4-cp312-cp312-win_amd64.whl
.
File metadata
- Download URL: dipoleq-0.9.4-cp312-cp312-win_amd64.whl
- Upload date:
- Size: 260.0 kB
- Tags: CPython 3.12, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.0 CPython/3.12.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 321d73d012d03c37f164195450e3553bd239a4313c085592bdee3f9789026d3c |
|
MD5 | 4a35c57ba222eb15f98cb227336c43ca |
|
BLAKE2b-256 | 82dbdc62256dc7f898e78d73baa7d32214c1e290a379830573851f6cf5b13ae3 |
File details
Details for the file dipoleq-0.9.4-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: dipoleq-0.9.4-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 347.7 kB
- Tags: CPython 3.12, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.0 CPython/3.12.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5699258998444e2bc0bed5d23d73b57d32ac697f2ac4c470b4e3bab51636b3ca |
|
MD5 | 26fdf0369acc8a86a1739bc2f04331ff |
|
BLAKE2b-256 | 72d017d27d7680d2443168f88ffce79b410fe6d41f75efe07871c28961f85620 |
File details
Details for the file dipoleq-0.9.4-cp312-cp312-macosx_11_0_arm64.whl
.
File metadata
- Download URL: dipoleq-0.9.4-cp312-cp312-macosx_11_0_arm64.whl
- Upload date:
- Size: 283.9 kB
- Tags: CPython 3.12, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.0 CPython/3.12.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9f97f8140858cfec117063b0cddda3290f1dc70751d2beac91f6f0bcb5113a5d |
|
MD5 | ef82d0583b9d709014ddd220d9a58869 |
|
BLAKE2b-256 | 15ce42c0d439d3452dd83bdd05b452c8533817292a378b1e82f2843360787c55 |
File details
Details for the file dipoleq-0.9.4-cp312-cp312-macosx_10_15_x86_64.whl
.
File metadata
- Download URL: dipoleq-0.9.4-cp312-cp312-macosx_10_15_x86_64.whl
- Upload date:
- Size: 319.5 kB
- Tags: CPython 3.12, macOS 10.15+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.0 CPython/3.12.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a91f35beb41d93a296fcf7bb9159b82605e35f348575dc9f5ac004f9eecba374 |
|
MD5 | 2701b3275c30f4d3f4b159085a6a479b |
|
BLAKE2b-256 | e61b3c4d5be82675ece254d02c188faef7e88729f2fdc22223a05c81d2c0c885 |
File details
Details for the file dipoleq-0.9.4-cp311-cp311-win_amd64.whl
.
File metadata
- Download URL: dipoleq-0.9.4-cp311-cp311-win_amd64.whl
- Upload date:
- Size: 261.3 kB
- Tags: CPython 3.11, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.0 CPython/3.12.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ab6632067bfa0ce49afcfe77170da1cd04d55c6ab0d399c001ccbd0ce33d272f |
|
MD5 | f714fe67d1baeaeb82b83edf92bb93b8 |
|
BLAKE2b-256 | 7599e91f50cf1fa5cf0feb1dd0c7048244491fb171beaa3d0feadf01a27ee086 |
File details
Details for the file dipoleq-0.9.4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: dipoleq-0.9.4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 348.3 kB
- Tags: CPython 3.11, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.0 CPython/3.12.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e28eeb6fd92273f1be9d19b7942978d4fa758d5ae7946e8f20129d9e854436dd |
|
MD5 | 3c15b192a0977e324c697b26a7d06eed |
|
BLAKE2b-256 | e3e98b67def7a722f706a975a88d2bb8997bcfc1767aaa8f1eaa7e76db9192a0 |
File details
Details for the file dipoleq-0.9.4-cp311-cp311-macosx_11_0_arm64.whl
.
File metadata
- Download URL: dipoleq-0.9.4-cp311-cp311-macosx_11_0_arm64.whl
- Upload date:
- Size: 282.3 kB
- Tags: CPython 3.11, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.0 CPython/3.12.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ef986864321b17e4b83b18f6817908d3021f5f308492a4287772ca8f65ff727b |
|
MD5 | 4cd8917a4ff00d6a31ec439e9f83f26d |
|
BLAKE2b-256 | d93a693b36d96b161316bc55e4ec31da386e1876a77cdc096228b356e2fa0453 |
File details
Details for the file dipoleq-0.9.4-cp311-cp311-macosx_10_15_x86_64.whl
.
File metadata
- Download URL: dipoleq-0.9.4-cp311-cp311-macosx_10_15_x86_64.whl
- Upload date:
- Size: 316.9 kB
- Tags: CPython 3.11, macOS 10.15+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.0 CPython/3.12.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a42a51709537846eea133b3e48db102323c3ce6cf7c3d4ce30b62fe039c1543c |
|
MD5 | c8270be8eeab854b49b953ac7099d176 |
|
BLAKE2b-256 | fd6e6411bf65c32d2a8778d5cb29df4d4a3870481c12cf918c17f52d9671d88d |
File details
Details for the file dipoleq-0.9.4-cp310-cp310-win_amd64.whl
.
File metadata
- Download URL: dipoleq-0.9.4-cp310-cp310-win_amd64.whl
- Upload date:
- Size: 259.7 kB
- Tags: CPython 3.10, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.0 CPython/3.12.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 500ecd0f6a2b4fa63173fa47d2e03a78abcd7a5c3b7d6cd01ce1de4db46bb91a |
|
MD5 | 06583ce7da32c7372be81a2e6d27ae73 |
|
BLAKE2b-256 | 7fc103ad96996530cd006e61a8cccf22403e178d486de237f7738381166f351f |
File details
Details for the file dipoleq-0.9.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: dipoleq-0.9.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 347.1 kB
- Tags: CPython 3.10, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.0 CPython/3.12.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | cd1297088e7e7c95258ea8502cfb422cd22bce6f41a6fae5eb160de3903798c3 |
|
MD5 | 70335e58f805144b357abfe5e5132d64 |
|
BLAKE2b-256 | 87fb52c090a875c507dd492ce0a03f51d4508d4d275f6f3c150ccc36d855be50 |
File details
Details for the file dipoleq-0.9.4-cp310-cp310-macosx_11_0_arm64.whl
.
File metadata
- Download URL: dipoleq-0.9.4-cp310-cp310-macosx_11_0_arm64.whl
- Upload date:
- Size: 281.0 kB
- Tags: CPython 3.10, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.0 CPython/3.12.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9c098bc8cfcb2f040709285cdbd588eb2ba1e6d9ae9cadc854b76e501d9c04b6 |
|
MD5 | 4e700b77d18cd3c6d6f513f5671216df |
|
BLAKE2b-256 | 380578173d1960b6e456a2e86d4967b71711b600a256323d1b08d0e90efa030c |
File details
Details for the file dipoleq-0.9.4-cp310-cp310-macosx_10_15_x86_64.whl
.
File metadata
- Download URL: dipoleq-0.9.4-cp310-cp310-macosx_10_15_x86_64.whl
- Upload date:
- Size: 315.6 kB
- Tags: CPython 3.10, macOS 10.15+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.0 CPython/3.12.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b2fb0c54bbedec0ce1dc4fc7361d75f3c281d0cfc2dde16b182bc5ad08f49ea7 |
|
MD5 | cfb1d367a9711194eaa2aa2f521db804 |
|
BLAKE2b-256 | bdefc9278e130f5187a537e6917a62fc092b8c8c734d02951a038904a43aa507 |