Skip to content

Plotting grids in 2D and 3D #159

@ammarhakim

Description

@ammarhakim

We need a way to visualize 2D and 3D grids. The grids can be either specified as a NDIM component field with coordinates for each node specified, or a mapc2p representation as a DG field (which may be higher than just piecewise linear).

This is important to be able to viz the grids we make for moments as well and for the DG code, including GK. Eventually we want to support 1D, 2D and 3D grids.

To get the process moving I have created a 2D grid viz command called showgrid in the plot-grid branch. For now this only works in 2D and does no error checking at all. However, it illustrates the method and can be used a starting point for making more production quality plots with titles, labels, etc. For now it allows to make plots of 2D grids so I can viz them. But we need to improve with more features.

I have added the test data file tests/test_data/nodal_coords-sqrt-psi.gkyl. The command:

pgkyl nodal_coords-sqrt-psi.gkyl showgrid --aspect 0.05

will make the following plot:

Image

Metadata

Metadata

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions