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

Moving estimators increments from radiation into subroutines (estimators for PPL ionization solver and IP) #71

Merged
merged 7 commits into from
Mar 3, 2014

Conversation

jhmatthews
Copy link
Collaborator

Currently we duplicate code between radiation() and bf_estimators_increment(), which are the corresponding routines which increment estimators in non-macro atom and macro atom mode when a photon travels ds inside a cell.

To avoid this, I've moved all the duplicated incrementing to a subroutine called update_banded_estimators(). This routine

  • updates j, j_direct, j_scatter
  • updates ip, ip_direct, ip_scatter
  • updates the banded estimators we use e.g. xave_freq, xj etc for each band
  • updates n_ds, mean_ds and ave_freq

I've also moved the part where photon stats are saved to a file as part of Extra_diagnostics to a new subroutine called save_photon_stats.

This shouldn't change how anything works and is merely to avoid duplication. Only files modified are radiation.c and estimators.c

jhmatthews added a commit that referenced this pull request Mar 3, 2014
Moving estimators increments from radiation into subroutines (estimators for PPL ionization solver and IP)
@jhmatthews jhmatthews merged commit ef2f061 into sirocco-rt:dev Mar 3, 2014
@jhmatthews
Copy link
Collaborator Author

I've tested this with a fiducial model, it produces identical answers so merging into dev.

test_bands

dotted lines and solid lines show before and after for three random cells. Numbers have also been checked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant