Octopus
lasers.F90
Go to the documentation of this file.
1!! Copyright (C) 2002-2006 M. Marques, A. Castro, A. Rubio, G. Bertsch
2!! Copyright (C) 2021 N. Tancogne-Dejean
3!!
4!! This program is free software; you can redistribute it and/or modify
5!! it under the terms of the GNU General Public License as published by
6!! the Free Software Foundation; either version 2, or (at your option)
7!! any later version.
8!!
9!! This program is distributed in the hope that it will be useful,
10!! but WITHOUT ANY WARRANTY; without even the implied warranty of
11!! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12!! GNU General Public License for more details.
13!!
14!! You should have received a copy of the GNU General Public License
15!! along with this program; if not, write to the Free Software
16!! Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
17!! 02110-1301, USA.
18!!
19
20#include "global.h"
21
22module lasers_oct_m
23 use clock_oct_m
24 use debug_oct_m
26 use global_oct_m
31 use, intrinsic :: iso_fortran_env
35 use math_oct_m
36 use mpi_oct_m
37 use mesh_oct_m
40 use parser_oct_m
43 use space_oct_m
46 use unit_oct_m
50
51 implicit none
52
53 private
54 public :: &
55 lasers_t, &
60 laser_t, &
71 laser_kind, &
82
83
84 ! TODO: (Micael, Alex) Issue 836. Remove the following paramaters and use the
85 ! corresponding quantities defined in the multisystem (E_FIELD, B_FIELD, etc)
86 integer, public, parameter :: &
87 E_FIELD_NONE = 0, &
88 e_field_electric = 1, &
89 e_field_magnetic = 2, &
92
93 type laser_t
94 private
95 integer :: field = e_field_none
96 complex(real64), allocatable :: pol(:)
97 real(real64), allocatable :: prop(:)
98 type(tdf_t) :: f
99 type(tdf_t) :: phi
100 real(real64) :: omega = m_zero
101
102 real(real64), allocatable :: v(:)
103 real(real64), allocatable :: a(:, :)
104 character(len=200) :: scalar_pot_expression
105 character(len=200) :: phase_expression
106 character(len=200) :: envelope_expression
107 end type laser_t
108
109 type, extends(interaction_partner_t) :: lasers_t
110 private
111
112 integer, public :: no_lasers
113 type(laser_t), allocatable, public :: lasers(:)
114
115 real(real64), allocatable :: e(:)
116 real(real64), allocatable :: b(:)
117 real(real64), allocatable :: integrated_nondipole_afield(:)
118 real(real64) :: nd_integration_time
119 real(real64) :: nd_integration_step
120 contains
121 procedure :: init_interaction_as_partner => lasers_init_interaction_as_partner
122 procedure :: update_quantity => lasers_update_quantity
123 procedure :: copy_quantities_to_interaction => lasers_copy_quantities_to_interaction
124 final :: lasers_finalize
125 end type
126
127 interface lasers_t
128 module procedure lasers_constructor
129 end interface lasers_t
130
131
132contains
133
134 function lasers_constructor(namespace) result(this)
135 class(lasers_t), pointer :: this
136 type(namespace_t), intent(in) :: namespace
137
138 push_sub(lasers_constructor)
139
140 safe_allocate(this)
141
142 this%namespace = namespace_t("Lasers", parent=namespace)
143
144 safe_allocate(this%e(1:3))
145 safe_allocate(this%b(1:3))
146 this%e = m_zero
147 this%b = m_zero
148
149 pop_sub(lasers_constructor)
150 end function lasers_constructor
151
152 subroutine lasers_parse_external_fields(this)
153 class(lasers_t), intent(inout) :: this
154
155 type(block_t) :: blk
156 integer :: il, jj, ierr, k
157 real(real64) :: omega0
158 complex(real64) :: cprop(3)
159
161
162 call messages_obsolete_variable(this%namespace, "TDLasers", "TDExternalFields")
163 !%Variable TDExternalFields
164 !%Type block
165 !%Section Time-Dependent
166 !%Description
167 !% The block <tt>TDExternalFields</tt> describes the type and shape of time-dependent
168 !% external perturbations that are applied to the system, in the form
169 !% <math>f(x,y,z) \cos(\omega t + \phi (t)) g(t)</math>, where <math>f(x,y,z)</math> is defined by
170 !% by a field type and polarization or a scalar potential, as below; <math>\omega</math>
171 !% is defined by <tt>omega</tt>; <math>g(t)</math> is defined by
172 !% <tt>envelope_function_name</tt>; and <math>\phi(t)</math> is the (time-dependent) phase from <tt>phase</tt>.
173 !%
174 !% These perturbations are only applied for time-dependent runs. If
175 !% you want the value of the perturbation at time zero to be
176 !% applied for time-independent runs, use <tt>TimeZero = yes</tt>.
177 !%
178 !% Each line of the block describes an external field; this way you can actually have more
179 !% than one laser (<i>e.g.</i> a "pump" and a "probe").
180 !%
181 !% There are two ways to specify <math>f(x,y,z)</math> but both use the same <tt>omega | envelope_function_name [| phase]</tt>
182 !% for the time-dependence.
183 !% The float <tt>omega</tt> will be the carrier frequency of the
184 !% pulse (in energy units). The envelope of the field is a time-dependent function whose definition
185 !% must be given in a <tt>TDFunctions</tt> block. <tt>envelope_function_name</tt> is a string (and therefore
186 !% it must be surrounded by quotation marks) that must match one of the function names
187 !% given in the first column of the <tt>TDFunctions</tt> block.
188 !% <tt>phase</tt> is optional and is taken to be zero if not provided, and is also a string specifying
189 !% a time-dependent function.
190 !%
191 !% (A) type = <tt>electric field, magnetic field, vector_potential</tt>
192 !%
193 !% For these cases, the syntax is:
194 !%
195 !% <tt>%TDExternalFields
196 !% <br>&nbsp;&nbsp; type | nx | ny | nz | omega | envelope_function_name | phase (| px | py | pz )
197 !% <br>%</tt>
198 !%
199 !% The <tt>vector_potential</tt> option (constant in space) permits us to describe
200 !% an electric perturbation in the velocity gauge.
201 !% The three (possibly complex) numbers (<tt>nx</tt>, <tt>ny</tt>, <tt>nz</tt>) mark the polarization
202 !% direction of the field.
203 !% By default, (<tt>nx</tt>, <tt>ny</tt>, <tt>nz</tt>) are defined in Cartesian space.
204 !% However, it is possible for solids to define them using the Miller indices.
205 !% This can be achieved by defining the block <tt>MillerIndicesBasis</tt>. It is also possible to activate
206 !% the nondipole SFA correction by inserting the laser propagation direction px | py | pz as prescribed in
207 !% Phys. Rev. A 101, 043408 (2020).
208 !%
209 !% (B) type = <tt>scalar_potential</tt>
210 !%
211 !% <tt>%TDExternalFields
212 !% <br>&nbsp;&nbsp; scalar_potential | "spatial_expression" | omega | envelope_function_name | phase
213 !% <br>%</tt>
214 !%
215 !% The scalar potential is any expression of the spatial coordinates given by the string
216 !% "spatial_expression", allowing a field beyond the dipole approximation.
217 !%
218 !% For DFTB runs, only fields of type type = <tt>electric field</tt> are allowed for the moment, and the
219 !% <tt>type</tt> keyword is omitted.
220 !%
221 !% A NOTE ON UNITS:
222 !%
223 !% It is very common to describe the strength of a laser field by its intensity, rather
224 !% than using the electric-field amplitude. In atomic units (or, more precisely, in any
225 !% Gaussian system of units), the relationship between instantaneous electric field
226 !% and intensity is:
227 !% <math> I(t) = \frac{c}{8\pi} E^2(t) </math>.
228 !%
229 !% It is common to read intensities in W/cm<math>^2</math>. The dimensions of intensities are
230 !% [W]/(L<math>^2</math>T), where [W] are the dimensions of energy. The relevant conversion factors
231 !% are:
232 !%
233 !% Hartree / (<math>a_0^2</math> atomic_time) = <math>6.4364086 \times 10^{15} \mathrm{W/cm}^2</math>
234 !%
235 !% eV / ( &Aring;<math>^2 (\hbar</math>/eV) ) = <math>2.4341348 \times 10^{12} \mathrm{W/cm}^2</math>
236 !%
237 !% If, in atomic units, we set the electric-field amplitude to <math>E_0</math>,
238 !% then the intensity is:
239 !%
240 !% <math> I_0 = 3.51 \times 10^{16} \mathrm{W/cm}^2 (E_0^2) </math>
241 !%
242 !% If, working with <tt>Units = ev_angstrom</tt>, we set <math>E_0</math>, then the intensity is:
243 !%
244 !% <math> I_0 = 1.327 \times 10^{13} (E_0^2) \mathrm{W/cm}^2 </math>
245 !%
246 !%Option electric_field 1
247 !% The external field is an electric field, the usual case when we want to describe a
248 !% laser in the length gauge.
249 !%Option magnetic_field 2
250 !% The external field is a (homogeneous) time-dependent magnetic field.
251 !%Option vector_potential 3
252 !% The external field is a time-dependent homogeneous vector potential, which may describe
253 !% a laser field in the velocity gauge.
254 !%Option scalar_potential 4
255 !% The external field is an arbitrary scalar potential, which may describe an
256 !% inhomogeneous electrical field.
257 !%End
258
259 this%no_lasers = 0
260 if (parse_block(this%namespace, 'TDExternalFields', blk) == 0) then
261 this%no_lasers = parse_block_n(blk)
262 safe_allocate(this%lasers(1:this%no_lasers))
263
264 do il = 1, this%no_lasers
265 safe_allocate(this%lasers(il)%pol(1:3))
266 this%lasers(il)%pol = m_z0
267
268 call parse_block_integer(blk, il-1, 0, this%lasers(il)%field)
269
270 select case (this%lasers(il)%field)
272 call parse_block_string(blk, il-1, 1, this%lasers(il)%scalar_pot_expression)
273 jj = 1
274 this%lasers(il)%pol = m_z1
275 case default
276 call parse_block_cmplx(blk, il-1, 1, this%lasers(il)%pol(1))
277 call parse_block_cmplx(blk, il-1, 2, this%lasers(il)%pol(2))
278 call parse_block_cmplx(blk, il-1, 3, this%lasers(il)%pol(3))
279 jj = 3
280 end select
281
282 call parse_block_float(blk, il-1, jj+1, omega0)
283
284 this%lasers(il)%omega = omega0
285
286 call parse_block_string(blk, il-1, jj+2, this%lasers(il)%envelope_expression)
287 call tdf_read(this%lasers(il)%f, this%namespace, trim(this%lasers(il)%envelope_expression), ierr)
288
289 ! Check if there is a phase.
290 if (parse_block_cols(blk, il-1) > jj+3) then
291 call parse_block_string(blk, il-1, jj+3, this%lasers(il)%phase_expression)
292 call tdf_read(this%lasers(il)%phi, this%namespace, trim(this%lasers(il)%phase_expression), ierr)
293 if (ierr /= 0) then
294 write(message(1),'(3A)') 'Error in the "', trim(this%lasers(il)%envelope_expression), &
295 '" field defined in the TDExternalFields block:'
296 write(message(2),'(3A)') 'Time-dependent phase function "', trim(this%lasers(il)%phase_expression), &
297 '" not found.'
298 call messages_warning(2, namespace=this%namespace)
299 end if
300 else
301 call tdf_init(this%lasers(il)%phi)
302 end if
303
304 ! Check if there is nondipoole fields to activate the nondipole SFA formalism of Phys. Rev. A 101, 043408 (2020)
305 if (parse_block_cols(blk, il-1) > jj+4) then
306 safe_allocate(this%lasers(il)%prop(1:size(cprop)))
307 do k = 1, size(cprop)
308 call parse_block_cmplx(blk, il-1, jj+size(cprop)+k, cprop(k))
309
310 end do
311 if (any(abs(aimag(cprop)) > m_epsilon)) then
312 write(message(1),'(3A)') 'Error in the "', trim(this%lasers(il)%envelope_expression), &
313 '" field defined in the TDExternalFields block:'
314 write(message(2),'(A)') 'Propagation direction cannot be complex.'
315 call messages_fatal(2, namespace=this%namespace)
316 end if
317 this%lasers(il)%prop(:) = real(cprop(:), real64)
318 if (.not.allocated(this%integrated_nondipole_afield)) then
319 safe_allocate(this%integrated_nondipole_afield(1:size(cprop)))
320 this%integrated_nondipole_afield(1:3)=m_zero
321 this%nd_integration_time=m_zero
322 !%Variable NDSFATimeIntegrationStep
323 !%Type float
324 !%Default 0.01
325 !%Section Hamiltonian
326 !%Description
327 !% Timestep for the integration of the NDSFA first order
328 !% response numerically as prescribed in Phys. Rev. A 101, 043408 (2020).
329 !% Typically needs to be an order of magniude less than
330 !% the TDtimestep. However, for writing "laser" the TDtimestep
331 !% is used instead.
332 !%End
333 call parse_variable(this%namespace, 'NDSFATimeIntegrationStep', 0.01_real64, this%nd_integration_step)
334
335 if (is_close(this%nd_integration_step, 0.01_real64)) then
336 message(1) = "The default timestep of 0.01 is utilized for the nondipole SFA integration."
337 message(2) = "Be aware that this should be at least an order of magniude less than the TDtimestep"
338 call messages_info(2, namespace=this%namespace)
339 end if
340 end if
341 end if
342
343 end do
344
345 call parse_block_end(blk)
346 end if
347
348 call add_reflected_fields(this)
349
351 end subroutine lasers_parse_external_fields
352
353 subroutine lasers_generate_potentials(this, mesh, space, latt)
354 class(lasers_t), intent(inout) :: this
355 class(mesh_t), intent(in) :: mesh
356 class(space_t), intent(in) :: space
357 type(lattice_vectors_t), intent(in) :: latt
358
359 type(block_t) :: blk2
360 integer :: il, ip, idir, idir2
361 real(real64) :: rr, pot_re, pot_im, xx(3)
362 real(real64) :: miller(space%dim,space%dim), miller_red(space%dim,space%dim)
363
365
366 do il = 1, this%no_lasers
367 ! For periodic systems, we might want to define the polarization direction in
368 ! terms of Miller indices
369 ! In this case, the use must provide the coordinates of the X, Y, and Z high symmetry points
370 ! such that the code applying a laser along say the [100] direction converts it to
371 ! the proper coordinates in Cartesian space.
372 ! This is usefull for arbitrarily rotated crystals.
373
374 !%Variable MillerIndicesBasis
375 !%Type block
376 !%Section Time-Dependent
377 !%Description
378 !% When this block is given, the polarisation of the TDExternalFields is
379 !% understood to be defined in terms of Miller indices.
380 !% This block define the corresponding basis, by defining the reduced coordinates
381 !% of the X, Y, and Z high symmetry points, such that the code can do the corresponding
382 !% transformation.
383 !%
384 !% For example, in an FCC crystal with the conventional primitive cell,
385 !% the following input allows to define the polarization in terms
386 !% message(1) = "The lasers break (at least) one of the symmetries used to reduce the k-points ."
387 !%
388 !% <tt>%MillerIndicesBasis
389 !% <br> 0.0 | 0.5 | 0.5
390 !% <br> 0.5 | 0.0 | 0.5
391 !% <br> 0.5 | 0.5 | 0.0
392 !% <br>%</tt>
393 !%
394 !% Indeed, in this case, the reciprocal lattice vectors are (-1, 1, 1), (1, -1, 1),
395 !% and (1, 1, -1) in units of 2*pi/a.
396 !% This directly gives that the [100] direction correspond to the x direction, [111]
397 !% gives the vector (1,1,1), etc.
398 !%
399 !%End
400 if (parse_block(this%namespace, 'MillerIndicesBasis', blk2) == 0) then
401 if(.not. space%is_periodic()) then
402 write(message(1),'(a)') 'MillerIndicesBasis can only be used for periodic systems.'
403 call messages_fatal(1, namespace=this%namespace)
404 end if
405
406 do idir = 1, space%dim
407 do idir2 = 1, space%dim
408 call parse_block_float(blk2, idir-1, idir2-1, miller_red(idir2, idir))
409 end do
410 call kpoints_to_absolute(latt, miller_red(:, idir), miller(:, idir))
411 end do
412
413
414 this%lasers(il)%pol = matmul(miller, this%lasers(il)%pol)
415 call parse_block_end(blk2)
416 end if
417
418 this%lasers(il)%pol(:) = this%lasers(il)%pol(:)/sqrt(sum(abs(this%lasers(il)%pol(:))**2))
419
420 select case (this%lasers(il)%field)
422 safe_allocate(this%lasers(il)%v(1:mesh%np_part))
423 this%lasers(il)%v = m_zero
424 do ip = 1, mesh%np
425 call mesh_r(mesh, ip, rr, coords = xx(1:space%dim))
426 xx(space%dim+1:3) = m_zero
427 call parse_expression(pot_re, pot_im, 3, xx, rr, m_zero, trim(this%lasers(il)%scalar_pot_expression))
428 this%lasers(il)%v(ip) = pot_re
429 end do
430
431 case (e_field_magnetic)
432 ! \warning: note that for the moment we are ignoring the possibility of a complex
433 ! polarizability vector for the td magnetic-field case.
434 safe_allocate(this%lasers(il)%a(1:mesh%np_part, 1:3))
435 this%lasers(il)%a = m_zero
436 do ip = 1, mesh%np
437 xx(1:space%dim) = mesh%x(:, ip)
438 xx(space%dim+1:3) = m_zero
439 ! Compute the vector potential from a uniform B field.
440 ! The sign is determined by the relation $\vec{B} = \nabla \times \vec{A}$.
441 ! This leads to $\vec{A} = -\frac{1}{2}\vec{r}\times\vec{B}$.
442 select case (space%dim)
443 case (2)
444 this%lasers(il)%a(ip, 1:2) = (/xx(2), -xx(1)/) * sign(m_one, real(this%lasers(il)%pol(3)))
445 case (3)
446 this%lasers(il)%a(ip, :) = (/ xx(2)*real(this%lasers(il)%pol(3)) - xx(3)*real(this%lasers(il)%pol(2)), &
447 xx(3)*real(this%lasers(il)%pol(1)) - xx(1)*real(this%lasers(il)%pol(3)), &
448 xx(1)*real(this%lasers(il)%pol(2)) - xx(2)*real(this%lasers(il)%pol(1)) /)
449 case default
450 message(1) = "Magnetic fields only allowed in 2 or 3D."
451 call messages_fatal(1, namespace=this%namespace)
452 end select
453 end do
454 this%lasers(il)%a = -m_half * this%lasers(il)%a
455
456 end select
457
458 end do
459
461 end subroutine lasers_generate_potentials
462
463
464 ! ---------------------------------------------------------
465 subroutine lasers_check_symmetries(this, kpoints)
466 type(lasers_t), intent(in) :: this
467 type(kpoints_t), intent(in) :: kpoints
468
469 integer :: iop, il
470
472
473 if (kpoints%use_symmetries) then
474 do iop = 1, symmetries_number(kpoints%symm)
475 if (iop == symmetries_identity_index(kpoints%symm)) cycle
476 do il = 1, this%no_lasers
477 if (.not. symm_op_invariant_cart(kpoints%symm%ops(iop), this%lasers(il)%pol(:), symprec)) then
478 message(1) = "The lasers break (at least) one of the symmetries used to reduce the k-points ."
479 message(2) = "Set SymmetryBreakDir accordingly to your laser fields."
480 call messages_fatal(2, namespace=this%namespace)
481 end if
482 end do
483 end do
484 end if
485
487 end subroutine lasers_check_symmetries
488
489 ! ---------------------------------------------------------
490 subroutine lasers_finalize(this)
491 type(lasers_t), intent(inout) :: this
492
493 push_sub(lasers_finalize)
494
495 call lasers_deallocate(this)
496
497 pop_sub(lasers_finalize)
498 end subroutine lasers_finalize
499
500 ! ---------------------------------------------------------
501 subroutine lasers_deallocate(this)
502 class(lasers_t), intent(inout) :: this
503
504 integer :: il
505
506 push_sub(lasers_deallocate)
507
508 safe_deallocate_a(this%e)
509 safe_deallocate_a(this%b)
510 safe_deallocate_a(this%integrated_nondipole_afield)
511
512 do il = 1, this%no_lasers
513 safe_deallocate_a(this%lasers(il)%pol)
514 call tdf_end(this%lasers(il)%f)
515 call tdf_end(this%lasers(il)%phi)
516 select case (this%lasers(il)%field)
518 safe_deallocate_a(this%lasers(il)%v)
519 case (e_field_magnetic)
520 safe_deallocate_a(this%lasers(il)%a)
521 end select
522 safe_deallocate_a(this%lasers(il)%prop)
523 end do
524 safe_deallocate_a(this%lasers)
525
526 pop_sub(lasers_deallocate)
527 end subroutine lasers_deallocate
528
529
530 ! ---------------------------------------------------------
531 real(real64) function laser_carrier_frequency(laser) result(w0)
532 type(laser_t), intent(in) :: laser
533
535
536 w0 = laser%omega
539 end function laser_carrier_frequency
540
541 ! ---------------------------------------------------------
542 subroutine lasers_init_interaction_as_partner(partner, interaction)
543 class(lasers_t), intent(in) :: partner
544 class(interaction_surrogate_t), intent(inout) :: interaction
545
547
548 select type (interaction)
549 type is (lorentz_force_t)
550 ! Nothing to be initialized for the Lorentz force.
551 class default
552 message(1) = "Unsupported interaction."
553 call messages_fatal(1, namespace=partner%namespace)
554 end select
555
558
559 ! ---------------------------------------------------------
560 subroutine lasers_update_quantity(this, label)
561 class(lasers_t), intent(inout) :: this
562 character(len=*), intent(in) :: label
563
564 type(quantity_t), pointer :: quantity
565 integer :: il
566
567 push_sub(lasers_update_quantity)
568
569 if (allocated(this%lasers)) then
570 if (any(laser_kind(this%lasers) == e_field_vector_potential) .or. &
571 any(laser_kind(this%lasers) == e_field_scalar_potential)) then
572 call messages_not_implemented("Laser vector potentials and scalar potentials in multi-system framework", &
573 namespace=this%namespace)
574 end if
575 end if
576
577 quantity => this%quantities%get(label)
578 select case (label)
579 case ("E field")
580 this%e = m_zero
581 do il = 1, this%no_lasers
582 if (laser_kind(this%lasers(il)) == e_field_electric) then
583 call laser_field(this%lasers(il), this%e, quantity%iteration%value())
584 end if
585 end do
586
587 case ("B field")
588 this%b = m_zero
589 do il = 1, this%no_lasers
590 if (laser_kind(this%lasers(il)) == e_field_magnetic) then
591 call laser_field(this%lasers(il), this%b, quantity%iteration%value())
592 end if
593 end do
594
595 case default
596 message(1) = "Incompatible quantity."
597 call messages_fatal(1, namespace=this%namespace)
598 end select
599
601 end subroutine lasers_update_quantity
602
603 ! ---------------------------------------------------------
604 subroutine lasers_copy_quantities_to_interaction(partner, interaction)
605 class(lasers_t), intent(inout) :: partner
606 class(interaction_surrogate_t), intent(inout) :: interaction
607
608 integer :: ip
609
611
612 select type (interaction)
613 type is (lorentz_force_t)
614 do ip = 1, interaction%system_np
615 interaction%partner_e_field(:, ip) = partner%e
616 interaction%partner_b_field(:, ip) = partner%b
617 end do
618 class default
619 message(1) = "Unsupported interaction."
620 call messages_fatal(1, namespace=partner%namespace)
621 end select
622
625
626 ! ---------------------------------------------------------
627 integer pure elemental function laser_kind(laser)
628 type(laser_t), intent(in) :: laser
629
630 ! no push_sub allowed in pure function
631 laser_kind = laser%field
633 end function laser_kind
634 ! ---------------------------------------------------------
635
636
637 ! ---------------------------------------------------------
638 function laser_polarization(laser) result(pol)
639 type(laser_t), intent(in) :: laser
640 complex(real64) :: pol(3)
641
642 push_sub(laser_polarization)
643
644 pol = laser%pol
645
646 pop_sub(laser_polarization)
647 end function laser_polarization
648 ! ---------------------------------------------------------
649
651 function lasers_with_nondipole_field(lasers) result(isnondipole)
652 type(lasers_t), intent(in) :: lasers
653 logical :: isnondipole
654
656 isnondipole = .false.
657 if(allocated(lasers%integrated_nondipole_afield)) isnondipole = .true.
659 end function lasers_with_nondipole_field
660 ! ---------------------------------------------------------
661
662
664 subroutine lasers_set_nondipole_parameters(this, ndfield, nd_integration_time)
665 type(lasers_t), intent(inout) :: this
666 real(real64), contiguous, intent(in) :: ndfield(:)
667 real(real64), intent(in) :: nd_integration_time
668 integer :: dim
669 dim = size(ndfield)
670
672
673 this%integrated_nondipole_afield(1:dim) = ndfield(1:dim)
674 this%nd_integration_time = nd_integration_time
675
678
679
680 ! ---------------------------------------------------------
681 subroutine laser_get_f(laser, ff)
682 type(laser_t), intent(in) :: laser
683 type(tdf_t), intent(inout) :: ff
684
685 push_sub(laser_get_f)
686 call tdf_copy(ff, laser%f)
687
688 pop_sub(laser_get_f)
689 end subroutine laser_get_f
690 ! ---------------------------------------------------------
691
692
693 ! ---------------------------------------------------------
694 subroutine laser_set_f(laser, ff)
695 type(laser_t), intent(inout) :: laser
696 type(tdf_t), intent(inout) :: ff
697
698 push_sub(laser_set_f)
700 call tdf_end(laser%f)
701 call tdf_copy(laser%f, ff)
702
703 pop_sub(laser_set_f)
704 end subroutine laser_set_f
705 ! ---------------------------------------------------------
706
707
708 ! ---------------------------------------------------------
709 subroutine laser_get_phi(laser, phi)
710 type(laser_t), intent(in) :: laser
711 type(tdf_t), intent(inout) :: phi
712
713 push_sub(laser_get_phi)
714 call tdf_copy(phi, laser%phi)
715
716 pop_sub(laser_get_phi)
717 end subroutine laser_get_phi
718 ! ---------------------------------------------------------
719
720
721 ! ---------------------------------------------------------
722 subroutine laser_set_phi(laser, phi)
723 type(laser_t), intent(inout) :: laser
724 type(tdf_t), intent(inout) :: phi
725
726 push_sub(laser_set_phi)
727
728 call tdf_end(laser%phi)
729 call tdf_copy(laser%phi, phi)
730
731 pop_sub(laser_set_phi)
732 end subroutine laser_set_phi
733 ! ---------------------------------------------------------
734
735
736 ! ---------------------------------------------------------
737 subroutine laser_set_empty_phi(laser)
738 type(laser_t), intent(inout) :: laser
739
740 push_sub(laser_set_empty_phi)
741
742 call tdf_init(laser%phi)
743
744 pop_sub(laser_set_empty_phi)
745 end subroutine laser_set_empty_phi
746 ! ---------------------------------------------------------
747
748 ! ---------------------------------------------------------
749 subroutine laser_set_f_value(laser, ii, xx)
750 type(laser_t), intent(inout) :: laser
751 integer, intent(in) :: ii
752 real(real64), intent(in) :: xx
754 push_sub(laser_set_f_value)
755 call tdf_set_numerical(laser%f, ii, xx)
756
757 pop_sub(laser_set_f_value)
758 end subroutine laser_set_f_value
759 ! ---------------------------------------------------------
760
761
762 ! ---------------------------------------------------------
763 subroutine laser_set_frequency(laser, omega)
764 type(laser_t), intent(inout) :: laser
765 real(real64), intent(in) :: omega
767 push_sub(laser_set_frequency)
768 laser%omega = omega
769
770 pop_sub(laser_set_frequency)
771 end subroutine laser_set_frequency
772 ! ---------------------------------------------------------
773
774
775 ! ---------------------------------------------------------
776 subroutine laser_set_polarization(laser, pol)
777 type(laser_t), intent(inout) :: laser
778 complex(real64), contiguous, intent(in) :: pol(:)
779
780 push_sub(laser_set_polarization)
782 laser%pol = pol
783
785 end subroutine laser_set_polarization
786 ! ---------------------------------------------------------
787
788
789 ! ---------------------------------------------------------
796 ! ---------------------------------------------------------
797 subroutine laser_to_numerical_all(laser, dt, max_iter, omegamax)
798 type(laser_t), intent(inout) :: laser
799 real(real64), intent(in) :: dt
800 integer, intent(in) :: max_iter
801 real(real64), intent(in) :: omegamax
802
803 integer :: iter
804 real(real64) :: tt, fj, phi
805
806 push_sub(lasers_to_numerical_all)
807
808 call tdf_to_numerical(laser%f, max_iter, dt, omegamax)
809 do iter = 1, max_iter + 1
810 tt = (iter-1)*dt
811 fj = tdf(laser%f, iter)
812 phi = tdf(laser%phi, tt)
813 call tdf_set_numerical(laser%f, iter, fj*cos(laser%omega*tt+phi))
814 end do
815 call tdf_end(laser%phi)
816 call tdf_init_cw(laser%phi, m_zero, m_zero)
817 laser%omega = m_zero
818
819 pop_sub(lasers_to_numerical_all)
820 end subroutine laser_to_numerical_all
821 ! ---------------------------------------------------------
822
823
824 ! ---------------------------------------------------------
827 ! ---------------------------------------------------------
828 subroutine laser_to_numerical(laser, dt, max_iter, omegamax)
829 type(laser_t), intent(inout) :: laser
830 real(real64), intent(in) :: dt
831 integer, intent(in) :: max_iter
832 real(real64), intent(in) :: omegamax
833
834 push_sub(lasers_to_numerical)
836 call tdf_to_numerical(laser%f, max_iter, dt, omegamax)
837 call tdf_to_numerical(laser%phi, max_iter, dt, omegamax)
838
839 pop_sub(lasers_to_numerical)
840 end subroutine laser_to_numerical
841 ! ---------------------------------------------------------
842
843 ! ---------------------------------------------------------
844 subroutine laser_write_info(lasers, namespace, dt, max_iter, iunit)
845 type(laser_t), contiguous, intent(in) :: lasers(:)
846 type(namespace_t), intent(in) :: namespace
847 real(real64), optional, intent(in) :: dt
848 integer, optional, intent(in) :: max_iter
849 integer, optional, intent(in) :: iunit
850
851 real(real64) :: tt, fluence, max_intensity, intensity, dt_, field(3), up, maxfield,tmp
852 integer :: il, iter, no_l, max_iter_
853
854 push_sub(laser_write_info)
855
856 no_l = size(lasers)
857
858 do il = 1, no_l
859
860 if (present(dt)) then
861 dt_ = dt
862 else
863 dt_ = tdf_dt(lasers(il)%f)
864 end if
865 if (present(max_iter)) then
866 max_iter_ = max_iter
867 else
868 max_iter_ = tdf_niter(lasers(il)%f)
869 end if
870
871 write(message(1),'(i2,a)') il, ':'
872 select case (lasers(il)%field)
873 case (e_field_electric)
874 message(2) = ' Electric Field.'
875 case (e_field_magnetic)
876 message(2) = ' Magnetic Field.'
878 message(2) = ' Vector Potential.'
880 message(2) = ' Scalar Potential.'
881 end select
882 call messages_info(2, iunit=iunit, namespace=namespace)
883
884 if (lasers(il)%field /= e_field_scalar_potential) then
885 write(message(1),'(3x,a,3(a1,f7.4,a1,f7.4,a1))') 'Polarization: ', &
886 '(', real(lasers(il)%pol(1), real64), ',', aimag(lasers(il)%pol(1)), '), ', &
887 '(', real(lasers(il)%pol(2), real64), ',', aimag(lasers(il)%pol(2)), '), ', &
888 '(', real(lasers(il)%pol(3), real64), ',', aimag(lasers(il)%pol(3)), ')'
889 call messages_info(1, iunit=iunit, namespace=namespace)
890 end if
891
892 write(message(1),'(3x,a,f14.8,3a)') 'Carrier frequency = ', &
893 units_from_atomic(units_out%energy, lasers(il)%omega), &
894 ' [', trim(units_abbrev(units_out%energy)), ']'
895 message(2) = ' Envelope: '
896 call messages_info(2, iunit=iunit, namespace=namespace)
897 call tdf_write(lasers(il)%f, iunit)
898
899 if (.not. tdf_is_empty(lasers(il)%phi)) then
900 message(1) = ' Phase: '
901 call messages_info(1, iunit=iunit, namespace=namespace)
902 call tdf_write(lasers(il)%phi, iunit)
903 end if
904
905 ! 1 atomic unit of intensity = 3.5094448e+16 W / cm^2
906 ! In a Gaussian system of units,
907 ! I(t) = (1/(8\pi)) * c * E(t)^2
908 ! (1/(8\pi)) * c = 5.4525289841210 a.u.
909 if (lasers(il)%field == e_field_electric .or. lasers(il)%field == e_field_vector_potential) then
910 fluence = m_zero
911 max_intensity = m_zero
912 maxfield= m_zero
913 do iter = 1, max_iter_
914 tt = iter * dt_
915 call laser_electric_field(lasers(il), field, tt, dt_)
916 intensity = 5.4525289841210_real64*sum(field**2)
917 fluence = fluence + intensity
918 if (intensity > max_intensity) max_intensity = intensity
919
920 tmp = sum(field(:)**2)
921 if (tmp > maxfield) maxfield = tmp
922 end do
923 fluence = fluence * dt_
924
925 write(message(1),'(a,es17.6,3a)') ' Peak intensity = ', max_intensity, ' [a.u]'
926 write(message(2),'(a,es17.6,3a)') ' = ', &
927 max_intensity * 6.4364086e+15_real64, ' [W/cm^2]'
928 write(message(3),'(a,es17.6,a)') ' Int. intensity = ', fluence, ' [a.u]'
929 write(message(4),'(a,es17.6,a)') ' Fluence = ', &
930 fluence / 5.4525289841210_real64 , ' [a.u]'
931 call messages_info(4, iunit=iunit, namespace=namespace)
932
933 if (abs(lasers(il)%omega) > m_epsilon) then
934 ! Ponderomotive Energy is the cycle-averaged kinetic energy of
935 ! a free electron quivering in the field
936 ! Up = E^2/(4*\omega^2)
937 !
938 ! subroutine laser_to_numerical_all sets lasers%omega to zero
939 !
940 up = maxfield/(4*lasers(il)%omega**2)
941
942 write(message(1),'(a,es17.6,3a)') ' Ponderomotive energy = ', &
943 units_from_atomic(units_out%energy, up) ,&
944 ' [', trim(units_abbrev(units_out%energy)), ']'
945 call messages_info(1, iunit=iunit, namespace=namespace)
946 end if
947 end if
948
949 end do
950
951 pop_sub(laser_write_info)
952 end subroutine laser_write_info
953 ! ---------------------------------------------------------
954
955
956 ! ---------------------------------------------------------
957 subroutine laser_potential(laser, mesh, pot, time)
958 type(laser_t), intent(in) :: laser
959 class(mesh_t), intent(in) :: mesh
960 real(real64), contiguous, intent(inout) :: pot(:)
961 real(real64), optional, intent(in) :: time
962
963 complex(real64) :: amp
964 integer :: ip
965 real(real64) :: field(3)
966
967 push_sub(laser_potential)
968
969 if (present(time)) then
970 amp = tdf(laser%f, time) * exp(m_zi * (laser%omega * time + tdf(laser%phi, time)))
971 else
972 amp = m_z1
973 end if
974
975 select case (laser%field)
977 call lalg_axpy(mesh%np, real(amp, real64), laser%v, pot)
978 case default
979 field(:) = real(amp * laser%pol(:), real64)
980 do ip = 1, mesh%np
981 ! The -1 sign is missing here. Check epot.F90 for the explanation.
982 pot(ip) = pot(ip) + sum(field(1:mesh%box%dim) * mesh%x(1:mesh%box%dim, ip))
983 end do
984 end select
985
986 pop_sub(laser_potential)
987 end subroutine laser_potential
988 ! ---------------------------------------------------------
989
990
991 ! ---------------------------------------------------------
992 subroutine laser_vector_potential(laser, mesh, aa, time)
993 type(laser_t), intent(in) :: laser
994 type(mesh_t), intent(in) :: mesh
995 real(real64), contiguous, intent(inout) :: aa(:, :)
996 real(real64), optional, intent(in) :: time
997
998 real(real64) :: amp
999 integer :: ip, idir
1000
1001 push_sub(laser_vector_potential)
1002
1003 if (present(time)) then
1004 amp = tdf(laser%f, time)*cos((laser%omega*time + tdf(laser%phi, time)))
1005 do idir = 1, mesh%box%dim
1006 do ip = 1, mesh%np
1007 aa(ip, idir) = aa(ip, idir) + amp*laser%a(ip, idir)
1008 end do
1009 end do
1010 else
1011 do idir = 1, mesh%box%dim
1012 do ip = 1, mesh%np
1013 aa(ip, idir) = aa(ip, idir) + laser%a(ip, idir)
1014 end do
1015 end do
1016 end if
1017
1018 pop_sub(laser_vector_potential)
1019 end subroutine laser_vector_potential
1020 ! ---------------------------------------------------------
1021
1022
1023 ! ---------------------------------------------------------
1029 subroutine laser_field(laser, field, time)
1030 type(laser_t), intent(in) :: laser
1031 real(real64), contiguous, intent(inout) :: field(:)
1032 real(real64), optional, intent(in) :: time
1033
1034 integer :: dim
1035 complex(real64) :: amp
1036
1037 !no PUSH SUB, called too often
1038
1039 dim = size(field)
1040
1041 if (present(time)) then
1042 amp = tdf(laser%f, time) * exp(m_zi * (laser%omega * time + tdf(laser%phi, time)))
1043 else
1044 amp = m_z1
1045 end if
1046 if (laser%field == e_field_scalar_potential) then
1047 ! In this case we will just return the value of the time function. The "field", in fact,
1048 ! should be a function of the position in space (thus, a true "field"), given by the
1049 ! gradient of the scalar potential.
1050 field(1) = field(1) + real(amp, real64)
1051 else
1052 field(1:dim) = field(1:dim) + real(amp*laser%pol(1:dim), real64)
1053 end if
1054 end subroutine laser_field
1055
1056! ---------------------------------------------------------
1064 subroutine lasers_nondipole_laser_field_step(this, field, time)
1065 type(lasers_t), intent(in) :: this
1066 real(real64), contiguous, intent(out) :: field(:)
1067 real(real64), intent(in) :: time
1068
1069 real(real64) :: a0(3)
1070 real(real64) :: e0(3)
1071 integer :: ilaser
1072 integer :: jlaser
1073 integer :: dim
1074 integer :: iter
1075 dim = size(field)
1076
1077 field(1:dim) = this%integrated_nondipole_afield(1:dim)
1078 if (time - this%nd_integration_time < 0) then
1079 return
1080 endif
1081 do iter = 1, nint((time-this%nd_integration_time)/this%nd_integration_step)
1082 do ilaser = 1, this%no_lasers
1083 if(laser_kind(this%lasers(ilaser)) /= e_field_vector_potential) cycle
1084 do jlaser = 1, this%no_lasers
1085 if(laser_kind(this%lasers(jlaser)) /= e_field_vector_potential) cycle
1086 if(allocated(this%lasers(jlaser)%prop)) then
1087 a0 = m_zero
1088 call laser_field(this%lasers(ilaser), a0, &
1089 iter*this%nd_integration_step+this%nd_integration_time)
1090 call laser_electric_field(this%lasers(jlaser), e0, &
1091 iter*this%nd_integration_step+this%nd_integration_time, this%nd_integration_step)
1092 ! We have front factor q/(mc) with q=-abs(e) =-1 a.u. and m = 1 a.u.
1093 field(1:dim) = field(1:dim) - m_one/(p_c) * this%nd_integration_step &
1094 * dot_product(a0,e0) * this%lasers(jlaser)%prop(1:dim)
1095 end if
1096 end do
1097 end do
1098 end do
1100
1102 ! ---------------------------------------------------------
1105 subroutine laser_electric_field(laser, field, time, dt)
1106 type(laser_t), intent(in) :: laser
1107 real(real64), contiguous, intent(out) :: field(:)
1108 real(real64), intent(in) :: time
1109 real(real64), intent(in) :: dt
1110
1111 integer :: dim
1112 real(real64), allocatable :: field1(:), field2(:)
1113
1114 !no PUSH SUB, called too often
1115
1116 dim = size(field)
1117
1118 select case (laser%field)
1119 case (e_field_electric)
1120 field = m_zero
1121 call laser_field(laser, field(1:dim), time)
1123 safe_allocate(field1(1:dim))
1124 safe_allocate(field2(1:dim))
1125 field1 = m_zero
1126 field2 = m_zero
1127 call laser_field(laser, field1(1:dim), time - dt)
1128 call laser_field(laser, field2(1:dim), time + dt)
1129 field = - (field2 - field1) / (m_two * p_c * dt)
1130 safe_deallocate_a(field1)
1131 safe_deallocate_a(field2)
1132 case default
1133 field = m_zero
1134 end select
1135
1137 ! ---------------------------------------------------------
1138
1139 ! ---------------------------------------------------------
1140 ! Loading of the lasers for the multisystem framework
1141 ! Ultimately this should be done in laser_init
1142 subroutine load_lasers(partners, namespace)
1143 class(partner_list_t), intent(inout) :: partners
1144 type(namespace_t), intent(in) :: namespace
1145
1146 class(lasers_t), pointer :: lasers
1147 integer :: il
1148
1149 push_sub(load_lasers)
1150
1151 lasers => lasers_t(namespace)
1152
1153 call lasers_parse_external_fields(lasers)
1154
1155 ! TODO: see how to do this in the multisystem framework
1156 if (parse_is_defined(namespace, 'MillerIndicesBasis')) then
1157 call messages_not_implemented("MillerIndicesBasis with load_lasers routine")
1158 end if
1159
1160 ! This is done normally in lasers_generate_potential, but we cannot call this routine here,
1161 ! so we do it here
1162 do il = 1, lasers%no_lasers
1163 lasers%lasers(il)%pol(:) = lasers%lasers(il)%pol(:)/sqrt(sum(abs(lasers%lasers(il)%pol(:))**2))
1164 end do
1165
1166 call lasers%quantities%add(quantity_t("E field", always_available = .true., updated_on_demand = .true., iteration = clock_t()))
1167 call lasers%quantities%add(quantity_t("B field", always_available = .true., updated_on_demand = .true., iteration = clock_t()))
1168
1169 lasers%supported_interactions_as_partner = [lorentz_force]
1170
1171 if (lasers%no_lasers > 0) then
1172 call partners%add(lasers)
1173 else
1174 safe_deallocate_p(lasers)
1175 end if
1176
1178 end subroutine load_lasers
1179
1185 subroutine add_reflected_fields(lasers)
1186 class(lasers_t), intent(inout) :: lasers
1187
1188 complex(real64), allocatable :: polarizations_imp(:,:)
1189 complex(real64), allocatable :: polarizations_tot(:,:)
1190 real(real64), allocatable :: frequencies_imp(:)
1191 real(real64), allocatable :: frequencies_tot(:)
1192 type(tdf_t), allocatable :: envelopes_imp(:)
1193 type(tdf_t), allocatable :: envelopes_tot(:)
1194 type(tdf_t), allocatable :: phases_imp(:)
1195 type(tdf_t), allocatable :: phases_tot(:)
1196 integer :: nlasers_impinging
1197 type(lpcm_substrate_t) :: substrate
1198 integer :: ilaser
1199
1200 push_sub(add_reflected_fields)
1201
1202 call layer_pcm_substrate_reflection_init(substrate, lasers%namespace)
1203
1204 if (.not. (substrate%is_present .and. substrate%reflection%is_present)) then
1205 call layer_pcm_substrate_end(substrate)
1206 pop_sub(add_reflected_fields)
1207 return
1208 end if
1209
1210 call substrate%set_mode(lpcm_mode_noneq)
1211
1212 nlasers_impinging = lasers%no_lasers
1213 safe_allocate(polarizations_imp(1:nlasers_impinging, 1:3))
1214 safe_allocate(frequencies_imp(1:nlasers_impinging))
1215 safe_allocate(envelopes_imp(1:nlasers_impinging))
1216 safe_allocate(phases_imp(1:nlasers_impinging))
1217 do ilaser = 1, nlasers_impinging
1218 if (lasers%lasers(ilaser)%field /= e_field_electric) then
1219 message(1) = "Reflection can only be calculated for electric fields."
1220 call messages_fatal(1)
1221 end if
1222 polarizations_imp(ilaser, :) = lasers%lasers(ilaser)%pol
1223 frequencies_imp(ilaser) = lasers%lasers(ilaser)%omega
1224 call tdf_init(envelopes_imp(ilaser))
1225 call tdf_init(phases_imp(ilaser))
1226 call tdf_copy(envelopes_imp(ilaser), lasers%lasers(ilaser)%f)
1227 call tdf_copy(phases_imp(ilaser), lasers%lasers(ilaser)%phi)
1228 end do
1229
1230 call layer_pcm_calculate_reflected_fields(polarizations_tot, frequencies_tot, envelopes_tot, phases_tot, &
1231 polarizations_imp, frequencies_imp, envelopes_imp, phases_imp, substrate)
1232
1233 do ilaser = 1, nlasers_impinging
1234 safe_deallocate_a(lasers%lasers(ilaser)%pol)
1235 call tdf_end(lasers%lasers(ilaser)%f)
1236 call tdf_end(lasers%lasers(ilaser)%phi)
1237 call tdf_end(envelopes_imp(ilaser))
1238 call tdf_end(phases_imp(ilaser))
1239 end do
1240 safe_deallocate_a(lasers%lasers)
1241
1242 lasers%no_lasers = size(frequencies_tot)
1243 safe_allocate(lasers%lasers(1:lasers%no_lasers))
1244 do ilaser = 1, lasers%no_lasers
1245 lasers%lasers(ilaser)%field = e_field_electric
1246 call tdf_init(lasers%lasers(ilaser)%f)
1247 call tdf_init(lasers%lasers(ilaser)%phi)
1248 call tdf_copy(lasers%lasers(ilaser)%f, envelopes_tot(ilaser))
1249 call tdf_copy(lasers%lasers(ilaser)%phi, phases_tot(ilaser))
1250 safe_allocate(lasers%lasers(ilaser)%pol(1:3))
1251 lasers%lasers(ilaser)%pol = polarizations_tot(ilaser, :)
1252 lasers%lasers(ilaser)%omega = frequencies_tot(ilaser)
1253 call tdf_end(envelopes_tot(ilaser))
1254 call tdf_end(phases_tot(ilaser))
1255 end do
1256
1257 safe_deallocate_a(polarizations_imp)
1258 safe_deallocate_a(polarizations_tot)
1259 safe_deallocate_a(frequencies_imp)
1260 safe_deallocate_a(frequencies_tot)
1261 safe_deallocate_a(envelopes_imp)
1262 safe_deallocate_a(envelopes_tot)
1263 safe_deallocate_a(phases_imp)
1264 safe_deallocate_a(phases_tot)
1265 call layer_pcm_substrate_end(substrate)
1266
1267 pop_sub(add_reflected_fields)
1268 end subroutine add_reflected_fields
1269
1270end module lasers_oct_m
1271
1272!! Local Variables:
1273!! mode: f90
1274!! coding: utf-8
1275!! End:
double exp(double __x) __attribute__((__nothrow__
double sqrt(double __x) __attribute__((__nothrow__
double cos(double __x) __attribute__((__nothrow__
real(real64), parameter, public m_zero
Definition: global.F90:173
complex(real64), parameter, public m_z0
Definition: global.F90:183
real(real64), parameter, public m_epsilon
Definition: global.F90:189
complex(real64), parameter, public m_z1
Definition: global.F90:184
real(real64), parameter, public m_half
Definition: global.F90:179
real(real64), parameter, public m_one
Definition: global.F90:174
This module defines classes and functions for interaction partners.
subroutine, public kpoints_to_absolute(latt, kin, kout)
Definition: kpoints.F90:1124
subroutine, public load_lasers(partners, namespace)
Definition: lasers.F90:1215
complex(real64) function, dimension(3), public laser_polarization(laser)
Definition: lasers.F90:711
subroutine, public laser_set_phi(laser, phi)
Definition: lasers.F90:795
subroutine, public lasers_check_symmetries(this, kpoints)
Definition: lasers.F90:538
subroutine lasers_copy_quantities_to_interaction(partner, interaction)
Definition: lasers.F90:677
subroutine, public laser_to_numerical_all(laser, dt, max_iter, omegamax)
The td functions that describe the laser field are transformed to a "numerical" representation (i....
Definition: lasers.F90:870
subroutine, public laser_vector_potential(laser, mesh, aa, time)
Definition: lasers.F90:1065
subroutine, public lasers_nondipole_laser_field_step(this, field, time)
Retrieves the NDSFA vector_potential correction. The nondipole field is obtained for consecutive time...
Definition: lasers.F90:1137
subroutine, public lasers_parse_external_fields(this)
Definition: lasers.F90:225
subroutine, public lasers_set_nondipole_parameters(this, ndfield, nd_integration_time)
Set parameters for nondipole SFA calculation.
Definition: lasers.F90:737
subroutine lasers_update_quantity(this, label)
Definition: lasers.F90:633
subroutine, public laser_get_f(laser, ff)
Definition: lasers.F90:754
subroutine add_reflected_fields(lasers)
Expands lasers object, including reflected fields for all fields specified in TDExternalFields.
Definition: lasers.F90:1258
subroutine, public laser_set_f(laser, ff)
Definition: lasers.F90:767
logical function, public lasers_with_nondipole_field(lasers)
Check if a nondipole SFA correction should be computed for the given laser.
Definition: lasers.F90:724
subroutine, public laser_write_info(lasers, namespace, dt, max_iter, iunit)
Definition: lasers.F90:917
subroutine, public laser_set_empty_phi(laser)
Definition: lasers.F90:810
real(real64) function, public laser_carrier_frequency(laser)
Definition: lasers.F90:604
integer, parameter, public e_field_electric
Definition: lasers.F90:158
integer, parameter, public e_field_vector_potential
Definition: lasers.F90:158
subroutine, public laser_to_numerical(laser, dt, max_iter, omegamax)
The td functions that describe the laser field are transformed to a "numerical" representation (i....
Definition: lasers.F90:901
subroutine, public laser_electric_field(laser, field, time, dt)
Returns a vector with the electric field, no matter whether the laser is described directly as an ele...
Definition: lasers.F90:1178
subroutine, public lasers_generate_potentials(this, mesh, space, latt)
Definition: lasers.F90:426
subroutine lasers_init_interaction_as_partner(partner, interaction)
Definition: lasers.F90:615
subroutine lasers_finalize(this)
Definition: lasers.F90:563
subroutine, public laser_potential(laser, mesh, pot, time)
Definition: lasers.F90:1030
class(lasers_t) function, pointer lasers_constructor(namespace)
Definition: lasers.F90:207
integer, parameter, public e_field_scalar_potential
Definition: lasers.F90:158
integer pure elemental function, public laser_kind(laser)
Definition: lasers.F90:700
subroutine, public laser_set_frequency(laser, omega)
Definition: lasers.F90:836
subroutine, public laser_field(laser, field, time)
Retrieves the value of either the electric or the magnetic field. If the laser is given by a scalar p...
Definition: lasers.F90:1102
subroutine, public laser_set_polarization(laser, pol)
Definition: lasers.F90:849
subroutine, public laser_set_f_value(laser, ii, xx)
Definition: lasers.F90:822
subroutine, public laser_get_phi(laser, phi)
Definition: lasers.F90:782
subroutine lasers_deallocate(this)
Definition: lasers.F90:574
integer, parameter, public e_field_magnetic
Definition: lasers.F90:158
This module is intended to contain "only mathematical" functions and procedures.
Definition: math.F90:94
This module defines the meshes, which are used in Octopus.
Definition: mesh.F90:97
pure subroutine, public mesh_r(mesh, ip, rr, origin, coords)
return the distance to the origin for a given grid point
Definition: mesh.F90:324
subroutine, public messages_warning(no_lines, all_nodes, namespace)
Definition: messages.F90:501
subroutine, public messages_obsolete_variable(namespace, name, rep)
Definition: messages.F90:980
character(len=256), dimension(max_lines), public message
to be output by fatal, warning
Definition: messages.F90:138
subroutine, public messages_fatal(no_lines, only_root_writes, namespace)
Definition: messages.F90:386
subroutine, public messages_info(no_lines, iunit, debug_only, stress, all_nodes, namespace)
Definition: messages.F90:570
subroutine, public parse_block_string(blk, l, c, res, convert_to_c)
Definition: parser.F90:795
integer function, public parse_block(namespace, name, blk, check_varinfo_)
Definition: parser.F90:600
/* To use the profiling module, call profiling_in and profiling_out with the label of the region as a...
Definition: profiling.F90:122
This module defines the quantity_t class and the IDs for quantities, which can be exposed by a system...
Definition: quantity.F90:117
integer pure function, public symmetries_identity_index(this)
Definition: symmetries.F90:614
real(real64), public symprec
Definition: symmetries.F90:154
integer pure function, public symmetries_number(this)
Definition: symmetries.F90:568
subroutine, public tdf_end(f)
Definition: tdfunction.F90:959
subroutine, public tdf_init(f)
Definition: tdfunction.F90:367
subroutine, public tdf_read(f, namespace, function_name, ierr)
This function initializes "f" from the TDFunctions block.
Definition: tdfunction.F90:197
brief This module defines the class unit_t which is used by the unit_systems_oct_m module.
Definition: unit.F90:111
This module defines the unit system, used for input and output.
__clock_t clock_t
Definition: recipes.c:1875
abstract class for general interaction partners
Describes mesh distribution to nodes.
Definition: mesh.F90:165
int true(void)