Skip to main content

FreeGS4E: Free-boundary Grad-Shafranov for Evolution

FreeGS4E is a package forked from FreeGS (v0.6.1). It retains substantial code inherited from that general-purpose equilibrium solver, but not all inherited workflows remain supported.

Its intended usage is as an underlying solver for the dynamic (time-dependent) free-boundary equilibrium solver FreeGSNKE.

The addition and removal of features, together with performance optimisations needed by FreeGSNKE, mean that FreeGS4E has diverged significantly from the original FreeGS codebase.

Therefore, FreeGS4E is not intended to be a drop in replacement solver for FreeGS but rather is designed for use explicitly within FreeGSNKE.

The presence of an inherited module does not by itself mean that its original FreeGS workflow is supported. In particular, the standalone Picard inverse solver and its original control-constraint interface are not supported entry points for FreeGSNKE. See the support scope for the backend API used by FreeGSNKE, known unsupported behaviour, and the status of retained legacy code.

Installation

Because FreeGS4E is not a standalone equilibrium solver, we recommend following the installation instructions for FreeGSNKE (which will install FreeGS4E automatically).

If you would, however, like to contribute to FreeGS4E directly, please see the installation instructions in the section on contributing below.

Supported Python and dependencies

FreeGS4E supports Python 3.10 through 3.14. Its runtime dependency bounds are kept compatible with FreeGSNKE, which uses a subset of the same scientific Python envelope. Changes to shared lower or upper bounds should therefore be tested in both repositories before release.

Getting started

Supported examples can be found in the freegsnke/examples directory. Examples from the original FreeGS project should not be assumed to run with FreeGS4E.

Parallel execution

FreeGS4E contains multiple parallelized components for faster execution, through the use of multithreading.

The number of threads can be controlled through the environment variable OMP_NUM_THREADS (recommended). Note that by default the number of threads is limited to 32: for use in HPC systems, it is recommended to set the environment variable NUMEXPR_MAX_THREADS to the number of available cores.

More fine grained parallel control can be achieved by using the environment variable NUMEXPR_NUM_THREADS or programatically through the use of the function set_num_threads() in freegs4e.parallel. These will change the number of threads used by parallel functions in FreeGS4E without affecting the number of threads used by OMP-based libraries (e.g. numpy).

Finally, thread control can be managed through threadpoolctl using the user api tag fg_threads, for example, threadpool_limits(limits=1,user_api='fg_threads').

Contributing

We welcome contributions including bug fixes or new feature requests for FreeGS4E, though we would suggest making these via issues on the FreeGSNKE homepage.

If you would, however, like to install FreeGS4E separately for development purposes, clone this repository, and install the package in editable mode with the development dependencies:

git clone git@github.com:FusionComputingLab/freegs4e.git

cd freegs4e

pip install  -e  ".[dev]"

Changes to the main branch must be made via pull request. If you don't have write access to the repository, pull requests through GitHub forks are welcome.

Pre-commit hooks are used to ensure code quality so do make sure you install the following pre-commit hooks and run them prior submitting pull requests:

pre-commit install

License

Copyright 2024 Nicola C. Amorisco, George K. Holt, Adriano Agnello, and other contributors.

FreeGS4E is licensed under the GNU Lesser General Public License version 3. The license text is included in the file LICENSE.

The license text for FreeGS is reproduced below:

Copyright 2016-2021 Ben Dudson, University of York, and other contributors.
Email: benjamin.dudson@york.ac.uk

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.

Metadata

Release files for freegs4e 0.16.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for freegs4e 0.16.0
File Size Uploaded
freegs4e-0.16.0.tar.gz 131.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for freegs4e 0.16.0
File Interpreter ABI Platform
freegs4e-0.16.0-py3-none-any.whl Python 3 none any Details

Total release size: 287.9 kB

Release files / freegs4e-0.16.0.tar.gz

Download URL freegs4e-0.16.0.tar.gz
Size 131.7 kB
Tags Source
SHA-256 checksum
How to use checksums
872026f172cf73e1d69f443ff68f8a97d0bfe5dad20eef1f9995aa5588ad5ff8
BLAKE2b-256 checksum
How to use checksums
047312e2fbcdc007832260dba2d6ccd72055429204a1508138ae71da9b1728e6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.8

Release files / freegs4e-0.16.0-py3-none-any.whl

Download URL freegs4e-0.16.0-py3-none-any.whl
Size 156.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0bfc4b6982369056b8df8b130f34c17516ba49db988cee205634db0b6db68c77
BLAKE2b-256 checksum
How to use checksums
0fef7601501caec69228c58d038e74ecab68f0d1e09d33fb755918f2a3bd7b0f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.8

Release history Release notifications | RSS feed

This release

0.16.0 This release

2 release files

0.15.0

2 release files

0.14.0

2 release files

0.13.1

2 release files

0.13.0

2 release files

0.11.0

2 release files

0.10.0

2 release files

0.9.0

2 release files

0.8.0

2 release files

0.7.0

2 release files

0.6.0

2 release files

0.5.0

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page