aboutsummaryrefslogtreecommitdiff
path: root/Python/pywarpx/picmi.py
diff options
context:
space:
mode:
authorGravatar Andrew Myers <atmyers2@gmail.com> 2019-04-29 15:37:44 -0700
committerGravatar Andrew Myers <atmyers2@gmail.com> 2019-04-29 15:37:44 -0700
commit78456345eea42b44ddc011e7c2787e0c77d0c487 (patch)
treebeef10bb457f8ce3533b8a999f7742cf11024a43 /Python/pywarpx/picmi.py
parent636b4c53715c1f91d05fd2842f3944b733420815 (diff)
parent515b3464b0c6c6bbc5120ca70bb755a18d19c337 (diff)
downloadWarpX-78456345eea42b44ddc011e7c2787e0c77d0c487.tar.gz
WarpX-78456345eea42b44ddc011e7c2787e0c77d0c487.tar.zst
WarpX-78456345eea42b44ddc011e7c2787e0c77d0c487.zip
merging with dev
Diffstat (limited to 'Python/pywarpx/picmi.py')
-rw-r--r--Python/pywarpx/picmi.py32
1 files changed, 18 insertions, 14 deletions
diff --git a/Python/pywarpx/picmi.py b/Python/pywarpx/picmi.py
index 6adf4b039..a5d9fba87 100644
--- a/Python/pywarpx/picmi.py
+++ b/Python/pywarpx/picmi.py
@@ -406,24 +406,28 @@ class ElectrostaticSolver(picmistandard.PICMI_ElectrostaticSolver):
class GaussianLaser(picmistandard.PICMI_GaussianLaser):
def initialize_inputs(self):
- pywarpx.warpx.use_laser = 1
- pywarpx.laser.profile = "Gaussian"
- pywarpx.laser.wavelength = self.wavelength # The wavelength of the laser (in meters)
- pywarpx.laser.e_max = self.E0 # Maximum amplitude of the laser field (in V/m)
- pywarpx.laser.polarization = [np.cos(self.polarization_angle), np.sin(self.polarization_angle), 0.] # The main polarization vector
- pywarpx.laser.profile_waist = self.waist # The waist of the laser (in meters)
- pywarpx.laser.profile_duration = self.duration # The duration of the laser (in seconds)
- pywarpx.laser.zeta = self.zeta
- pywarpx.laser.beta = self.beta
- pywarpx.laser.phi2 = self.phi2
+ self.laser_number = pywarpx.lasers.nlasers + 1
+ self.name = 'laser{}'.format(self.laser_number)
+
+ self.laser = pywarpx.Lasers.newlaser(self.name)
+
+ self.laser.profile = "Gaussian"
+ self.laser.wavelength = self.wavelength # The wavelength of the laser (in meters)
+ self.laser.e_max = self.E0 # Maximum amplitude of the laser field (in V/m)
+ self.laser.polarization = [np.cos(self.polarization_angle), np.sin(self.polarization_angle), 0.] # The main polarization vector
+ self.laser.profile_waist = self.waist # The waist of the laser (in meters)
+ self.laser.profile_duration = self.duration # The duration of the laser (in seconds)
+ self.laser.zeta = self.zeta
+ self.laser.beta = self.beta
+ self.laser.phi2 = self.phi2
class LaserAntenna(picmistandard.PICMI_LaserAntenna):
def initialize_inputs(self, laser):
- pywarpx.laser.position = self.position # This point is on the laser plane
- pywarpx.laser.direction = self.normal_vector # The plane normal direction
- pywarpx.laser.profile_focal_distance = laser.focal_position[2] - self.position[2] # Focal distance from the antenna (in meters)
- pywarpx.laser.profile_t_peak = (self.position[2] - laser.centroid_position[2])/c # The time at which the laser reaches its peak (in seconds)
+ laser.laser.position = self.position # This point is on the laser plane
+ laser.laser.direction = self.normal_vector # The plane normal direction
+ laser.laser.profile_focal_distance = laser.focal_position[2] - self.position[2] # Focal distance from the antenna (in meters)
+ laser.laser.profile_t_peak = (self.position[2] - laser.centroid_position[2])/c # The time at which the laser reaches its peak (in seconds)
class Simulation(picmistandard.PICMI_Simulation):