Feature/calculate fields from nonadiabatic dist fn
David Dickinson
Branch: feature/calculate_fields_from_nonadiabatic_dist_fn
Branch: 8.1-RC
Merged
Merged pull request
Merged in feature/calculate_fields_from_nonadiabatic_dist_fn (pull request #426)
Merged in feature/calculate_fields_from_nonadiabatic_dist_fn (pull request #426)
Rewrite getan in terms of a routine which takes the distribution function to use.
Rename getan_from_g to getan_from_dfn
Add a routine to calculate the potentials from a given distribution function
This routine considers the passed distribution function to be the "raw" non-adibatic distribution function, rather than the function evolved by GS2,
g
.Add
initial_condition_is_nonadiabatic_dfn
input flagIf true then we assume the initial condition specifies the initial non-adibatic distribution function, rather than the compound function evolved by GS2. If true this triggers a calculation of the consistent fields and uses these to form the function evolved by GS2.
This can make the initial conditions a bit better behaved. For example before this flag we can find the initial potentials becoming very large as the wavenumber becomes small and in general
phiinit
doesn’t actually directly correspond to the size of the initial potentials.We definitely need a test. A simple test may be just to set this flag true and then check that the initial fields calculated in the usual manner are consistent with those calculated in
init_g
.We may also need to think if it ever makes sense for this to be allowed when restarting. If not then we could make the logic reflect this.