Skip to content

Commit f452760

Browse files
committed
avoid non zero E-field integral
1 parent 1f2ffd2 commit f452760

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

src/picongpu/include/fields/laserProfiles/laserPlaneWave.hpp

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ namespace picongpu
5757
const double endUpramp = mue;
5858
const double startDownramp = mue + LASER_NOFOCUS_CONSTANT;
5959

60-
60+
double integrationCorrectionFactor = 0.0;
6161

6262
if( runTime > startDownramp )
6363
{
@@ -66,28 +66,34 @@ namespace picongpu
6666
( ( runTime - startDownramp )
6767
/ PULSE_LENGTH / sqrt( 2.0 ) );
6868
envelope *= exp( -0.5 * exponent * exponent );
69+
integrationCorrectionFactor = ( runTime - startDownramp )/ (2.0*PULSE_LENGTH*PULSE_LENGTH);
6970
}
7071
else if ( runTime < endUpramp )
7172
{
7273
// upramp = start
7374
const double exponent = ( ( runTime - endUpramp ) / PULSE_LENGTH / sqrt( 2.0 ) );
7475
envelope *= exp( -0.5 * exponent * exponent );
75-
76+
integrationCorrectionFactor = ( runTime - endUpramp )/ (2.0*PULSE_LENGTH*PULSE_LENGTH);
7677
}
7778

7879
const double timeOszi = runTime - endUpramp;
80+
const double t_and_phase = w * timeOszi + LASER_PHASE;
7981
if( Polarisation == LINEAR_X )
8082
{
81-
elong.x() = float_X( envelope * math::sin( w * timeOszi + LASER_PHASE));
83+
elong.x() = float_X( envelope * (math::sin(t_and_phase)
84+
+ math::cos(t_and_phase) * integrationCorrectionFactor));
8285
}
8386
else if( Polarisation == LINEAR_Z)
8487
{
85-
elong.z() = float_X( envelope * math::sin( w * timeOszi + LASER_PHASE));
88+
elong.z() = float_X( envelope * (math::sin(t_and_phase)
89+
+ math::cos(t_and_phase) * integrationCorrectionFactor));
8690
}
8791
else if( Polarisation == CIRCULAR )
8892
{
89-
elong.x() = float_X( envelope / sqrt(2.0) * math::sin( w * timeOszi + LASER_PHASE));
90-
elong.z() = float_X( envelope / sqrt(2.0) * math::cos( w * timeOszi + LASER_PHASE));
93+
elong.x() = float_X( envelope / sqrt(2.0) * (math::sin(t_and_phase)
94+
+ math::cos(t_and_phase) * integrationCorrectionFactor));
95+
elong.z() = float_X( envelope / sqrt(2.0) * (math::cos(t_and_phase)
96+
- math::sin(t_and_phase) * integrationCorrectionFactor));
9197
}
9298

9399

0 commit comments

Comments
 (0)