Closed Dxyk closed 1 year ago
This is intended behavior. with_values()
completely replaces the values. This removes all dimensions that were only part of the old values and are not integral to the field. If you just want to get a copy with all values being zero, you could write
velocity_temporal_copy = velocity_temporal * 0
I see. Thanks for the swift reply!
Hello,
I want to create a 2D staggered grid that contains not only the spatial dimensions, but also the temporal dimension throughout the simulation. Here's how I initialized the field, and everything seems to work correctly so far. I'm not sure if this is the optimal way to do so, so please let me know if there is a better way.
Now I'd like to create another temporal staggered grid base on the dimension of the one I just created, but initialize all the values to 0. I attempted to use
SampledField.with_values
to do so, but it seems like the temporal channel dimension was not copied over.I'm not quite sure if this is a bug or is this the intended behaviour?
Thanks!