1010import unittest
1111from picongpu import pypicongpu
1212from math import sqrt
13+ from scipy .constants import c
1314
1415
1516class TestPicmiGaussianLaser (unittest .TestCase ):
@@ -22,7 +23,7 @@ def test_basic(self):
2223 propagation_direction = [0 , 1 , 0 ],
2324 polarization_direction = [0 , 0 , 1 ],
2425 focal_position = [5 , 4 , 5 ],
25- centroid_position = [0 , 0 , 0 ],
26+ centroid_position = [0 , - 1.5 , 0 ],
2627 E0 = 5 ,
2728 picongpu_laguerre_modes = [2.0 , 3.0 ],
2829 picongpu_laguerre_phases = [4.0 , 5.0 ],
@@ -50,7 +51,8 @@ def test_basic(self):
5051 self .assertEqual ([[1 , - 1 ], [1 , - 1 ], [1 , - 1 ]], pypic_laser .huygens_surface_positions )
5152
5253 # computed values
53- self .assertEqual (15 , pypic_laser .pulse_init )
54+ self .assertAlmostEqual (- 2. * picmi_laser .centroid_position [1 ] / picmi_laser .propagation_direction [1 ]
55+ / c / picmi_laser .duration , pypic_laser .pulse_init )
5456
5557 def test_scalar_values_negative (self ):
5658 """waist, duration and wavelelngth must be > 0"""
@@ -171,7 +173,7 @@ def test_minimal(self):
171173 2 ,
172174 3 ,
173175 focal_position = [0 , 0 , 0 ],
174- centroid_position = [0 , 0 , 0 ],
176+ centroid_position = [0 , - 1 , 0 ],
175177 propagation_direction = [0 , 1 , 0 ],
176178 polarization_direction = [1 , 0 , 0 ],
177179 E0 = 1 ,
0 commit comments