-
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
Refactor Density Profiles #1762
Refactor Density Profiles #1762
Conversation
151c23b
to
afce1d9
Compare
Oh I can feel it! Solid densities we are coming! |
Rename param and unitless file
change to density profile naming
afce1d9
to
7dd9d22
Compare
@PrometheusPi @psychocoderHPC let us merge this part already so we can build on the unit system with it. the left-over parts are just renamings for a follow up with sed scripts. |
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.
Some minor (required) changes and several (optional) improvements (which I would not see as required due to the time limitation with the upcoming hackathon).
Please also review DensityWeighting.hpp
line 60 where the comment would now be outdated.
And as mentioned in the description GAS_ENABLE
and variable names and comments in densityConfig.param
are outdated.
* Individual particle species can define a `densityRatio` flag relative | ||
* to this value. | ||
* | ||
* unit: ELEMENTS/m^3 |
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.
OPTIONAL:
could you rename ELEMENTS
to real particles
because electrons are no elements and elements can be mistaken as macro-particles.
(and other places)
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 will keep it for now, since I am talking unit here.
real particles
is not a unit, maybe number count
instead of elements
. an other time.
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.
agreed 👍
{ | ||
template<typename T_ParamClass> | ||
struct FreeFormulaImpl; | ||
} |
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.
OPTIONAL:
add a closing comment to the name space
(and other code lines)
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 don't do these any more.
https://github.com/ComputationalRadiationPhysics/contributing
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.
😱 why? - I liked them - Okay 👍
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.
Benjamin evangelized us and it's for the better :)
IDEs and all kinds of editors are great enough collapsing those blocks.
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.
template<typename T_ParamClass> | ||
struct LinearExponentialImpl; | ||
} | ||
} |
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.
REQUIRED:
please add new line
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.
thanks! added
PMACC_STRUCT(GaussianCloudParam, | ||
/** Profile Formula: | ||
* exponent = |globalCellPos - center| / sigma | ||
* density = e^[ gasFactor * exponent^gasPower ] |
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.
OPTIONAL:
comment still contains gasFactor
and gasPower
more suitable would be density...
also lines 51, 52, 62 and 67 of this file
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.
yes, those are in-gas-profile parameters that are still used. I mentioned to rather do those via an sed
PR later on. Fleißarbeit.
(PMACC_C_VECTOR_DIM(float_64, simDim, sigma_SI, 6.0e-6, 6.0e-6, 6.0e-6)) | ||
); /* struct GaussianCloudParam */ | ||
|
||
/* definition of gas cloud profile*/ |
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.
REQUIRED:
gas is outdated - please remove or replace by density
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.
done
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.
thx
{ | ||
PMACC_STRUCT(GaussianParameter, | ||
/** Profile Formula: | ||
* constexpr float_X exponent = abs((y - gasCenter_SI) / gasSigma_SI); |
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.
OPTIONAL:
Comment still contains gas
(here it is OK, since it is really a gas) - however @ax3l do you want to adjust this for consistency?
also lines: 49, 51, 52, 53, 55, 56, 67, 70, 71, 73, 76, 77
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.
as above: parameters of the specific profiles via sed
in a follow-up.
namespace picongpu | ||
{ | ||
|
||
namespace gasProfiles | ||
namespace densityProfiles |
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.
OPTIONAL:
In this file several variables are still names gas...
- might be good to change naming as well
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.
see above: specific profile -> sed
-> an other PR
{ | ||
PMACC_STRUCT(GaussianParam, | ||
/** Profile Formula: | ||
* const float_X exponent = abs((y - gasCenter_SI) / gasSigma_SI); |
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.
OPTIONAL:
several variables are still names gas...
in this file.
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.
see above: specific profile -> sed
-> an other PR
@@ -40,18 +40,18 @@ namespace picongpu | |||
|
|||
// setting 3: Plasma Wave | |||
#if( EM_FIELD_SCALE_CHANNEL1 == 3 || EM_FIELD_SCALE_CHANNEL2 == 3 || EM_FIELD_SCALE_CHANNEL3 == 3 ) | |||
PMACC_CASSERT_MSG( You_can_not_scale_your_preview_to_a_zero_plasma_density___change_visualization_param, ((GAS_DENSITY)>0.0 && gasProfile::GAS_ENABLED) ); | |||
PMACC_CASSERT_MSG( You_can_not_scale_your_preview_to_a_zero_plasma_density___change_visualization_param, ((BASE_DENSITY)>0.0 && densityProfile::GAS_ENABLED) ); |
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 can't find the definition of GAS_ENABLED
, this looks like a BUG.
Please remove GAS_ENABLED.
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.
removed!
So outdated, not even defined any more o.0
@PrometheusPi @psychocoderHPC all comments addressed, thanks! as said above, specific profile's parameters can be renamed with an |
@psychocoderHPC do you approve @ax3l's changes? |
Refactor "gas density" to general "density profiles", which stays as before a general element density.
The naming is super-outdated.
API Changes:
gasDensity
->densityConfig
gasProfiles
->densityProfiles
CreateGas
->CreateDensity
initGas
->initDensityProfile
GAS_ENABLED
, ...sed
replacementsGAS_DENSITY
->BASE_DENSITY
(likeBASE_CHARGE
&BASE_MASS
)