Unfortunately, flatten_density() is quite slow. I am wondering whether some speed could be gained by allocating memory for grid_flux*_init before the first iteration of flatten_density() and then be kept alive until the integration is finished for this inset. At the same points in the code, the plans could perhaps be created and destroyed only once per inset.
Unfortunately,
flatten_density()
is quite slow. I am wondering whether some speed could be gained by allocating memory forgrid_flux*_init
before the first iteration offlatten_density()
and then be kept alive until the integration is finished for this inset. At the same points in the code, the plans could perhaps be created and destroyed only once per inset.