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.10.1.tar.gz
.
File metadata
- Download URL: dipoleq-0.10.1.tar.gz
- Upload date:
- Size: 1.3 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d94da312d568970e9f602a7fa8a29207823ad590b127c02f350ac62bc504ef59 |
|
MD5 | 2bd8d8913aa818b54529e6b7e7b98163 |
|
BLAKE2b-256 | 5b46f734b2a8b8a319990408024d19eb61e2742c91becbf3ede23ed11452910d |
File details
Details for the file dipoleq-0.10.1-cp312-cp312-win_amd64.whl
.
File metadata
- Download URL: dipoleq-0.10.1-cp312-cp312-win_amd64.whl
- Upload date:
- Size: 272.4 kB
- Tags: CPython 3.12, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8bbc197c36e421b2336e6a9d7b82341e15132cb99230cbc329b4573ef92d6d40 |
|
MD5 | 44cf34aef6a34381f247c9c307c2924b |
|
BLAKE2b-256 | 7a4d9729c8d58ed158d454e3171fa929b4d213035f4cf5be629cb5a55cd6acc1 |
File details
Details for the file dipoleq-0.10.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: dipoleq-0.10.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 360.8 kB
- Tags: CPython 3.12, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 08a48420344251858aa53e0142aefd8b87d01f282c27bcf72ff04804285e9c72 |
|
MD5 | dca0e19a9c01f10a9db34856bea61d67 |
|
BLAKE2b-256 | 724842916d4d325d4e234f69084bd896e589dfd661980ae097d93937d98922fa |
File details
Details for the file dipoleq-0.10.1-cp312-cp312-macosx_11_0_arm64.whl
.
File metadata
- Download URL: dipoleq-0.10.1-cp312-cp312-macosx_11_0_arm64.whl
- Upload date:
- Size: 298.1 kB
- Tags: CPython 3.12, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2a9005b1077cf06845174445391f45eb5826eeac2bd3e4a4e83b199a282d90c1 |
|
MD5 | 802c302f964a8678165803f8e44e8833 |
|
BLAKE2b-256 | 4038a7daac122fdfacbc98563d841abeacd622c598a04b328942b0ae22cb46b4 |
File details
Details for the file dipoleq-0.10.1-cp312-cp312-macosx_10_15_x86_64.whl
.
File metadata
- Download URL: dipoleq-0.10.1-cp312-cp312-macosx_10_15_x86_64.whl
- Upload date:
- Size: 333.0 kB
- Tags: CPython 3.12, macOS 10.15+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8cce79e7ed31bb5b1ca53624deef911ee121af96e882cf5429f616b7892dbe6f |
|
MD5 | 6a74caad6b18becfe0f708737f222e61 |
|
BLAKE2b-256 | 126544924407860d960896348e53c3924d84be87840321bbdee28edf4bdb35ae |
File details
Details for the file dipoleq-0.10.1-cp311-cp311-win_amd64.whl
.
File metadata
- Download URL: dipoleq-0.10.1-cp311-cp311-win_amd64.whl
- Upload date:
- Size: 274.0 kB
- Tags: CPython 3.11, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | df2c32907a46253bb066489d59e10aad4af4a55190bdd99c993e174677437c82 |
|
MD5 | 49d3e1daa17f3e0dad09f3078b55e96d |
|
BLAKE2b-256 | f7e9d0772ce234fb041609c8db771073a5b180379f76c337b7287ddf7e771066 |
File details
Details for the file dipoleq-0.10.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: dipoleq-0.10.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 362.1 kB
- Tags: CPython 3.11, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4a5592193af3dae21e457a8ba7c509626452f7cf81a4b685777b823bd0757377 |
|
MD5 | 466dae6eff37b10175020eb79ea01000 |
|
BLAKE2b-256 | bb3116895841c55fd0b1cc903afb9eb310a4212038391a0259c5f1c4af529087 |
File details
Details for the file dipoleq-0.10.1-cp311-cp311-macosx_11_0_arm64.whl
.
File metadata
- Download URL: dipoleq-0.10.1-cp311-cp311-macosx_11_0_arm64.whl
- Upload date:
- Size: 296.7 kB
- Tags: CPython 3.11, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1618c4198b8139702afc27f14a6b7c5f7e8ee79d8a13fcb43ad4f85d72c195d8 |
|
MD5 | 3cde60ca1d3fb1781444d80cd860a278 |
|
BLAKE2b-256 | fd6534ea88c5237a9ffdd3bdc02084e53c2bd801990172cd5243f70863238455 |
File details
Details for the file dipoleq-0.10.1-cp311-cp311-macosx_10_15_x86_64.whl
.
File metadata
- Download URL: dipoleq-0.10.1-cp311-cp311-macosx_10_15_x86_64.whl
- Upload date:
- Size: 329.7 kB
- Tags: CPython 3.11, macOS 10.15+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c00c7395953ffb4ac854ae361cd99360a55f2db9355c294e0a4af32e7642f514 |
|
MD5 | b305fe2198dc11a184c406c3e9edee25 |
|
BLAKE2b-256 | be1181751fc73efe184c48ab7e55538b34e8199a109da7ecec34793a6e4bf8f4 |
File details
Details for the file dipoleq-0.10.1-cp310-cp310-win_amd64.whl
.
File metadata
- Download URL: dipoleq-0.10.1-cp310-cp310-win_amd64.whl
- Upload date:
- Size: 272.5 kB
- Tags: CPython 3.10, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c410f4f2d38c4eaaa6f9584676b264a0056b65f55b04160ef035618707aa6fa4 |
|
MD5 | 7b4410da403109a7d899cd0d02b18def |
|
BLAKE2b-256 | 82045e0a7d36f36c26b8d8d977cca7bf1810846ade4df63dbb7df978ddba28bf |
File details
Details for the file dipoleq-0.10.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: dipoleq-0.10.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 361.8 kB
- Tags: CPython 3.10, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | dc5fc194d4f4fc1d7436b25216aea47eb5abd0ba1e87c24d0bdcf6e49ba6db6a |
|
MD5 | cd4497aba9dbac86f6c0738499aa0e1f |
|
BLAKE2b-256 | 384d9640bf5af1a23e23032707dd99236f6aba09d28dda333762c50742f7304a |
File details
Details for the file dipoleq-0.10.1-cp310-cp310-macosx_11_0_arm64.whl
.
File metadata
- Download URL: dipoleq-0.10.1-cp310-cp310-macosx_11_0_arm64.whl
- Upload date:
- Size: 295.2 kB
- Tags: CPython 3.10, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 46ffb50a8928dfe50ce4c5f4d5758ed60957010ff739c095efafe38a46119c56 |
|
MD5 | 989bd506fb9c4a00bb6a23b4175916c6 |
|
BLAKE2b-256 | 81ef0c1421c95a77a9a4338d30ba4a4c47115c30fe40cf505255172f1ef2a1f9 |
File details
Details for the file dipoleq-0.10.1-cp310-cp310-macosx_10_15_x86_64.whl
.
File metadata
- Download URL: dipoleq-0.10.1-cp310-cp310-macosx_10_15_x86_64.whl
- Upload date:
- Size: 328.6 kB
- Tags: CPython 3.10, macOS 10.15+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 65dbb9235d68e9debc00c91b457c80fa15dda7d247506d50de3d49d0e5c0cf90 |
|
MD5 | 27e1d9f0bd29bbec77abee69ac1c8e11 |
|
BLAKE2b-256 | 3ab2d86870a4c20f7e5232ef836fa8a1008a41410305509f660eb46f28f5eaa6 |