Picongpu: Improve naming of variables in example param files

Created on 26 May 2020  路  6Comments  路  Source: ComputationalRadiationPhysics/picongpu

I would suggest to change the naming of some variables in the param files for easier adaption to other cases.
E.g. in the flat foil LCT example, we use specific ion species C, N, H and name the variables accordingly. I think it would be better to name then ion1, ion2, ion3 ... instead. The same goes for particles per cell. E.g. in the LCT example we now have a variable for 1 ppc and 6 ppc that have it in their name. Why not renaming to ppcIon1, ppcIon2, ppcIon3 etc.? Then one could easily change the actual number without having to rename the variable.

question

All 6 comments

Both the approach currently used and your suggestion have pro and cons.


Pro of current method:

  • species names in variables allows easy identification of the physical setup
  • setting specific names like ...2ppc allow for easy grasp of the setup by only looking in the init pipeline and cross checking other param files

Con of current method:

  • simply switching parameters in the name specific setting (e.g. c麓setting 4 ppc in the variable ...2ppc) is allowed and a lazy developer (like me) would do that, that confusing the actual init pipeline setup

Pro of your proposed method:

  • abstraction allows for easy changing of parameters without renaming of variables
  • abstract nature of the selected variables might be easier recognized by beginner users

Con of your proposed method:

  • Multiple *.param files need to be read in order to understand the physics case
  • Current (default) fallback methods might fail
  • breaks backwards compatibility

This list is certainly far from complete - so please feel free to add it.

@ComputationalRadiationPhysics/picongpu-developers What do you think of @HighIander proposed variable name change?
(:+1: approve such a change, :-1: against such a change, 馃槙 : undecided)

(Vote closes in 2 weeks: (2020-06-10)).

Adding my two cents here:

I would advise against enumerating the particle species.
In case the parameter files are repurposed later on (e.g. following the suggestions and copying the examples and building on them) the user would, when editing the files, have to keep track of the index-to-species mapping manually (in whatever way they choose). Which is will lead to confusion with probability 1!

As a general rule, descriptive names are preferable.

Similar holds for the particles per cell, especially since the same PPC struct can be used by multiple different particle species and binding the PPC names to species, as suggested, would result in superfluous code (if one wants to be consistent).

@sbastrakov I am confused with your vote above - you voted both :+1: and :-1:.

Oops, sorry, automatically put thumbs up for your message, not as a vote. Fixed

I voted against the renaming. The example are very specific examples and simulate e.g a carbon foil. In that case the species should ion should named Carbon.
Also keep in mind that sometimes you will also create multiple electron species to separate electrons from carbon during the ionization from other electrons. This will result in e1, e2` ... :-(

The vote is clear. Thanks HighIander for your suggestion to improve PIConGPU. I hope you will further participate in the development in the future!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

PrometheusPi picture PrometheusPi  路  3Comments

ax3l picture ax3l  路  3Comments

cbontoiu picture cbontoiu  路  3Comments

saipavankalyan picture saipavankalyan  路  3Comments

hightower8083 picture hightower8083  路  4Comments