Add dimensionless initialisation mode to FokkerPlanck#12
Open
pineapple-bois wants to merge 1 commit intojohnaparker:mainfrom
Open
Add dimensionless initialisation mode to FokkerPlanck#12pineapple-bois wants to merge 1 commit intojohnaparker:mainfrom
pineapple-bois wants to merge 1 commit intojohnaparker:mainfrom
Conversation
This file contains hidden or 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
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.
This PR adds a mode argument to the
FokkerPlanckconstructor so that the solver can be instantiated using either physical or dimensionless parameters.The new argument is:
mode="physical"(default): preserves the existing API based ontemperatureanddragmode="dimensionless": allows scaled problems to be specified directly usingdiffusion, withouttemperatureordragBecause the default remains
mode="physical", existing code should continue to work unchanged.Motivation
The current API is a good fit for SI-style physical problems, but I also wanted to work directly with dimensionless variables. The aim here was to add that option without changing the existing physical path or touching the core solver logic.
What this changes
In physical mode, the constructor:
temperaturedragdiffusionbeta, mobility, and diffusion as beforeIn dimensionless mode, the constructor:
temperaturedragdiffusion, defaulting to1.0beta = 1So this only affects initialisation; the solver itself behaves as before.
Checks
To make sure this did not break the existing API, I:
The added tests cover:
mode="physical"Scope
I kept this PR fairly narrow. It is just about constructor semantics and basic dimensionless initialisation.
I have not tried to tackle the wider question of how forces, potentials, or model-specific reduced variables should be documented in a general dimensionless setting. I think that belongs in separate work.
Thanks for open-sourcing
fplanck. I have found it really useful in my own stochastic processes work, and this change came directly from using it for reduced and dimensionless formulations.Ian