Skip to content

Gridplot tool#174

Open
mp5650 wants to merge 7 commits intomainfrom
gridplot-tool
Open

Gridplot tool#174
mp5650 wants to merge 7 commits intomainfrom
gridplot-tool

Conversation

@mp5650
Copy link
Copy Markdown
Collaborator

@mp5650 mp5650 commented Dec 18, 2025

Added gridplot tool to postgkeyll. Only file I changed was adding grid plot.py to src/postgkyl/commands and then declaring it in src/postgkyl/commands/init.py and src/postgkyl/pgkyl.py

Usage: pgkyl gridplot

Expects a directory like '_geometry/' to exist., the files '_bX-nodes.gkyl', and '_settings.gkyl' must exist in that directory.
Directory and relevant files can be generated using tokagridgen tool.

@mp5650 mp5650 requested a review from ammarhakim December 18, 2025 03:20
@Maxwell-Rosen
Copy link
Copy Markdown
Collaborator

Can you provide some examples of the kind of output and plots that this tool affords? How is this different than the plot nodes tool that was introduced in PR #173? Please provide some examples and use cases.

@mp5650
Copy link
Copy Markdown
Collaborator Author

mp5650 commented Feb 11, 2026

The gridplot tool is meant to serve as a companion tool to the tokagridgen tool. After the user generates a multi block simulation grid using the tokagridgen tool, the user can immediately plot the nodal mesh with the grid plot tool. One of the outputs of the tokagridgen tool is a _settings.gkyl file which automates the passing of plotting input arguments into the gridgen tool (e.g. number of null points, diverter plate geometry, separatrix psi value, mirroring grid over x axis) such that the only command argument the tool requires is the name of the simulation.

For example, if the simulation name in the tokagridgen file is nstxu_DN, all the user has to do after calling the tokagridgen tool is call gridplot nstxu_DN as shown below.

Screenshot 2026-02-08 at 6 16 47 PM Screenshot 2026-02-08 at 6 32 21 PM

By passing nstxu_DN, the code looks into the nstxu_DN_geometry/ directory which is created by the tokagridgen tool and reads the nodes for each node, psi of the equilibria, and settings file in order to plot the full multi block grid with the separatrix and diverter plates.

Some other examples of grids plotted with this tool:
Screenshot 2026-02-10 at 10 46 09 PM
Screenshot 2026-02-10 at 10 46 17 PM

In comparison to the plot nodes tool introduced in PR #173, this tool is a lot more limited in terms of use cases. However it can be a useful quality of life improvement when used for visualizing grids made with tokagridgen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants