powderday icon indicating copy to clipboard operation
powderday copied to clipboard

double octree building

Open dnarayanan opened this issue 4 years ago • 0 comments

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.

dnarayanan avatar May 22 '20 20:05 dnarayanan