On-the-fly interpolation of collision coeffs.#135
On-the-fly interpolation of collision coeffs.#135allegroLeiden merged 5 commits intolime-rt:masterfrom tlunttil:coll_coeffs
Conversation
This commit implements the on-the-fly interpolation of collisional coefficients that was discussed in comments to issue #81. With the default example model memory saving is about 50% and there is no effect on speed.
|
This all looks good, I just have a few stylistic quibbles as follows:
Then the next 2 lines (actually a single line, wrapped) would become much more compact/readable as well as more conservatively expressed: |
|
Yep, I forgot to remove the commented-out old parts. I'll do that, and your other suggested changes, and push a new version probably later today. |
This was a difficult merge because PR lime-rt#135 by @tlunttil dealt with matters overlapping the present PR. I have modified the @tlunttil code as follows: - His new double** 'down' attribute of struct molData stores the same data as the double* attribute 'colld' of struct cpData which I introduced in the present PR. I have renamed 'colld' as 'down' but kept it as part of cpData. - The code where the new @tlunttil fields of struct rates are set has been moved from molini.c:molinit() to the appropriate place, namely grid.c:calcGridCollRates(). The name of this function is no longer quite accurate, but I don't think that matters.
Implementation of the on-the-fly interpolation of collisional
coefficients that was discussed in comments to issue #81. With the
default example/model.c memory saving is about 50% and there is no
effect on speed.