Skip to content

Commit d099ca5

Browse files
Fix comment formatting according to @psychocoderHPC's review suggestions.
1 parent 1acda93 commit d099ca5

File tree

5 files changed

+172
-100
lines changed

5 files changed

+172
-100
lines changed

examples/Bunch/include/simulation_defines/param/fieldBackground.param

Lines changed: 36 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,17 @@ namespace picongpu
4343
PMACC_ALIGN(unitField, const float3_64);
4444

4545
/* TWTS E-fields need to be initialized on host,
46-
* so they can look up global grid dimensions. */
46+
* so they can look up global grid dimensions.
47+
*
48+
* Note: No PMACC_ALIGN(...) used, since this *additional* memory alignment would require
49+
* roughly double the number of registers in the corresponding kernel on the device.
50+
*/
4751
const templates::twts::EField twtsFieldE;
4852

4953
/* Constructor is host-only, because of subGrid and halfSimSize initialization */
50-
HINLINE FieldBackgroundE( const float3_64 unitField ) : unitField(unitField),
54+
HINLINE FieldBackgroundE( const float3_64 unitField ) :
55+
56+
unitField(unitField),
5157

5258
twtsFieldE(
5359
/* focus_y [m], the distance to the laser focus in y-direction */
@@ -78,8 +84,7 @@ namespace picongpu
7884
operator()( const DataSpace<simDim>& cellIdx,
7985
const uint32_t currentStep ) const
8086
{
81-
/* example 1: TWTS background pulse */
82-
/** unit: meter */
87+
/* unit: meter */
8388
const double WAVE_LENGTH_SI = 0.8e-6;
8489

8590
/** UNITCONV */
@@ -92,24 +97,27 @@ namespace picongpu
9297
* SI::ELECTRON_MASS_SI * SI::SPEED_OF_LIGHT_SI
9398
* SI::SPEED_OF_LIGHT_SI / SI::ELECTRON_CHARGE_SI;
9499

95-
/** unit: W / m^2 */
96-
/* const double _PEAK_INTENSITY_SI = 3.4e19 * 1.0e4; */
97-
/** unit: none */
98-
/* const double _A0 = _PEAK_INTENSITY_SI * UNITCONV_Intens_to_A0; */
100+
/* unit: W / m^2
101+
* const double _PEAK_INTENSITY_SI = 3.4e19 * 1.0e4;
102+
* unit: none
103+
* const double _A0 = _PEAK_INTENSITY_SI * UNITCONV_Intens_to_A0;
104+
*/
99105

100-
/** unit: none */
106+
/* unit: none */
101107
const double _A0 = 1.0;
102108

103-
/** unit: Volt /meter */
104-
/*\todo #738 implement math::vector, native type operations */
109+
/* unit: Volt /meter
110+
*\todo #738 implement math::vector, native type operations
111+
*/
105112
const float3_64 invUnitField = float3_64(1.0 / unitField[0],
106113
1.0 / unitField[1],
107114
1.0 / unitField[2] );
108115

109116
/* laser amplitude in picongpu units [ unit: (Volt /meter) / unitField-factor ]
110117
* Note: the laser amplitude is included in all field components
111118
* polarization and other properties are established by the peak amplitude
112-
* normalized twtsFieldE(...) */
119+
* normalized twtsFieldE(...)
120+
*/
113121
const float3_X amplitude = precisionCast<float_X>(
114122
float_64(_A0 * UNITCONV_A0_to_Amplitude_SI) * invUnitField );
115123

@@ -125,13 +133,19 @@ namespace picongpu
125133
static const bool InfluenceParticlePusher = PARAM_INCLUDE_FIELDBACKGROUND;
126134

127135
/* TWTS B-fields need to be initialized on host,
128-
* so they can look up global grid dimensions. */
136+
* so they can look up global grid dimensions.
137+
*
138+
* Note: No PMACC_ALIGN(...) used, since this *additional* memory alignment would require
139+
* roughly double the number of registers in the corresponding kernel on the device.
140+
*/
129141
const templates::twts::BField twtsFieldB;
130142

131143
/* We use this to calculate your SI input back to our unit system */
132144
PMACC_ALIGN(unitField, const float3_64);
133145

134-
HINLINE FieldBackgroundB( const float3_64 unitField ) : unitField(unitField),
146+
HINLINE FieldBackgroundB( const float3_64 unitField ) :
147+
148+
unitField(unitField),
135149

136150
twtsFieldB(
137151
/* focus_y [m], the distance to the laser focus in y-direction */
@@ -162,7 +176,7 @@ namespace picongpu
162176
operator()( const DataSpace<simDim>& cellIdx,
163177
const uint32_t currentStep ) const
164178
{
165-
/** unit: meter */
179+
/* unit: meter */
166180
const double WAVE_LENGTH_SI = 0.8e-6;
167181

168182
/** UNITCONV */
@@ -175,10 +189,11 @@ namespace picongpu
175189
* SI::ELECTRON_MASS_SI * SI::SPEED_OF_LIGHT_SI
176190
* SI::SPEED_OF_LIGHT_SI / SI::ELECTRON_CHARGE_SI;
177191

178-
/** unit: W / m^2 */
179-
/* const double _PEAK_INTENSITY_SI = 3.4e19 * 1.0e4; */
180-
/** unit: none */
181-
/* const double _A0 = _PEAK_INTENSITY_SI * UNITCONV_Intens_to_A0; */
192+
/* unit: W / m^2
193+
* const double _PEAK_INTENSITY_SI = 3.4e19 * 1.0e4;
194+
* unit: none
195+
* const double _A0 = _PEAK_INTENSITY_SI * UNITCONV_Intens_to_A0;
196+
*/
182197

183198
/** unit: none */
184199
const double _A0 = 1.0;
@@ -191,7 +206,8 @@ namespace picongpu
191206
/* laser amplitude in picongpu units [ unit: (Volt/meter) / unitField-factor ]
192207
* Note: the laser amplitude is included in all field components
193208
* polarization and other properties are established by the peak amplitude
194-
* normalized twtsFieldB(...) */
209+
* normalized twtsFieldB(...)
210+
*/
195211
const float3_X amplitude = precisionCast<float_X>(
196212
float_64(_A0 * UNITCONV_A0_to_Amplitude_SI) * invUnitField );
197213

src/picongpu/include/fields/background/templates/TWTS/BField.hpp

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@
2929

3030
namespace picongpu
3131
{
32-
/** Load pre-defined background field */
32+
/* Load pre-defined background field */
3333
namespace templates
3434
{
35-
/** Traveling-wave Thomson scattering laser pulse */
35+
/* Traveling-wave Thomson scattering laser pulse */
3636
namespace twts
3737
{
3838

@@ -44,8 +44,9 @@ class BField
4444
enum PolarizationType
4545
{
4646
/* The linear polarization of the TWTS laser is defined
47-
* relative to the plane of the pulse front tilt (reference plane). */
48-
/* Polarisation is normal to the reference plane.
47+
* relative to the plane of the pulse front tilt (reference plane).
48+
*
49+
* Polarisation is normal to the reference plane.
4950
* Use Ex-fields (and corresponding B-fields) in TWTS laser internal coordinate system.
5051
*/
5152
LINEAR_X = 1u,
@@ -58,8 +59,9 @@ class BField
5859
/* Center of simulation volume in number of cells */
5960
PMACC_ALIGN(halfSimSize,DataSpace<simDim>);
6061
/* y-position of TWTS coordinate origin inside the simulation coordinates [meter]
61-
The other origin coordinates (x and z) default to globally centered values
62-
with respect to the simulation volume. */
62+
* The other origin coordinates (x and z) default to globally centered values
63+
* with respect to the simulation volume.
64+
*/
6365
const PMACC_ALIGN(focus_y_SI,float_64);
6466
/* Laser wavelength [meter] */
6567
const PMACC_ALIGN(wavelength_SI,float_64);
@@ -83,7 +85,8 @@ class BField
8385
/* TWTS laser time delay */
8486
PMACC_ALIGN(tdelay,float_64);
8587
/* Should the TWTS laser time delay be chosen automatically, such that
86-
the laser gradually enters the simulation volume? [Default: TRUE] */
88+
* the laser gradually enters the simulation volume? [Default: TRUE]
89+
*/
8790
const PMACC_ALIGN(auto_tdelay,bool);
8891
/* Polarization of TWTS laser */
8992
const PMACC_ALIGN(pol,PolarizationType);

0 commit comments

Comments
 (0)