diff options
author | 2019-04-29 13:56:04 -0700 | |
---|---|---|
committer | 2019-04-29 13:56:04 -0700 | |
commit | 68f260b3eb72178ebf9c2f4135af43d0dc687d2b (patch) | |
tree | 1cfd15b87373f1dade99f777908fa2b2eef16f8d /Python/pywarpx/picmi.py | |
parent | c2b4a4e35febef5b6adc7d050a146ac1588cc4d7 (diff) | |
download | WarpX-68f260b3eb72178ebf9c2f4135af43d0dc687d2b.tar.gz WarpX-68f260b3eb72178ebf9c2f4135af43d0dc687d2b.tar.zst WarpX-68f260b3eb72178ebf9c2f4135af43d0dc687d2b.zip |
Implemented multiple antennas in picmi
Diffstat (limited to 'Python/pywarpx/picmi.py')
-rw-r--r-- | Python/pywarpx/picmi.py | 32 |
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): |