Skip to content

Commit 5793929

Browse files
author
Marco Garten
committed
Doxygen comments / set boundElectrons default to 0
1 parent eed6465 commit 5793929

File tree

3 files changed

+34
-12
lines changed

3 files changed

+34
-12
lines changed

src/picongpu/include/simulation_defines/param/speciesAttributes.param

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ value_identifier(bool, radiationFlag, false);
6363
*
6464
* \todo connect default to proton number
6565
*/
66-
value_identifier(float_X,boundElectrons,float_X(2.0));
66+
value_identifier(float_X,boundElectrons,float_X(0.0));
6767

6868
/** specialization global position inside a domain (relative to origin of the
6969
* moving window) and is loaded after all other param files)

src/picongpu/include/traits/attribute/GetCharge.hpp

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,32 +38,50 @@ namespace detail
3838
*
3939
* use attribute `boundElectrons` and the proton number from
4040
* flag `atomicNumbers` to calculate the charge
41+
*
42+
* \tparam T_HasBoundElectrons boolean that describes if species allows multiple charge states
43+
* due to bound electrons
4144
*/
4245
template<bool T_HasBoundElectrons>
4346
struct LoadBoundElectrons
4447
{
45-
48+
/** Functor implementation
49+
*
50+
* \tparam T_Particle particle type
51+
* \param singlyChargedResult charge resulting from multiplying a single
52+
* electron charge (positive OR negative) by the macro particle weighting
53+
* \param particle particle reference
54+
*/
4655
template<typename T_Particle>
47-
HDINLINE float_X operator()(const float_X partialResult, const T_Particle& particle)
56+
HDINLINE float_X operator()(const float_X singlyChargedResult, const T_Particle& particle)
4857
{
4958
const float_X protonNumber = GetAtomicNumbers<T_Particle>::type::numberOfProtons;
5059

51-
return partialResult * (protonNumber - particle[boundElectrons_]);
60+
return singlyChargedResult * (protonNumber - particle[boundElectrons_]);
5261
}
5362
};
5463

5564
/** Calculate the real charge of a particle
5665
*
5766
* This is the fallback implementation if no `boundElectrons` are available for a particle
67+
*
68+
* \tparam T_HasBoundElectrons boolean that describes if species allows multiple charge states
69+
* due to bound electrons
5870
*/
5971
template<>
6072
struct LoadBoundElectrons<false>
6173
{
62-
74+
/** Functor implementation
75+
*
76+
* \tparam T_Particle particle type
77+
* \param singlyChargedResult charge resulting from multiplying a single
78+
* electron charge (positive OR negative) by the macro particle weighting
79+
* \param particle particle reference
80+
*/
6381
template<typename T_Particle>
64-
HDINLINE float_X operator()(const float_X partialResult, const T_Particle& particle)
82+
HDINLINE float_X operator()(const float_X singlyChargedResult, const T_Particle& particle)
6583
{
66-
return partialResult;
84+
return singlyChargedResult;
6785
}
6886
};
6987
} // namespace detail

src/picongpu/include/traits/attribute/GetChargeState.hpp

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright 2014 Rene Widera
2+
* Copyright 2014-2015 Marco Garten, Rene Widera
33
*
44
* This file is part of PIConGPU.
55
*
@@ -41,7 +41,10 @@ namespace detail
4141
template<bool T_HasBoundElectrons>
4242
struct LoadChargeState
4343
{
44-
44+
/** Functor implementation
45+
*
46+
* \return chargeState = number of electrons in neutral atom - number of currently bound electrons
47+
*/
4548
template<typename T_Particle>
4649
HDINLINE float_X operator()(const T_Particle& particle)
4750
{
@@ -52,7 +55,8 @@ struct LoadChargeState
5255

5356
/** Calculate charge state of an atom / ion
5457
*
55-
* This is the fallback implementation if no `boundElectrons` are available for a particle
58+
* This is the fallback implementation to throw an error if no `boundElectrons`
59+
* are available for a species.
5660
*/
5761
template<>
5862
struct LoadChargeState<false>
@@ -61,15 +65,15 @@ struct LoadChargeState<false>
6165
template<typename T_Particle>
6266
HDINLINE void operator()(const T_Particle& particle)
6367
{
64-
PMACC_CASSERT_MSG(This_species_has_no_different_charge_states,1==2);
68+
PMACC_CASSERT_MSG(This_species_has_only_one_charge_state,1==2);
6569
}
6670
};
6771
} // namespace detail
6872

6973
/** get the charge state of a macro particle
7074
*
7175
* This function trait considers the `boundElectrons` attribute if it is set.
72-
* Charge states do not add up and also the different particles in a macro particle
76+
* Charge states do not add up and also the various particles in a macro particle
7377
* do NOT have different charge states where one would average over them.
7478
*
7579
* @param particle a reference to a particle

0 commit comments

Comments
 (0)