Skip to main content

A small UI for running CQL3D

Project description

CQL3DUI

A simple user-interface for the Bounce-Averaged Fokker-Planck code CQL3D.

Author: Matthew Poulos (CompX) Email: poulos@compxco.com


Overview

CQL3DUI is a simple Python/Tkinter-based GUI for the Fortran-based code CQL3D. The interface allows users to:

  1. Import, export, view, and edit cqlinput files (Fortran namelists).
  2. Compile, load and run CQL3D executables.
  3. Plot and visualize the resulting output (NetCDF) from CQL3D.

Detailed information and documentation on CQL3D can be found at:


Installation

To install CQL3DUI, open a terminal and run:

pip install cql3dui

To run CQL3DUI, simply type:

cqlui

Compiling CQL3D

Prerequisite: You must have NetCDF, PGPLOT, and gfortran downloaded and installed.

Click the button labeled Compile CQL3D located in the lower left corner of the UI. A new interface called CQL3D Compiler will pop up. The interface will attempt to automatically detect the necessary NetCDF library and PGPLOT path. It will indicate if these files are successfully found in the Compilation Output. Click the button GENERATE MAKEFILE & COMPILE and the UI will automatically create a makefile and attemt to compile CQL3D using gfortran. A message box will appear indicating successful compilation. Once CQL3D is successfully compiled, exit the CQL3D Compiler interface to return to the main UI.

Optional: To load a pre-compiled CQL3D executable, click the button labeled Load Exec.


Running Example Tests

A set of example tests are provided in the package contents. On initial startup, the UI will automatically load with the namelist for Test 1.0 loaded and will automatically point to the correct auxiliary file folder to run all of the provided test cases.


Workflow

1. Import, View, and Edit Namelists

To import a test case, click the Import Namelist button in the top left of the UI and select any of the test files.

Editing Features:

  • Navigation: Use the GUI tabs to navigate through the file.
  • Documentation: Click on any variable to highlight it within the cqlinput_help documentation (displayed in the right panel).
  • Tooltips: Hover the cursor over any namelist variable to see a short description.
  • Export: Click Export Namelist to save the variables currently in the UI to a cqlinput (fortran namelist) file.

Keyboard Shortcuts:

Shortcut Action
Up / Down Move between variables in the left panel.
Ctrl + Left / Right Move between GUI tabs (Windows/Linux).
Cmd + Left / Right Move between GUI tabs (macOS).
Shift + Left / Right Move between instances of the highlighted variable in the help documentation.

2. Run CQL3D

Click the Run CQL3D button.

  • A runs folder is created in the current directory where the ui was launched from.
  • A subfolder labeled by the date and time is created inside runs.
  • The current namelist variables are saved to a cqlinput file inside that subfolder.
  • File Linking: The code checks if auxiliary files (eqdsk, rffile, etc.) are required.
    • It looks in the chosen auxiliary file folder for these files
    • If found, it creates symbolic links in the newly created run folder to the required files.
  • A separate thread is launched to execute CQL3D.
  • After completion, a window pops up showing the output and any errors.

3. Plot and Visualize Output

Once CQL3D has successfully completed:

  1. Click the Plot Results button (lower right).
  2. By default, the UI loads the NetCDF (.nc) file from the last successful run.
  3. Optional: If no .nc file exists or you wish to view a different run, click Load .nc file (top left) in the plotting interface.
  4. Navigate through the various options to visualize the physics results.
  5. Press the left/right arrow keys in the 2D velocity-space contours to cycle through flux surfaces.

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

cql3dui-0.0.10.tar.gz (11.3 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cql3dui-0.0.10-py3-none-any.whl (11.6 MB view details)

Uploaded Python 3

File details

Details for the file cql3dui-0.0.10.tar.gz.

File metadata

  • Download URL: cql3dui-0.0.10.tar.gz
  • Upload date:
  • Size: 11.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.5

File hashes

Hashes for cql3dui-0.0.10.tar.gz
Algorithm Hash digest
SHA256 9c896ac9aa4eb9a64cd2a29ece21859b98121b167c4aacf2e457e68d78d3e442
MD5 dd4941c7e68f4647c88e678c6edc5423
BLAKE2b-256 ba94c3941e80bf0edc5390ce9b635158c6f112b171b0b3c04f1e388221203328

See more details on using hashes here.

File details

Details for the file cql3dui-0.0.10-py3-none-any.whl.

File metadata

  • Download URL: cql3dui-0.0.10-py3-none-any.whl
  • Upload date:
  • Size: 11.6 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.5

File hashes

Hashes for cql3dui-0.0.10-py3-none-any.whl
Algorithm Hash digest
SHA256 84d06b87d413fe9726b9b5ee3b2ef0d82088b47bbc8ad4c851de59ab1720ad2f
MD5 406beabd4e5e8439086f2d5c9364225c
BLAKE2b-256 450d80c5357cfc6c9b67c17a89a3d4d96b967ba6864abe842bae2bb4e3a437ed

See more details on using hashes here.

Supported by

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