Skip to content

Commit 08ccc74

Browse files
committed
fix incidentField.param
1 parent 85b46df commit 08ccc74

1 file changed

Lines changed: 28 additions & 18 deletions

File tree

share/picongpu/pypicongpu/template/include/picongpu/param/incidentField.param.mustache

Lines changed: 28 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@
2424
namespace picongpu::fields::incidentField
2525
{
2626
{{#laser}}
27-
{{#laser.data}}
28-
{{^laser.typeID.fromOpenPMDPulse}}
29-
struct PyPIConGPULaserBaseParam_{{{laser._idx}}} : public profiles::BaseParam
27+
{{^typeID.fromOpenPMDPulse}}
28+
struct PyPIConGPULaserBaseParam_{{{_idx}}} : public profiles::BaseParam
3029
{
30+
{{#data}}
3131
static constexpr float_64 WAVE_LENGTH_SI = {{{wave_length_si}}}; // m
3232
static constexpr float_64 AMPLITUDE_SI = {{{E0_si}}}; // V/m
3333
static constexpr float_64 PULSE_DURATION_SI = {{{pulse_duration_si}}}; // s (1 sigma)
@@ -61,12 +61,14 @@ namespace picongpu::fields::incidentField
6161
static constexpr float_64 POLARISATION_DIRECTION_X = polarisation_direction[0];
6262
static constexpr float_64 POLARISATION_DIRECTION_Y = polarisation_direction[1];
6363
static constexpr float_64 POLARISATION_DIRECTION_Z = polarisation_direction[2];
64+
{{/data}}
6465
};
65-
{{/laser.typeID.fromOpenPMDPulse}}
66+
{{/typeID.fromOpenPMDPulse}}
6667

6768
{{#typeID.gaussian}}
68-
struct PyPIConGPUGaussianPulseParam_{{{laser._idx}}} : public PyPIConGPULaserBaseParam_{{{laser._idx}}}
69+
struct PyPIConGPUGaussianPulseParam_{{{_idx}}} : public PyPIConGPULaserBaseParam_{{{_idx}}}
6970
{
71+
{{#data}}
7072
static constexpr float_64 W0_SI = {{{waist_si}}};
7173
static constexpr float_64 PULSE_INIT = {{{pulse_init}}};
7274
static constexpr uint32_t numModes = {{{modenumber}}};
@@ -80,33 +82,39 @@ namespace picongpu::fields::incidentField
8082
{{{single_laguerre_phase}}}{{^_last}},{{/_last}}
8183
{{/laguerre_phases}}
8284
);
85+
{{/data}}
8386
};
8487
{{/typeID.gaussian}}
8588

8689
{{#typeID.planewave}}
87-
struct PyPIConGPUPlaneWaveParam_{{{laser._idx}}} : public PyPIConGPULaserBaseParam_{{{laser._idx}}}
90+
struct PyPIConGPUPlaneWaveParam_{{{_idx}}} : public PyPIConGPULaserBaseParam_{{{_idx}}}
8891
{
92+
{{#data}}
8993
static constexpr float_64 RAMP_INIT = {{{pulse_init}}};
9094
static constexpr float_64 LASER_NOFOCUS_CONSTANT_SI = {{{laser_nofocus_constant_si}}};
95+
{{/data}}
9196
};
9297
{{/typeID.planewave}}
9398

9499
{{#typeID.dispersive}}
95-
struct PyPIConGPUDispersivePulseParam_{{{laser._idx}}} : public PyPIConGPULaserBaseParam_{{{laser._idx}}}
100+
struct PyPIConGPUDispersivePulseParam_{{{_idx}}} : public PyPIConGPULaserBaseParam_{{{_idx}}}
96101
{
102+
{{#data}}
97103
static constexpr float_64 W0_SI = {{{waist_si}}};
98104
static constexpr float_64 PULSE_INIT = {{{pulse_init}}};
99105
static constexpr float_X SPECTRAL_SUPPORT = {{{spectral_support}}};
100106
static constexpr float_64 SD_SI = {{{sd_si}}};
101107
static constexpr float_64 AD_SI = {{{ad_si}}};
102108
static constexpr float_64 GDD_SI = {{{gdd_si}}};
103109
static constexpr float_64 TOD_SI = {{{tod_si}}};
110+
{{/data}}
104111
};
105112
{{/typeID.dispersive}}
106113

107114
{{#typeID.fromOpenPMDPulse}}
108-
struct PyPIConGPUFromOpenPMDPulseParam_{{{laser._idx}}}
115+
struct PyPIConGPUFromOpenPMDPulseParam_{{{_idx}}}
109116
{
117+
{{#data}}
110118
static constexpr char const* filename = "{{{file_path}}}";
111119
static constexpr uint32_t iteration = {{{iteration}}};
112120
static constexpr char const* datasetEName = "{{{dataset_name}}}";
@@ -135,24 +143,27 @@ namespace picongpu::fields::incidentField
135143
static constexpr float_64 POLARISATION_DIRECTION_Z = polarisation_direction[2];
136144

137145
static constexpr float_64 TIME_DELAY_SI = {{{time_offset_si}}};
146+
{{/data}}
138147
};
139148
{{/typeID.fromOpenPMDPulse}}
140149

141150
{{#typeID.gaussian}}
142-
using LaserProfile_{{{laser._idx}}} = profiles::GaussianPulse<PyPIConGPUGaussianPulseParam_{{{laser._idx}}}>;
151+
using LaserProfile_{{{_idx}}} = profiles::GaussianPulse<PyPIConGPUGaussianPulseParam_{{{_idx}}}>;
143152
{{/typeID.gaussian}}
144153
{{#typeID.planewave}}
145-
using LaserProfile_{{{laser._idx}}} = profiles::PlaneWave<PyPIConGPUPlaneWaveParam_{{{laser._idx}}}>;
154+
using LaserProfile_{{{_idx}}} = profiles::PlaneWave<PyPIConGPUPlaneWaveParam_{{{_idx}}}>;
146155
{{/typeID.planewave}}
147156
{{#typeID.dispersive}}
148-
using LaserProfile_{{{laser._idx}}} = profiles::DispersivePulse<PyPIConGPUDispersivePulseParam_{{{laser._idx}}}>;
157+
using LaserProfile_{{{_idx}}} = profiles::DispersivePulse<PyPIConGPUDispersivePulseParam_{{{_idx}}}>;
149158
{{/typeID.dispersive}}
150159
{{#typeID.fromOpenPMDPulse}}
151-
using LaserProfile_{{{laser._idx}}} = profiles::FromOpenPMDPulse<PyPIConGPUFromOpenPMDPulseParam_{{{laser._idx}}}>;
160+
using LaserProfile_{{{_idx}}} = profiles::FromOpenPMDPulse<PyPIConGPUFromOpenPMDPulseParam_{{{_idx}}}>;
152161
{{/typeID.fromOpenPMDPulse}}
153162

154163
// TODO: find a better solution and move it into simulation class, or add a check that all lasers use the same positions
155-
{{#laser._first}}
164+
{{/laser}}
165+
{{#laser}}
166+
{{#_first}}
156167
/** Position in cells of the Huygens surface relative to start of the total domain
157168
*
158169
* The position is set as an offset, in cells, counted from the start of the total domain.
@@ -173,7 +184,7 @@ namespace picongpu::fields::incidentField
173184
* source matching such a case.
174185
*/
175186
constexpr int32_t POSITION[3][2] = {
176-
{{#huygens_surface_positions}}
187+
{{#data.huygens_surface_positions}}
177188
{{#row_x}}
178189
{ {{{negative}}}, {{{positive}}} },
179190
{{/row_x}}
@@ -183,19 +194,18 @@ namespace picongpu::fields::incidentField
183194
{{#row_z}}
184195
{ {{{negative}}}, {{{positive}}} }
185196
{{/row_z}}
186-
{{/huygens_surface_positions}}
197+
{{/data.huygens_surface_positions}}
187198
};
188-
{{/laser._first}}
199+
{{/_first}}
189200

190201
/**@{*/
191202
//! Incident field profile types along each boundary, these 6 types (or aliases) are required.
192-
{{/laser.data}}
193203
{{/laser}}
194204
195205
196206
using YMin = MakeSeq_t<
197207
{{#laser}}
198-
LaserProfile_{{{laser._idx}}},
208+
LaserProfile_{{{_idx}}},
199209
{{/laser}}
200210
profiles::None
201211
>;

0 commit comments

Comments
 (0)