-
Notifications
You must be signed in to change notification settings - Fork 5
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
Preparation for adding electrons #207
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
If dimension has size 1 for some input it cannot be parallelised, so there is no need to check it (for that case). By skipping size 1 dimensions, we can reduce the number of combinations that need debug tests, which speeds up the tests.
Ensures that a correct region type is being used, rather than relying on the calling site of the derivative_*!() function to have already set a correct region type.
Allows `setindex!()` for DebugMPISharedArray to be used with, for example, `Float128` values, not just `mk_float`. Any type that is OK for the underlying `setindex!()` of `Array{mk_float,N}` should be supported.
This makes it easier to add the run_id to multiple output files, which might not be created by the same function.
The separate functions are also called by a single output function so the original call-site does not get more complicated, but the individual functions can be called on their own if necessary.
It can be useful to know how much of a change the 'moment constraint corrections' are having to apply. To help diagnose this, store the values of the coefficients used to apply the constraints (for each species of ion and neutral, at each spatial point) into arrays in the `moments` structs, and write out the most recent values at each output.
…ance!() Will allow them to be passed into init_pdf_and_moments() in future to be used in kinetic electron setup.
Will be useful for boundary conditions for electrons.
Allow passing or returning `nothing` if a coordinate is not present.
Define reload_moments(), etc., functions at the module level instead of locally inside reload_evolving_fields!(). This will allow (some of) these functions to be used separately to reload electron variables.
Previously, the moments of the source term were introduced in vpa/vz 'advection speed' and in source_terms in terms of `external_source_amplitude`. The moments were taken assuming that the source is a Maxwellian with temperature `T_source`. This is not true for "energy_source" (where the source is defined as roughly 'f_M - f' in such a way that no particles are introduced). However, the moments of the source term are already calculated in external_density_source and external_pressure_source, so these can be used instead to support more generic source terms.
The corrected form is similar to the ion one, and has correct dimensions.
Fixes changes from 399e521.
Also avoid division by zero - in a hacky way by just setting the result to zero if we would have divided by zero.
Lets code be run just to write out the initial profiles.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
A lot of minor structural changes, being added now to reduce the number of conflicts when the electron branch (the latest is currently electrons-jto-debug) is added.