picongpu icon indicating copy to clipboard operation
picongpu copied to clipboard

Implementation of Maxwell Juettner distribution,

Open SergeyKonstantinErmakov opened this issue 2 years ago • 16 comments

Closes #4814

  • [x] rebase against dev branch after #4820 is merged

[added by @PrometheusPi]

Velocity distribution for highly relativistic particle temperatures. For this see MaxwellJuettner.hpp and MaxwellJuetner.def.

For verification, a temperature of 10MeV was used. MaxwellJuettner

SergeyKonstantinErmakov avatar Feb 22 '24 18:02 SergeyKonstantinErmakov

For some reason, the CI files with some python style issue - code that you did not touch. I will retrigger the CI.

PrometheusPi avatar Feb 23 '24 10:02 PrometheusPi

@SergeyKonstantinErmakov the CI complains because you are using an old dev as the base for your pull request(PR) and that is what the CI checks. Please rebase your PR to the current dev.

BrianMarre avatar Feb 23 '24 13:02 BrianMarre

@SergeyKonstantinErmakov This pull request failed with a formatting issue, but I do not see in the logs why clang format changed.

PrometheusPi avatar Feb 29 '24 14:02 PrometheusPi

For me this error looks like a CI issue and not a common clang format error (which gives the not code style conform code lines). Could you have a look @psychocoderHPC and @chillenzer ?

PrometheusPi avatar Feb 29 '24 14:02 PrometheusPi

Nope, that's a real formatting issue. Following steps will give you a passing CI (see https://picongpu.readthedocs.io/en/latest/dev/docs/COMMIT.html for details):

# install pre-commit if not yet done
cd /path/to/repo
git checkout add_MaxwellJuettner
pre-commit install
pre-commit run --all-files
git add -u
git commit -m "Fix formatting issues"
git push

chillenzer avatar Feb 29 '24 15:02 chillenzer

PS: As an explanation, clang-format is run within pre-commit since #4817. Which would "report" the necessary changes by editing the files themselves (just like a local run of clang-format would do). In the CI these local changes are wiped out immediately afterwards, so that is not particularly helpful, I agree. pre-commit has better ways to handle this that we currently do not leverage because they are not quite aligned with how we handle CI.

chillenzer avatar Feb 29 '24 17:02 chillenzer

PS: As an explanation, clang-format is run within pre-commit since #4817. Which would "report" the necessary changes by editing the files themselves (just like a local run of clang-format would do). In the CI these local changes are wiped out immediately afterwards, so that is not particularly helpful, I agree. pre-commit has better ways to handle this that we currently do not leverage because they are not quite aligned with how we handle CI.

@chillenzer can we run git diff in the CI in case a test fails? To show the broken lines?

psychocoderHPC avatar Feb 29 '24 19:02 psychocoderHPC

Thanks to everyone for suggestions and comments! These will be implemented ASAP.

SergeyKonstantinErmakov avatar Mar 04 '24 12:03 SergeyKonstantinErmakov

Hi @SergeyKonstantinErmakov, in case you forgot about this pull request: The clang format issue is still open.

PrometheusPi avatar Apr 09 '24 07:04 PrometheusPi

Hi @SergeyKonstantinErmakov, what's the status of this pull request?

PrometheusPi avatar May 06 '24 15:05 PrometheusPi

@SergeyKonstantinErmakov I removed all files that should not be part of this PR, rebased, formatted the code, and squashed all into a single commit. I committed all under your credentials.

psychocoderHPC avatar May 07 '24 15:05 psychocoderHPC

in general @SergeyKonstantinErmakov could you rerun the your tests/provide your test scripts to verify the distribution of the current version?

Also the distribution seems to deviate for low energies, do we know why? No Accusation just a a honest question

Great Question! You can find the answer in the paper which I used as a basis for this implementation https://doi.org/10.1063/1.4919383 under Sobols Method. They explicitly state bad convergence for small energies which essentially comes from one of the approximations for the distribution which they have made (for details see paper), which only agrees for large values. Since Maxwell Juettner is used for high temperatures only, this is not an issue. I determined that the convergence becomes significantly worse below 10 keV energies. For energies below this level, I suggest using Maxwell Boltzmann. Maybe this is something which I should document, thanks for pointing that out!

PS: push will follow next thursday :)

SergeyKonstantinErmakov avatar May 08 '24 11:05 SergeyKonstantinErmakov

@SergeyKonstantinErmakov ping!, gentle reminder ;)

BrianMarre avatar May 22 '24 15:05 BrianMarre

@SergeyKonstantinErmakov Could we finish this pull request this week together?

PrometheusPi avatar Jun 04 '24 09:06 PrometheusPi

@psychocoderHPC you can review a second time

PrometheusPi avatar Jun 26 '24 11:06 PrometheusPi

ping @PrometheusPi

steindev avatar Aug 06 '24 12:08 steindev