Skip to content
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

Merged

Conversation

ax3l
Copy link
Member

@ax3l ax3l commented Jan 11, 2017

Refactor "gas density" to general "density profiles", which stays as before a general element density.
The naming is super-outdated.

API Changes:

  • file renames: gasDensity -> densityConfig
  • namespaces gasProfiles -> densityProfiles
  • CreateGas -> CreateDensity
  • initGas -> initDensityProfile
  • to do: GAS_ENABLED, ...
  • to do: in each density profile, rename parameters -> follow up PR with sed replacements
  • GAS_DENSITY -> BASE_DENSITY (like BASE_CHARGE & BASE_MASS)

@ax3l ax3l added component: examples PIConGPU or PMacc examples refactoring code change to improve performance or to unify a concept but does not change public API labels Jan 11, 2017
@ax3l ax3l added this to the Next Stable: 0.3.0 / 1.0.0 milestone Jan 11, 2017
@ax3l ax3l force-pushed the topic-refactorDensity branch from 151c23b to afce1d9 Compare January 11, 2017 23:19
@n01r
Copy link
Member

n01r commented Jan 12, 2017

Oh I can feel it! Solid densities we are coming!

@ax3l ax3l changed the title [WIP] Refactor Density Profiles Refactor Density Profiles Jan 16, 2017
@ax3l ax3l force-pushed the topic-refactorDensity branch from afce1d9 to 7dd9d22 Compare January 16, 2017 08:12
@ax3l
Copy link
Member Author

ax3l commented Jan 16, 2017

@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.

@PrometheusPi PrometheusPi self-assigned this Jan 16, 2017
Copy link
Member

@PrometheusPi PrometheusPi left a 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
Copy link
Member

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)

Copy link
Member Author

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.

Copy link
Member

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;
}
Copy link
Member

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)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

@PrometheusPi PrometheusPi Jan 16, 2017

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 👍

Copy link
Member Author

@ax3l ax3l Jan 16, 2017

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.

Copy link
Member

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;
}
}
Copy link
Member

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

Copy link
Member Author

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 ]
Copy link
Member

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

Copy link
Member Author

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*/
Copy link
Member

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

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Copy link
Member

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);
Copy link
Member

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

Copy link
Member Author

@ax3l ax3l Jan 16, 2017

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
Copy link
Member

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

Copy link
Member Author

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);
Copy link
Member

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.

Copy link
Member Author

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) );
Copy link
Member

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.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed!

@ax3l
Copy link
Member Author

ax3l commented Jan 16, 2017

@PrometheusPi @psychocoderHPC all comments addressed, thanks!

as said above, specific profile's parameters can be renamed with an sed script in a later PR.

@PrometheusPi
Copy link
Member

@psychocoderHPC do you approve @ax3l's changes?

@psychocoderHPC psychocoderHPC merged commit 81082d1 into ComputationalRadiationPhysics:dev Jan 16, 2017
@ax3l ax3l deleted the topic-refactorDensity branch January 16, 2017 12:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: examples PIConGPU or PMacc examples refactoring code change to improve performance or to unify a concept but does not change public API
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants