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

Missing Layer in 3D Grid Variable (ERF Output) #5114

Open
wang1202 opened this issue Feb 7, 2025 · 1 comment
Open

Missing Layer in 3D Grid Variable (ERF Output) #5114

wang1202 opened this issue Feb 7, 2025 · 1 comment

Comments

@wang1202
Copy link

wang1202 commented Feb 7, 2025

Hello,

I found that the loaded variable is missing one layer in the 3D domain. Specifically, I'm loading the vertical velocity on a staggered grid, which has nz+1 elements in the vertical direction (where nz is the number of vertical grid cells in the simulation). I'm using ERF, and the staggered grid output is saved separately from the cell-centered output.

I think this may be yt's issue because I can see the full data with Paraview.

I've uploaded the test file for your reference:

pltW00200.zip

Below is a simple test script. ds.index.grids shows the correct dimensions, but other parts of the output do not.

import yt

# Here when loading the file, domain dimensions are 64 64 32]
ds = yt.load("pltW00200")

# and here the Bos grids are [64 64 33]
print(ds.index.grids)

# The staggered w should have 64 x 64 x 33 values, but I can only get 64 x 64 x 32
ad = ds.all_data()
z_velocity_stag = ad["z_velocity_stag"].to_value()
print('Shape of z_velocity_stag: ',z_velocity_stag.shape)
print('z-dim of z_velocity_stag (should be 33): ', int(len(z_velocity_stag) / 64 / 64))

And this is the output I got:

yt : [INFO     ] 2025-02-07 10:47:07,785 Parameters: current_time              = 5.0
yt : [INFO     ] 2025-02-07 10:47:07,785 Parameters: domain_dimensions         = [64 64 32]
yt : [INFO     ] 2025-02-07 10:47:07,786 Parameters: domain_left_edge          = [-1. -1.  0.]
yt : [INFO     ] 2025-02-07 10:47:07,786 Parameters: domain_right_edge         = [1. 1. 1.]
[BoxlibGrid_0000 ([64 64 33])]
Shape of z_velocity_stag:  (131072,)
z-dim of z_velocity_stag (should be 33):  32
@chrishavlin
Copy link
Contributor

Just took a quick look and looks to me like your staggered grids will effectively be truncated and the resulting array treated as cell-centered. Not really sure what it'd take to get it fully supported but I suspect it'd be pretty involved.

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

No branches or pull requests

2 participants