Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AMReX/BoxLib Grid Reader #5901

Open
hgopalan opened this issue Apr 10, 2024 · 2 comments
Open

AMReX/BoxLib Grid Reader #5901

hgopalan opened this issue Apr 10, 2024 · 2 comments
Labels
feature-request Please add this cool feature!

Comments

@hgopalan
Copy link

hgopalan commented Apr 10, 2024

Describe the feature you would like to be added.

I use this plugin in Paraview to read the output data from AMR-Wind and ERF codes, being developed for energy applications. There is also a native python reader: https://yt-project.org which can handle the output files. However, I like using pyvista. I have been using it within PyQt5 interface for the last few years for urban climate modeling. I would request the ability to use the amrex data format within PyVista to avoid using paraview.

Links to VTK Documentation, Examples, or Class Definitions.

https://kitware.github.io/paraview-docs/latest/python/paraview.simple.AMReXBoxLibGridReader.html

Pseudocode or Screenshots

Sample code in yt:

ds=yt.load(sys.argv[1])
print("ds:",ds.field_list)
left_edge=ds.domain_left_edge
right_edge=ds.domain_right_edge
domain_dimension=[ds.domain_dimensions[0],ds.domain_dimensions[1],ds.domain_dimensions[2]]
nsize=ds.domain_dimensions[0]
vsize=ds.domain_dimensions[2]
all_data_level_0 = ds.arbitrary_grid(left_edge=left_edge,right_edge=right_edge,dims=domain_dimension)
velocityx = all_data_level_0["boxlib", "x_velocity"]
velocityy = all_data_level_0["boxlib", "y_velocity"]
velocityz = all_data_level_0["boxlib", "z_velocity"]
terrainBlank=all_data_level_0["boxlib", "z_phys"]

Outputs are numpy arrays and cane be plotted using matplotlib. I would prefer to natively plot the results using pyvista UI.

@hgopalan hgopalan added the feature-request Please add this cool feature! label Apr 10, 2024
@MatthewFlamm
Copy link
Contributor

I'm not sure whether this vtk reader is relevant here https://vtk.org/doc/nightly/html/classvtkAMReXGridReader.html

@tkoyama010
Copy link
Member

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request Please add this cool feature!
Projects
None yet
Development

No branches or pull requests

3 participants