Skip to main content

DipolEq equilibrium solver python bindings.

Project description

DipolEq

Documentation Status Actions Status codecov PyPI version PyPI platforms Contributor Covenant Ruff

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

dipoleq-0.10.0.tar.gz (1.3 MB view details)

Uploaded Source

Built Distributions

dipoleq-0.10.0-cp312-cp312-win_amd64.whl (272.4 kB view details)

Uploaded CPython 3.12 Windows x86-64

dipoleq-0.10.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (360.9 kB view details)

Uploaded CPython 3.12 manylinux: glibc 2.17+ x86-64

dipoleq-0.10.0-cp312-cp312-macosx_11_0_arm64.whl (298.1 kB view details)

Uploaded CPython 3.12 macOS 11.0+ ARM64

dipoleq-0.10.0-cp312-cp312-macosx_10_15_x86_64.whl (333.0 kB view details)

Uploaded CPython 3.12 macOS 10.15+ x86-64

dipoleq-0.10.0-cp311-cp311-win_amd64.whl (274.0 kB view details)

Uploaded CPython 3.11 Windows x86-64

dipoleq-0.10.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (362.1 kB view details)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

dipoleq-0.10.0-cp311-cp311-macosx_11_0_arm64.whl (296.7 kB view details)

Uploaded CPython 3.11 macOS 11.0+ ARM64

dipoleq-0.10.0-cp311-cp311-macosx_10_15_x86_64.whl (329.7 kB view details)

Uploaded CPython 3.11 macOS 10.15+ x86-64

dipoleq-0.10.0-cp310-cp310-win_amd64.whl (272.5 kB view details)

Uploaded CPython 3.10 Windows x86-64

dipoleq-0.10.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (361.8 kB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

dipoleq-0.10.0-cp310-cp310-macosx_11_0_arm64.whl (295.2 kB view details)

Uploaded CPython 3.10 macOS 11.0+ ARM64

dipoleq-0.10.0-cp310-cp310-macosx_10_15_x86_64.whl (328.6 kB view details)

Uploaded CPython 3.10 macOS 10.15+ x86-64

File details

Details for the file dipoleq-0.10.0.tar.gz.

File metadata

  • Download URL: dipoleq-0.10.0.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

Hashes for dipoleq-0.10.0.tar.gz
Algorithm Hash digest
SHA256 6b9128fbd7bcf443baaf2cf3217a11e07320377b2fa614fb7c19eba537453eb7
MD5 03817fccbf4cc7d87548ae8f8ff012c8
BLAKE2b-256 f2a4f99e5dfb3931bac35a6c0293b286c8bd0a4a238812d278b9669efd854c42

See more details on using hashes here.

File details

Details for the file dipoleq-0.10.0-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: dipoleq-0.10.0-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

Hashes for dipoleq-0.10.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 e32b23a107ba3cca697c0fec33c3fe2df41971096f1ad9309893b33c0c7a1cb8
MD5 15f7da5815f8558139c2dbe2efe58a54
BLAKE2b-256 c0548f6ee650a2bdb5c7e8c7ed400b2e2910cdcff51e7cf6e1d3dec67b056653

See more details on using hashes here.

File details

Details for the file dipoleq-0.10.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for dipoleq-0.10.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 b4cf1d5f4630a5e9f45c76a162866456f7beb78178427edf5c96b9e900c85aba
MD5 8afcdacbd398bf894797871d9a8bd6a7
BLAKE2b-256 2200712f6a0a77109707aa2e929b5af5a37b970b02234b2ff93da5d494b645ec

See more details on using hashes here.

File details

Details for the file dipoleq-0.10.0-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for dipoleq-0.10.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c6e8bdbaff07d3a54a6b9ca9224470aa1d25e1a247d45da2e28af5acc4bba210
MD5 faf8269cc0e2e71578880040cd9159d9
BLAKE2b-256 69c8afd7a3540023a147393747ddc1737d7eb5b1bc40a98be0373fc299519eaa

See more details on using hashes here.

File details

Details for the file dipoleq-0.10.0-cp312-cp312-macosx_10_15_x86_64.whl.

File metadata

File hashes

Hashes for dipoleq-0.10.0-cp312-cp312-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 224a18e54c3943ab25133f92e001b3ed69e690b295d19b541ab4e55ae79f860b
MD5 cb763ccbcdaa49019e585f65837e7100
BLAKE2b-256 4e5f8f68c8444bd9b4dc0ed60b3a3c787a0b54ae9fb777ff9e78aa1139270c72

See more details on using hashes here.

File details

Details for the file dipoleq-0.10.0-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: dipoleq-0.10.0-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

Hashes for dipoleq-0.10.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 bbc21ccefffe5b0c93bbcec687f9a3d82eab6638f609fca70ae8d895f812a168
MD5 76cb151adbb1418c0f8383c5c3e04895
BLAKE2b-256 aa697a23ba6e4e8f6d132dd99045f5326d62affb49ceb31a8c2745c1c198d866

See more details on using hashes here.

File details

Details for the file dipoleq-0.10.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for dipoleq-0.10.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 8d68bdc0726f9f990a2ec07b41b0b5e854be0ed21355c532fe848b24206aafc0
MD5 0b73481f15d02c380c07ff099cf19c73
BLAKE2b-256 e436fd4da5607a50edd339eb5345e4fda1dc8193556e93f3cc1d86f7dd42b9d9

See more details on using hashes here.

File details

Details for the file dipoleq-0.10.0-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for dipoleq-0.10.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 3e3c15342fd81d7067d5f766c4d9f51f6983da680341dc71c37a6ac80653e51a
MD5 51a1f6c8d5d67ffca72ff73cfefa4f72
BLAKE2b-256 721d83c5c8f50c171471be7637e02d524097a83c93bb66abcc41d1eef378704b

See more details on using hashes here.

File details

Details for the file dipoleq-0.10.0-cp311-cp311-macosx_10_15_x86_64.whl.

File metadata

File hashes

Hashes for dipoleq-0.10.0-cp311-cp311-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 4176499e20925d67c7c90db0d4078656ae0ab5fac03bcad7671582a9f64c0ebf
MD5 74983bc7c4149026beac885c1ab32524
BLAKE2b-256 25ade66930d5e0dc9d33d2876c0b4bde042592eae92d02e1f38668c651e0eb94

See more details on using hashes here.

File details

Details for the file dipoleq-0.10.0-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: dipoleq-0.10.0-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

Hashes for dipoleq-0.10.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 7c07c9528cbd240d28212037b1af3bb1a4b975859ede16ee855bc15c33887d2e
MD5 2261b784f0dea92eef08eb2d51431257
BLAKE2b-256 8321c9dffcd19a32dcf9ee73498d72f48281b202d0c7bbc19efae819144de32f

See more details on using hashes here.

File details

Details for the file dipoleq-0.10.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for dipoleq-0.10.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 fe3f82ab54c632af8fcd450ec6a6c48326cbc1af4aabb47642166df97b11df57
MD5 c0fca00585a79bb562544f4f09370031
BLAKE2b-256 df933f3d0de1a773799149e18ac736f1b669d2f15e6f395daafa104f5bc10771

See more details on using hashes here.

File details

Details for the file dipoleq-0.10.0-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for dipoleq-0.10.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 0a66fafb895677a7c1b689bbc8e25bd7a5d919aebd69b022641b0a3af36a6de8
MD5 7f030e88211004313b68c52ae729e001
BLAKE2b-256 4297f0cfd4380e8538d2b7a83f5d27c93ca375315f58c9e90e000cb067aaa8b8

See more details on using hashes here.

File details

Details for the file dipoleq-0.10.0-cp310-cp310-macosx_10_15_x86_64.whl.

File metadata

File hashes

Hashes for dipoleq-0.10.0-cp310-cp310-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 2aed8f9ee8dd82dcb09b8b2e980d8934fdb4ff101cb4cefceb20a07d133ef2e2
MD5 f4a128c9a465174447cdc818b6667bd3
BLAKE2b-256 575e51dc482b23760f3ccbfa0bc21887c818efada0d98c6e58e2e36e99bdffcb

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page