powderday
powderday copied to clipboard
double octree building
we currently go through gadget_field_add
twice in grid_construction.py. the first time is to establish the field aliases, and the second is to actually perform the smoothing on the octree.
this said, the octree is built twice. we can probably avoid this by implementing something like:
if add_smoothed_quantities == True:
left = np.array([pos[0] for pos in bounding_box])
right = np.array([pos[1] for pos in bounding_box])
#octree = ds.octree(left, right, over_refine_factor=cfg.par.oref, n_ref=cfg.par.n_ref, force_build=True)
octree = ds.octree(left,right,n_ref=cfg.par.n_ref)
ds.parameters['octree'] = octree```
in `gadget2pd.py`around line 240 or so.