-
Notifications
You must be signed in to change notification settings - Fork 217
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
Implementation of Maxwell Juettner distribution #4826
Implementation of Maxwell Juettner distribution #4826
Conversation
For some reason, the CI files with some python style issue - code that you did not touch. |
include/picongpu/particles/manipulators/unary/MaxwellJuettner.hpp
Outdated
Show resolved
Hide resolved
include/picongpu/particles/manipulators/unary/MaxwellJuettner.def
Outdated
Show resolved
Hide resolved
@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. |
include/picongpu/particles/manipulators/unary/MaxwellJuettner.hpp
Outdated
Show resolved
Hide resolved
u = (-1._X) * theta * math::log(x1 * x2 * x3); | ||
|
||
x4 = uniformNoZeroRng(); | ||
nu = (-1._X) * theta * log(x1 * x2 * x3 * x4); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bug!!: must be math::log
else C function can be used which can have strong side effects
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe for performance reasons it is better to write
foo = -1._X * theta;
bar = math::log(x1*x2*x3);
u = foo * bar;
nu = fo * (bar + log(x4);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you very much for the suggestions! Will be implemented.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@psychocoderHPC That still calls log
twice, thus no performance gain.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
stays the same
47030d4
to
bb4b648
Compare
@SergeyKonstantinErmakov This pull request failed with a formatting issue, but I do not see in the logs why clang format changed. |
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 ? |
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 |
PS: As an explanation, |
@chillenzer can we run |
Thanks to everyone for suggestions and comments! These will be implemented ASAP. |
Hi @SergeyKonstantinErmakov, in case you forgot about this pull request: The clang format issue is still open. |
Hi @SergeyKonstantinErmakov, what's the status of this pull request? |
bb4b648
to
6f3c12b
Compare
@SergeyKonstantinErmakov I removed all files that should not be part of this PR, rebased, formatted the code, and squashed all into a single commit. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
include/picongpu/particles/manipulators/unary/MaxwellJuettner.def
Outdated
Show resolved
Hide resolved
* @tparam T_ValueFunctor pmacc::math::operation::*, binary functor type to | ||
* add a new momentum to an old one | ||
*/ | ||
/** @tparam T_ValueFunctor pmacc::math::operation::*, binary functor type to | ||
* add a new momentum to an old one | ||
* @{ | ||
*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this seems to be doubled up
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
was fixed
/** Version with fixed temperature given via parameter struct | ||
* | ||
* @tparam T_ParamClass configuration parameter, follows requirements of param::MaxwellJuettnerCfg | ||
*/ | ||
/** USE THIS IN THE SAME WAY AS Temperature.hpp JUST REPLACE Temperature with MaxwellJuettner FOR | ||
* ALL FUNCTOR AND TEMPLATE NAMES**/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
both comment blocks claim to be documentation of something following them, I think you intended them to be one block.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
was fixed by @SergeyKonstantinErmakov
/** Version with fixed temperature given via parameter struct | ||
* | ||
* @tparam T_ParamClass configuration parameter, follows requirements of param::MaxwellJuettnerCfg | ||
*/ | ||
/** USE THIS IN THE SAME WAY AS Temperature.hpp JUST REPLACE Temperature with MaxwellJuettner FOR | ||
* ALL FUNCTOR AND TEMPLATE NAMES**/ | ||
template<typename T_ParamClass, typename T_ValueFunctor> | ||
struct MaxwellJuettner; | ||
|
||
/** Version with user-provided temperature functor | ||
* | ||
* @tparam T_MaxwellJuettnerFunctor temperature functor, follows requirements of | ||
* param::MaxwellJuettnerFunctor | ||
*/ | ||
template<typename T_Functor, typename T_ValueFunctor> | ||
struct FreeMaxwellJuettner; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should in general think about unifying this param class structure with the existing temperature functor, it does not make that much sense to have tow completely separate temperature param class definitions that are one to one copies.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree but let us bring this in and in a separate PR unify it. The user should not see the unification.
include/picongpu/particles/manipulators/unary/MaxwellJuettner.hpp
Outdated
Show resolved
Hide resolved
Great Question! PS: push will follow next thursday :) |
@SergeyKonstantinErmakov ping!, gentle reminder ;) |
@SergeyKonstantinErmakov Could we finish this pull request this week together? |
include/picongpu/particles/manipulators/unary/MaxwellJuettner.hpp
Outdated
Show resolved
Hide resolved
5680c3d
to
8897c96
Compare
include/picongpu/particles/manipulators/unary/MaxwellJuettner.hpp
Outdated
Show resolved
Hide resolved
ping @PrometheusPi |
ping again @PrometheusPi |
@PrometheusPi If this should be part of the next release we need asap a rebase and update of this PR |
916a8f4
8897c96
to
916a8f4
Compare
@steindev please review then I can squash |
7ffae51
to
13de134
Compare
@steindev fixed author and squashed - ready for review and merge |
5a07728
to
49a9c7e
Compare
49a9c7e
to
cb769c6
Compare
@steindev No code changes with the last force push, only linked @SergeyKonstantinErmakov now correctly via his email |
@PrometheusPi you should wait to fix the CI issues until #5133 is merged. |
cb769c6
to
b7b08d0
Compare
@steindev The CI discovered a real clang-format issue. This is fixed now. Please review again and merge. |
you can already rebase against #5133 and fix the issues locally |
I chacked the code changes looks like this PR is not affected by #5133 |
The PR ComputationalRadiationPhysics#5133 and ComputationalRadiationPhysics#5142 got merged together with ComputationalRadiationPhysics#4826. Removed files and renamings for the unit systems collide therefore.
The PR ComputationalRadiationPhysics#5133 and ComputationalRadiationPhysics#5142 got merged together with ComputationalRadiationPhysics#4826. Removed files and renamings for the unit systems collide therefore.
Closes #4814
[added by @PrometheusPi]
Velocity distribution for highly relativistic particle temperatures. For this see
MaxwellJuettner.hpp
andMaxwellJuetner.def
.For verification, a temperature of 10MeV was used.