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

oref != 0 leads to an array broadcasting error #139

Open
christopherlovell opened this issue Aug 4, 2021 · 0 comments
Open

oref != 0 leads to an array broadcasting error #139

christopherlovell opened this issue Aug 4, 2021 · 0 comments

Comments

@christopherlovell
Copy link
Contributor

Using an over refine factor greater than zero leads to a broadcasting error.

Traceback (most recent call last):
  File "/home/c.lovell/codes/powderday_chris/pd_front_end.py", line 74, in <module>
    m, xcent, ycent, zcent, dx, dy, dz, reg, ds, boost = m_gen(fname, field_add)
  File "/home/c.lovell/codes/powderday_chris/powderday/sph_tributary.py", line 35, in sph_m_gen
    refined,dustdens,fc1,fw1,reg,ds = yt_octree_generate(fname,field_add)
  File "/home/c.lovell/codes/powderday_chris/powderday/grid_construction.py", line 158, in yt_octree_generate
    dust_smoothed_manual = manual_oct(reg, refined)
  File "/home/c.lovell/codes/powderday_chris/powderday/dust_grid_gen.py", line 30, in manual_oct
    dust_smoothed[wFalse]  = dust_to_gas_ratio * density_smoothed
ValueError: shape mismatch: value array of shape (9619,) could not be broadcast to indexing result of shape (76952,)

I think there is possibly something going on around line 128 in powderday/grid_construction.py, where oref is used to define refined:

refinements = 2**(3*cfg.par.oref)
refined2 = []
for r in refined:
    if r == 1:
        refined2.append(True)
    if r == 0:
        refined2.append(np.zeros(refinements).astype('bool'))
refined = np.hstack(refined2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant