You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I tried running the smooth problem using the advection solver, I noticed that the code was failing when it tries to create new ArrayIndexer objects here
F_xt and F_yt are defined here as the product of a scalar and an ArrayIndexer object, however they have not been correctly initialized with grids. It looks like unyt does some clever stuff with multiplication in https://github.com/yt-project/unyt/blob/679a4473e8944a9a55f7ffc0a72f569e6c23d85e/unyt/array.py#L1535-L1681 to ensure consistency of units, so we may need to create some wrapper for this that adds the grids back in.
I managed to fix this by initializing the arrays first:
Activity
zingale commentedon Jul 30, 2018
yt-project/unyt#39
harpolea commentedon Aug 10, 2018
@mojiastonybrook: Looking at https://github.com/python-hydro/pyro2/blob/units/mesh/array_indexer.py in 35f74c4, I've noticed a couple of things:
The copy function does not copy over the units. Compare the pyro version
pyro2/mesh/array_indexer.py
Lines 114 to 116 in 35f74c4
vs the unyt version
https://github.com/yt-project/unyt/blob/679a4473e8944a9a55f7ffc0a72f569e6c23d85e/unyt/array.py#L1683-L1717
When I tried running the smooth problem using the advection solver, I noticed that the code was failing when it tries to create new ArrayIndexer objects here
pyro2/advection/advective_fluxes.py
Lines 98 to 99 in 35f74c4
I managed to fix this by initializing the arrays first: