101 logical :: bc_add_ab_region = .false.
102 logical :: bc_zero = .false.
103 logical :: bc_constant = .false.
104 logical :: bc_mirror_pec = .false.
105 logical :: bc_mirror_pmc = .false.
106 logical :: bc_plane_waves = .false.
107 logical :: bc_medium = .false.
108 type(exponential_t) :: te
109 logical :: plane_waves_in_box
110 integer :: tr_etrs_approx
113 integer,
public,
parameter :: &
114 RS_TRANS_FORWARD = 1, &
117 integer,
parameter :: &
118 MXWLL_ETRS_FULL = 0, &
125 type(grid_t),
intent(in) :: gr
126 type(namespace_t),
intent(in) :: namespace
127 type(states_mxll_t),
intent(inout) :: st
128 type(hamiltonian_mxll_t),
intent(inout) :: hm
129 type(propagator_mxll_t),
intent(inout) :: tr
138 select case (hm%bc%bc_type(idim))
143 tr%bc_constant = .
true.
144 tr%bc_add_ab_region = .
true.
145 hm%bc_constant = .
true.
146 hm%bc_add_ab_region = .
true.
148 tr%bc_mirror_pec = .
true.
149 hm%bc_mirror_pec = .
true.
151 tr%bc_mirror_pmc = .
true.
152 hm%bc_mirror_pmc = .
true.
154 tr%bc_plane_waves = .
true.
155 tr%bc_add_ab_region = .
true.
156 hm%plane_waves = .
true.
157 hm%bc_plane_waves = .
true.
158 hm%bc_add_ab_region = .
true.
164 safe_allocate(st%rs_state_const(1:st%dim))
165 st%rs_state_const =
m_z0
179 call parse_variable(namespace,
'MaxwellTDETRSApprox', mxwll_etrs_full, tr%tr_etrs_approx)
189 call parse_variable(namespace,
'MaxwellPlaneWavesInBox', .false., tr%plane_waves_in_box)
190 if (tr%plane_waves_in_box .and. .not. hm%bc%do_plane_waves)
then
205 subroutine mxll_propagation_step(hm, namespace, gr, space, st, tr, rs_stateb, ff_rs_inhom_t1, ff_rs_inhom_t2, time, dt)
207 type(namespace_t),
intent(in) :: namespace
209 class(
space_t),
intent(in) :: space
213 complex(real64),
contiguous,
intent(in) :: ff_rs_inhom_t1(:,:)
214 complex(real64),
contiguous,
intent(in) :: ff_rs_inhom_t2(:,:)
215 real(real64),
intent(in) :: time
216 real(real64),
intent(in) :: dt
218 integer :: ii, ff_dim, idim, istate, inter_steps
219 real(real64) :: inter_dt, inter_time
223 type(
batch_t) :: ff_rs_stateb, ff_rs_state_pmlb
224 type(
batch_t) :: ff_rs_inhom_1b, ff_rs_inhom_2b, ff_rs_inhom_meanb
225 complex(real64),
allocatable :: rs_state(:, :)
232 if (hm%ma_mx_coupling_apply)
then
233 message(1) =
"Maxwell-matter coupling not implemented yet"
236 safe_allocate(rs_state(gr%np, st%dim))
238 if (tr%plane_waves_in_box)
then
242 safe_deallocate_a(rs_state)
248 if (hm%bc%bc_ab_type(idim) == option__maxwellabsorbingboundaries__cpml)
then
254 if (pml_check .and. .not. hm%bc%pml%parameters_initialized) &
261 inter_dt =
m_one / inter_steps * dt
263 call zbatch_init(ff_rs_stateb, 1, 1, hm%dim, gr%np_part)
264 if (st%pack_states)
call ff_rs_stateb%do_pack(copy=.false.)
267 call ff_rs_stateb%copy_to(ff_rs_state_pmlb)
271 if ((hm%ma_mx_coupling_apply .or. hm%current_density_ext_flag .or. hm%current_density_from_medium) .and. &
273 call ff_rs_stateb%copy_to(ff_rs_inhom_1b)
274 call ff_rs_stateb%copy_to(ff_rs_inhom_2b)
275 call ff_rs_stateb%copy_to(ff_rs_inhom_meanb)
277 do istate = 1, hm%dim
278 call batch_set_state(ff_rs_inhom_meanb, istate, gr%np, ff_rs_inhom_t1(:, istate))
279 call batch_set_state(ff_rs_inhom_2b, istate, gr%np, ff_rs_inhom_t2(:, istate))
285 call ff_rs_inhom_meanb%copy_data_to(gr%np, ff_rs_inhom_1b)
286 call ff_rs_inhom_meanb%copy_data_to(gr%np, ff_rs_inhom_2b)
289 hm%cpml_hamiltonian = .false.
290 call tr%te%apply_batch(namespace, gr, hm, ff_rs_inhom_2b, inter_dt)
294 call ff_rs_inhom_meanb%copy_data_to(gr%np, ff_rs_inhom_2b)
296 call tr%te%apply_batch(namespace, gr, hm, ff_rs_inhom_2b, inter_dt*
m_half)
299 call ff_rs_inhom_meanb%copy_data_to(gr%np, ff_rs_inhom_2b)
301 call tr%te%apply_batch(namespace, gr, hm, ff_rs_inhom_2b, -inter_dt*
m_half)
304 call ff_rs_inhom_2b%end()
305 call ff_rs_inhom_meanb%end()
308 do ii = 1, inter_steps
311 inter_time = time + inter_dt * (ii-1)
322 hm%cpml_hamiltonian = pml_check
323 call tr%te%apply_batch(namespace, gr, hm, ff_rs_stateb, dt)
324 hm%cpml_hamiltonian = .false.
331 if ((hm%ma_mx_coupling_apply) .or. hm%current_density_ext_flag .or. hm%current_density_from_medium)
then
332 if (tr%tr_etrs_approx == mxwll_etrs_full)
then
333 call ff_rs_stateb%copy_to(ff_rs_inhom_1b)
334 call ff_rs_stateb%copy_to(ff_rs_inhom_2b)
335 call ff_rs_stateb%copy_to(ff_rs_inhom_meanb)
338 do istate = 1, hm%dim
339 call batch_set_state(ff_rs_inhom_meanb, istate, gr%np, ff_rs_inhom_t2(:, istate))
340 call batch_set_state(ff_rs_inhom_1b, istate, gr%np, ff_rs_inhom_t1(:, istate))
344 call ff_rs_inhom_1b%copy_data_to(gr%np, ff_rs_inhom_2b)
345 call batch_axpy(gr%np, ii / real(inter_steps, real64) , ff_rs_inhom_meanb, ff_rs_inhom_2b)
346 call batch_axpy(gr%np, (ii-1) / real(inter_steps, real64) , ff_rs_inhom_meanb, ff_rs_inhom_1b)
348 hm%cpml_hamiltonian = .false.
349 call tr%te%apply_batch(namespace, gr, hm, ff_rs_inhom_1b, inter_dt)
354 do istate = 1, hm%dim
355 call batch_set_state(ff_rs_inhom_1b, istate, gr%np, ff_rs_inhom_t1(:, istate))
356 call batch_set_state(ff_rs_inhom_2b, istate, gr%np, ff_rs_inhom_t2(:, istate))
360 call ff_rs_inhom_1b%copy_data_to(gr%np, ff_rs_inhom_2b)
362 call tr%te%apply_batch(namespace, gr, hm, ff_rs_inhom_1b, inter_dt/
m_two)
363 call tr%te%apply_batch(namespace, gr, hm, ff_rs_inhom_2b, -inter_dt/
m_two)
369 call ff_rs_inhom_1b%end()
370 call ff_rs_inhom_2b%end()
371 call ff_rs_inhom_meanb%end()
385 if (tr%bc_constant)
then
388 if (st%rs_state_const_external)
then
410 if (any(hm%bc%bc_ab_type == option__maxwellabsorbingboundaries__mask))
then
416 if (tr%bc_plane_waves)
then
425 if (tr%tr_etrs_approx == option__maxwelltdetrsapprox__const_steps)
then
426 call ff_rs_inhom_1b%end()
429 call ff_rs_stateb%end()
432 call ff_rs_state_pmlb%end()
435 safe_deallocate_a(rs_state)
445 type(namespace_t),
intent(in) :: namespace
446 type(
grid_t),
intent(inout) :: gr
447 class(
space_t),
intent(in) :: space
450 real(real64),
intent(in) :: time
451 real(real64),
intent(in) :: dt
452 integer,
intent(in) :: counter
458 call st%rs_stateb%copy_to(rs_state_tmpb)
466 if (any(hm%bc%bc_ab_type == option__maxwellabsorbingboundaries__cpml))
then
477 if (counter == 0)
then
479 call batch_xpay(gr%np, st%rs_stateb, dt, rs_state_tmpb)
486 call st%rs_stateb%copy_data_to(gr%np, st%rs_state_prevb)
488 call rs_state_tmpb%copy_data_to(gr%np, st%rs_stateb)
491 if (any(hm%bc%bc_ab_type == option__maxwellabsorbingboundaries__cpml))
then
495 call rs_state_tmpb%end()
516 type(namespace_t),
intent(in) :: namespace
517 type(
grid_t),
intent(inout) :: gr
518 class(
space_t),
intent(in) :: space
521 real(real64),
intent(in) :: time
522 real(real64),
intent(in) :: dt
528 call st%rs_stateb%copy_to(rs_state_tmpb)
537 if (any(hm%bc%bc_ab_type == option__maxwellabsorbingboundaries__cpml))
then
543 call hm%zapply(namespace, gr, st%rs_stateb, rs_state_tmpb)
546 if (hm%current_density_ext_flag .or. hm%current_density_from_medium)
then
548 call mxll_set_batch(st%inhomogeneousb, st%rs_current_density_t1, gr%np, st%dim)
553 call tr%te%apply_phi_batch(namespace, gr, hm, rs_state_tmpb, dt, 1)
555 call batch_axpy(gr%np, dt, rs_state_tmpb, st%rs_stateb)
557 call rs_state_tmpb%end()
560 if (any(hm%bc%bc_ab_type == option__maxwellabsorbingboundaries__cpml))
then
589 type(namespace_t),
intent(in) :: namespace
590 type(
grid_t),
intent(inout) :: gr
591 class(
space_t),
intent(in) :: space
594 real(real64),
intent(in) :: time
595 real(real64),
intent(in) :: dt
601 call st%rs_stateb%copy_to(rs_state_tmpb)
610 if (any(hm%bc%bc_ab_type == option__maxwellabsorbingboundaries__cpml))
then
616 call hm%zapply(namespace, gr, st%rs_stateb, rs_state_tmpb)
619 if (hm%current_density_ext_flag .or. hm%current_density_from_medium)
then
621 call mxll_set_batch(st%inhomogeneousb, st%rs_current_density_t1, gr%np, st%dim)
625 call mxll_set_batch(st%inhomogeneousb, st%rs_current_density_t2, gr%np, st%dim)
630 call tr%te%apply_phi_batch(namespace, gr, hm, rs_state_tmpb, dt, 1)
632 call batch_axpy(gr%np, dt, rs_state_tmpb, st%rs_stateb)
633 if (hm%current_density_ext_flag .or. hm%current_density_from_medium)
then
636 call mxll_set_batch(st%inhomogeneousb, st%rs_current_density_t1, gr%np, st%dim)
640 call mxll_set_batch(st%inhomogeneousb, st%rs_current_density_t2, gr%np, st%dim)
645 call tr%te%apply_phi_batch(namespace, gr, hm, rs_state_tmpb, dt, 2)
647 call batch_axpy(gr%np, dt, rs_state_tmpb, st%rs_stateb)
651 if (any(hm%bc%bc_ab_type == option__maxwellabsorbingboundaries__cpml))
then
655 call rs_state_tmpb%end()
663 type(
grid_t),
intent(in) :: gr
666 integer :: ip, ip_in, il, idim
670 assert(
allocated(st%ep) .and.
allocated(st%mu))
674 if (hm%calc_medium_box)
then
675 do il = 1,
size(hm%medium_boxes)
676 assert(.not. hm%medium_boxes(il)%has_mapping)
677 do ip = 1, hm%medium_boxes(il)%points_number
678 if (abs(hm%medium_boxes(il)%c(ip)) <=
m_epsilon) cycle
679 st%ep(ip) = hm%medium_boxes(il)%ep(ip)
680 st%mu(ip) = hm%medium_boxes(il)%mu(ip)
687 do ip_in = 1, hm%bc%medium(idim)%points_number
688 ip = hm%bc%medium(idim)%points_map(ip_in)
689 st%ep(ip) = hm%bc%medium(idim)%ep(ip_in)
690 st%mu(ip) = hm%bc%medium(idim)%mu(ip_in)
703 type(
grid_t),
intent(in) :: gr
705 type(
batch_t),
intent(inout) :: rs_stateb
706 type(
batch_t),
intent(inout) :: ff_rs_stateb
707 integer,
intent(in) :: sign
709 complex(real64),
allocatable :: rs_state(:,:)
710 complex(real64),
allocatable :: rs_state_tmp(:,:)
720 safe_allocate(rs_state(1:gr%np, 1:st%dim))
723 if (sign == rs_trans_forward)
then
732 safe_allocate(rs_state_tmp(1:gr%np, 1:st%dim))
736 rs_state(1:np, ii) =
m_half * (rs_state(1:np, ii) + conjg(rs_state_tmp(1:np, ii)))
739 safe_deallocate_a(rs_state_tmp)
742 if (sign == rs_trans_forward)
then
743 call rs_stateb%copy_data_to(gr%np, ff_rs_stateb)
745 call ff_rs_stateb%copy_data_to(gr%np, rs_stateb)
748 safe_deallocate_a(rs_state)
759 class(
mesh_t),
intent(in) :: mesh
760 complex(real64),
intent(inout) :: rs_charge_density(:)
761 complex(real64),
intent(inout) :: rs_current_density(:,:)
762 complex(real64),
intent(inout) :: ff_density(:,:)
763 integer,
intent(in) :: sign
767 assert(
size(rs_charge_density) == mesh%np .or.
size(rs_charge_density) == mesh%np_part)
768 assert(
size(rs_current_density, dim=1) ==
size(rs_charge_density))
769 assert(
size(rs_current_density, dim=2) == 3)
776 if (sign == rs_trans_forward)
then
778 rs_current_density, ff_density)
781 rs_charge_density, rs_current_density)
784 if (sign == rs_trans_forward)
then
785 ff_density(1:mesh%np, 1:3) = rs_current_density(1:mesh%np, 1:3)
787 rs_current_density(1:mesh%np, 1:3) = ff_density(1:mesh%np, 1:3)
799 class(
mesh_t),
intent(in) :: mesh
800 complex(real64),
intent(in) :: rs_charge_density(:)
801 complex(real64),
intent(in) :: rs_current_density(:,:)
802 complex(real64),
intent(inout) :: rs_density_6x6(:,:)
806 assert(
size(rs_current_density, dim=2) == 3)
807 assert(
size(rs_density_6x6, dim=2) == 6)
811 rs_density_6x6(1:mesh%np, ii) = rs_current_density(1:mesh%np, ii)
812 rs_density_6x6(1:mesh%np, ii+3) = rs_current_density(1:mesh%np, ii)
819 class(
mesh_t),
intent(in) :: mesh
820 complex(real64),
intent(in) :: rs_density_6x6(:,:)
821 complex(real64),
intent(inout) :: rs_charge_density(:)
822 complex(real64),
intent(inout) :: rs_current_density(:,:)
826 assert(
size(rs_current_density, dim=2) == 3)
827 assert(
size(rs_density_6x6, dim=2) == 6)
831 rs_current_density(1:mesh%np, ii) =
m_half * &
832 real(rs_density_6x6(1:mesh%np, ii) + rs_density_6x6(1:mesh%np, ii+3), real64)
839 type(
grid_t),
intent(in) :: gr_mxll
842 type(
grid_t),
intent(in) :: gr_elec
845 complex(real64),
intent(inout) :: rs_state_matter(:,:)
847 complex(real64),
allocatable :: tmp_pot_mx_gr(:,:), tmp_grad_mx_gr(:,:)
849 safe_allocate(tmp_pot_mx_gr(1:gr_mxll%np_part,1))
850 safe_allocate(tmp_grad_mx_gr(1:gr_mxll%np,1:gr_mxll%box%dim))
855 tmp_pot_mx_gr(:,:) =
m_zero
856 tmp_grad_mx_gr(:,:) =
m_zero
857 call zderivatives_grad(gr_mxll%der, tmp_pot_mx_gr(:,1), tmp_grad_mx_gr(:,:), set_bc = .false.)
858 tmp_grad_mx_gr = - tmp_grad_mx_gr
860 rs_state_matter =
m_z0
861 call build_rs_state(real(tmp_grad_mx_gr(1:gr_mxll%np,:)), aimag(tmp_grad_mx_gr(1:gr_mxll%np,:)), st_mxll%rs_sign, &
862 rs_state_matter(1:gr_mxll%np,:), gr_mxll, st_mxll%ep(1:gr_mxll%np), st_mxll%mu(1:gr_mxll%np), &
865 safe_deallocate_a(tmp_pot_mx_gr)
866 safe_deallocate_a(tmp_grad_mx_gr)
873 poisson_solver, helmholtz, time, field, transverse_field, vector_potential)
874 type(namespace_t),
intent(in) :: namespace
875 integer,
intent(in) :: trans_calc_method
876 type(
grid_t),
intent(in) :: gr_mxll
882 type(
poisson_t),
intent(in) :: poisson_solver
884 real(real64),
intent(in) :: time
885 complex(real64),
intent(inout) :: field(:,:)
886 complex(real64),
intent(inout) :: transverse_field(:,:)
887 real(real64),
intent(inout) :: vector_potential(:,:)
890 complex(real64),
allocatable :: rs_state_plane_waves(:, :)
894 transverse_field =
m_z0
899 if (hm_mxll%ma_mx_coupling)
then
904 if (tr_mxll%bc_plane_waves .and. hm_mxll%plane_waves_apply)
then
905 safe_allocate(rs_state_plane_waves(1:gr_mxll%np, 1:st_mxll%dim))
906 call mxll_get_batch(st_mxll%rs_state_plane_wavesb, rs_state_plane_waves, gr_mxll%np, st_mxll%dim)
910 if (tr_mxll%bc_plane_waves .and. hm_mxll%plane_waves_apply)
then
911 transverse_field(1:np,:) = field(1:np,:) - rs_state_plane_waves(1:np,:)
913 transverse_field(1:np,:) = field(1:np,:)
916 call helmholtz%get_trans_field(namespace, transverse_field, total_field=field)
918 if (tr_mxll%bc_plane_waves .and. hm_mxll%plane_waves_apply)
then
919 transverse_field(1:np,:) = transverse_field(1:np,:) + rs_state_plane_waves(1:np,:)
920 safe_deallocate_a(rs_state_plane_waves)
925 transverse_field(1:np,:) = field
936 type(namespace_t),
intent(in) :: namespace
937 type(
poisson_t),
intent(in) :: poisson_solver
938 type(
grid_t),
intent(in) :: gr
940 complex(real64),
intent(in) :: field(:,:)
941 real(real64),
contiguous,
intent(inout) :: vector_potential(:,:)
944 real(real64),
allocatable :: dtmp(:,:)
946 safe_allocate(dtmp(1:gr%np_part,1:3))
951 dtmp = vector_potential
954 call dpoisson_solve(poisson_solver, namespace, dtmp(:,idim), vector_potential(:,idim), .
true.)
958 safe_deallocate_a(dtmp)
963 subroutine energy_mxll_calc(gr, st, hm, energy_mxll, rs_field, rs_field_plane_waves)
964 type(
grid_t),
intent(in) :: gr
968 complex(real64),
intent(in) :: rs_field(:,:)
969 complex(real64),
optional,
intent(in) :: rs_field_plane_waves(:,:)
971 real(real64),
allocatable :: energy_density(:), e_energy_density(:), b_energy_density(:), energy_density_plane_waves(:)
977 safe_allocate(energy_density(1:gr%np))
978 safe_allocate(e_energy_density(1:gr%np))
979 safe_allocate(b_energy_density(1:gr%np))
980 if (
present(rs_field_plane_waves) .and. hm%plane_waves)
then
981 safe_allocate(energy_density_plane_waves(1:gr%np))
985 b_energy_density, hm%plane_waves, rs_field_plane_waves, energy_density_plane_waves)
986 energy_mxll%energy =
dmf_integrate(gr, energy_density, mask=st%inner_points_mask)
987 energy_mxll%e_energy =
dmf_integrate(gr, e_energy_density, mask=st%inner_points_mask)
988 energy_mxll%b_energy =
dmf_integrate(gr, b_energy_density, mask=st%inner_points_mask)
989 if (
present(rs_field_plane_waves) .and. hm%plane_waves)
then
990 energy_mxll%energy_plane_waves =
dmf_integrate(gr, energy_density_plane_waves, mask=st%inner_points_mask)
992 energy_mxll%energy_plane_waves =
m_zero
995 energy_mxll%boundaries =
dmf_integrate(gr, energy_density, mask=st%boundary_points_mask)
997 safe_deallocate_a(energy_density)
998 safe_deallocate_a(e_energy_density)
999 safe_deallocate_a(b_energy_density)
1000 if (
present(rs_field_plane_waves) .and. hm%plane_waves)
then
1001 safe_deallocate_a(energy_density_plane_waves)
1011 type(
grid_t),
intent(in) :: gr
1015 type(
batch_t),
intent(in) :: rs_fieldb
1016 type(
batch_t),
intent(in) :: rs_field_plane_wavesb
1018 type(
batch_t) :: e_fieldb, b_fieldb, e_field_innerb, b_field_innerb, rs_field_plane_waves_innerb
1019 real(real64) :: tmp(1:st%dim)
1020 complex(real64) :: ztmp(1:st%dim)
1027 if (st%pack_states)
then
1028 call e_fieldb%do_pack(copy=.false.)
1030 call e_fieldb%copy_to(b_fieldb)
1031 call e_fieldb%copy_to(e_field_innerb)
1032 call e_fieldb%copy_to(b_field_innerb)
1040 call batch_copy_with_map(st%inner_points_number, st%buff_inner_points_map, e_fieldb, e_field_innerb)
1041 call batch_copy_with_map(st%inner_points_number, st%buff_inner_points_map, b_fieldb, b_field_innerb)
1043 call batch_copy_with_map(st%inner_points_number, st%inner_points_map, e_fieldb, e_field_innerb)
1044 call batch_copy_with_map(st%inner_points_number, st%inner_points_map, b_fieldb, b_field_innerb)
1047 energy_mxll%e_energy = sum(tmp)
1049 energy_mxll%b_energy = sum(tmp)
1050 energy_mxll%energy = energy_mxll%e_energy + energy_mxll%b_energy
1053 energy_mxll%boundaries = sum(tmp)
1055 energy_mxll%boundaries = energy_mxll%boundaries + sum(tmp)
1056 energy_mxll%boundaries = energy_mxll%boundaries - energy_mxll%energy
1058 if (hm%plane_waves)
then
1059 call rs_field_plane_wavesb%copy_to(rs_field_plane_waves_innerb)
1063 rs_field_plane_wavesb, rs_field_plane_waves_innerb)
1066 rs_field_plane_wavesb, rs_field_plane_waves_innerb)
1069 energy_mxll%energy_plane_waves = sum(real(tmp, real64) )
1070 call rs_field_plane_waves_innerb%end()
1072 energy_mxll%energy_plane_waves =
m_zero
1077 call e_field_innerb%end()
1078 call b_field_innerb%end()
1087 type(namespace_t),
intent(in) :: namespace
1088 type(
grid_t),
intent(in) :: gr
1092 real(real64),
intent(in) :: time
1093 real(real64),
intent(in) :: dt
1094 real(real64),
intent(in) :: time_delay
1095 complex(real64),
intent(inout) :: rs_state(:,:)
1097 integer :: ip, ip_in, idim
1098 logical :: mask_check
1103 mask_check = .false.
1106 if (hm%bc%bc_ab_type(idim) == option__maxwellabsorbingboundaries__mask)
then
1111 if (mask_check)
then
1112 if (tr%bc_plane_waves .and. hm%plane_waves_apply)
then
1114 call mxll_get_batch(st%rs_state_plane_wavesb, st%rs_state_plane_waves, gr%np, st%dim)
1115 rs_state = rs_state - st%rs_state_plane_waves
1117 rs_state = rs_state + st%rs_state_plane_waves
1118 else if (tr%bc_constant .and. hm%spatial_constant_apply)
then
1121 do ip_in=1, hm%bc%constant_points_number
1122 ip = hm%bc%constant_points_map(ip_in)
1123 rs_state(ip,:) = rs_state(ip,:) - st%rs_state_const(:)
1126 do ip_in=1, hm%bc%constant_points_number
1127 ip = hm%bc%constant_points_map(ip_in)
1128 rs_state(ip,:) = rs_state(ip,:) + st%rs_state_const(:)
1143 complex(real64),
intent(inout) :: rs_state(:,:)
1145 integer :: ip, ip_in, idim
1152 if (hm%bc%bc_ab_type(idim) == option__maxwellabsorbingboundaries__mask)
then
1153 do ip_in = 1, hm%bc%mask_points_number(idim)
1154 ip = hm%bc%mask_points_map(ip_in,idim)
1155 rs_state(ip,:) = rs_state(ip,:) * hm%bc%mask(ip_in,idim)
1168 type(
grid_t),
intent(in) :: gr
1171 type(
batch_t),
intent(in) :: ff_rs_stateb
1172 type(
batch_t),
intent(inout) :: ff_rs_state_pmlb
1175 complex(real64),
allocatable :: rs_state_constant(:,:)
1176 type(
batch_t) :: rs_state_constantb
1182 if (tr%bc_plane_waves .and. hm%plane_waves_apply)
then
1184 ff_rs_state_pmlb, rs_trans_forward)
1186 else if (tr%bc_constant .and. hm%spatial_constant_apply)
then
1191 safe_allocate(rs_state_constant(1:gr%np,1:3))
1193 rs_state_constant(1:gr%np, ii) = st%rs_state_const(ii)
1195 call ff_rs_stateb%copy_to(rs_state_constantb)
1196 call mxll_set_batch(rs_state_constantb, rs_state_constant, gr%np, 3)
1199 ff_rs_state_pmlb, rs_trans_forward)
1202 call rs_state_constantb%end()
1204 safe_deallocate_a(rs_state_constant)
1207 call ff_rs_stateb%copy_data_to(gr%np, ff_rs_state_pmlb)
1218 type(namespace_t),
intent(in) :: namespace
1219 type(
grid_t),
intent(in) :: gr
1222 real(real64),
intent(in) :: time
1223 real(real64),
intent(in) :: dt
1224 real(real64),
intent(in) :: time_delay
1225 type(
batch_t),
intent(inout) :: ff_rs_state_pmlb
1226 type(
batch_t),
intent(inout) :: ff_rs_stateb
1228 integer :: ii, ff_dim
1229 complex(real64),
allocatable :: rs_state_constant(:,:), ff_rs_state_constant(:,:)
1230 type(
batch_t) :: ff_rs_state_plane_wavesb, ff_rs_constantb, rs_state_constantb
1236 if (tr%bc_plane_waves .and. hm%plane_waves_apply)
then
1237 hm%cpml_hamiltonian = .
true.
1238 call tr%te%apply_batch(namespace, gr, hm, ff_rs_state_pmlb, dt)
1239 hm%cpml_hamiltonian = .false.
1242 call ff_rs_stateb%copy_to(ff_rs_state_plane_wavesb)
1248 ff_rs_state_pmlb, ff_rs_state_plane_wavesb, ff_rs_stateb)
1250 call batch_add_with_map(hm%bc%plane_wave%points_number, hm%bc%plane_wave%points_map, &
1251 ff_rs_state_pmlb, ff_rs_state_plane_wavesb, ff_rs_stateb)
1254 call ff_rs_state_plane_wavesb%end()
1256 else if (tr%bc_constant .and. hm%spatial_constant_apply)
then
1257 hm%cpml_hamiltonian = .
true.
1258 call tr%te%apply_batch(namespace, gr, hm, ff_rs_state_pmlb, dt)
1259 hm%cpml_hamiltonian = .false.
1261 call ff_rs_stateb%copy_to(ff_rs_constantb)
1262 ff_dim = ff_rs_stateb%nst_linear
1263 safe_allocate(rs_state_constant(1:gr%np, 1:st%dim))
1267 rs_state_constant(1:gr%np, ii) = st%rs_state_const(ii)
1269 call ff_rs_stateb%copy_to(rs_state_constantb)
1270 call mxll_set_batch(rs_state_constantb, rs_state_constant, gr%np, st%dim)
1275 call batch_add_with_map(hm%bc%constant_points_number, hm%bc%buff_constant_points_map, &
1276 ff_rs_state_pmlb, ff_rs_constantb, ff_rs_stateb)
1279 ff_rs_state_pmlb, ff_rs_constantb, ff_rs_stateb)
1282 call ff_rs_constantb%end()
1283 call rs_state_constantb%end()
1285 safe_deallocate_a(rs_state_constant)
1286 safe_deallocate_a(ff_rs_state_constant)
1297 type(
grid_t),
intent(in) :: gr
1298 type(
batch_t),
intent(inout) :: ff_rs_state_pmlb
1315 type(
grid_t),
intent(in) :: gr
1316 type(
batch_t),
intent(inout) :: ff_rs_state_pmlb
1318 integer :: ip, ip_in, np_part, rs_sign
1319 complex(real64) :: pml_a, pml_b, pml_g, grad
1320 integer :: pml_dir, field_dir, ifield, idir
1321 integer,
parameter :: field_dirs(3, 2) = reshape([2, 3, 1, 3, 1, 2], [3, 2])
1322 logical :: with_medium
1323 type(
batch_t) :: gradb(gr%der%dim)
1331 assert(hm%dim == 3 .or. hm%dim == 6)
1333 np_part = gr%np_part
1334 rs_sign = hm%rs_sign
1338 with_medium = hm%dim == 6
1340 do pml_dir = 1, hm%st%dim
1341 select case (gradb(pml_dir)%status())
1343 do ip_in=1, hm%bc%pml%points_number
1344 ip = hm%bc%pml%points_map(ip_in)
1345 pml_a = hm%bc%pml%a(ip_in,pml_dir)
1346 pml_b = hm%bc%pml%b(ip_in,pml_dir)
1348 field_dir = field_dirs(pml_dir, ifield)
1349 grad = gradb(pml_dir)%zff_linear(ip, field_dir)
1350 pml_g = hm%bc%pml%conv_plus(ip_in, pml_dir, field_dir)
1351 hm%bc%pml%conv_plus(ip_in, pml_dir, field_dir) = pml_a * grad + pml_b * pml_g
1352 if (with_medium)
then
1353 grad = gradb(pml_dir)%zff_linear(ip, field_dir+3)
1354 pml_g = hm%bc%pml%conv_minus(ip_in, pml_dir, field_dir)
1355 hm%bc%pml%conv_minus(ip_in, pml_dir, field_dir) = pml_a * grad + pml_b * pml_g
1360 do ip_in=1, hm%bc%pml%points_number
1361 ip = hm%bc%pml%points_map(ip_in)
1362 pml_a = hm%bc%pml%a(ip_in,pml_dir)
1363 pml_b = hm%bc%pml%b(ip_in,pml_dir)
1365 field_dir = field_dirs(pml_dir, ifield)
1366 grad = gradb(pml_dir)%zff_pack(field_dir, ip)
1367 pml_g = hm%bc%pml%conv_plus(ip_in, pml_dir, field_dir)
1368 hm%bc%pml%conv_plus(ip_in, pml_dir, field_dir) = pml_a * grad + pml_b * pml_g
1369 if (with_medium)
then
1370 grad = gradb(pml_dir)%zff_pack(field_dir+3, ip)
1371 pml_g = hm%bc%pml%conv_minus(ip_in, pml_dir, field_dir)
1372 hm%bc%pml%conv_minus(ip_in, pml_dir, field_dir) = pml_a * grad + pml_b * pml_g
1379 if (with_medium)
then
1399 do idir = 1, gr%der%dim
1400 call gradb(idir)%end()
1415 type(namespace_t),
intent(in) :: namespace
1419 integer :: il, nlines, idim, ncols, ierr
1420 real(real64) :: e_field(st%dim), b_field(st%dim)
1421 character(len=1024) :: mxf_expression
1444 if (
parse_block(namespace,
'UserDefinedConstantSpatialMaxwellField', blk) == 0)
then
1445 st%rs_state_const_external = .
true.
1447 safe_allocate(st%rs_state_const_td_function(1:nlines))
1448 safe_allocate(st%rs_state_const_amp(1:st%dim, 1:nlines))
1455 if (ncols /= 7)
then
1456 message(1) =
'Each line in the UserDefinedConstantSpatialMaxwellField block must have'
1467 call build_rs_vector(e_field, b_field, st%rs_sign, st%rs_state_const_amp(:,il))
1468 call tdf_read(st%rs_state_const_td_function(il), namespace, trim(mxf_expression), ierr)
1482 call parse_variable(namespace,
'PropagateSpatialMaxwellField', .
true., hm%spatial_constant_propagate)
1491 logical,
intent(in) :: constant_calc
1493 type(
grid_t),
intent(in) :: gr
1495 real(real64),
intent(in) :: time
1496 real(real64),
intent(in) :: dt
1497 real(real64),
intent(in) :: delay
1498 complex(real64),
intent(inout) :: rs_state(:,:)
1499 logical,
optional,
intent(in) :: set_initial_state
1501 integer :: ip, ic, icn
1502 real(real64) :: tf_old, tf_new
1503 logical :: set_initial_state_
1509 set_initial_state_ = .false.
1510 if (
present(set_initial_state)) set_initial_state_ = set_initial_state
1512 if (hm%spatial_constant_apply)
then
1513 if (constant_calc)
then
1514 icn =
size(st%rs_state_const_td_function(:))
1515 st%rs_state_const(:) =
m_z0
1517 tf_old =
tdf(st%rs_state_const_td_function(ic), time-delay-dt)
1518 tf_new =
tdf(st%rs_state_const_td_function(ic), time-delay)
1520 if (set_initial_state_ .or. (.not. hm%spatial_constant_propagate))
then
1521 rs_state(ip,:) = st%rs_state_const_amp(:,ic) * tf_new
1523 rs_state(ip,:) = rs_state(ip,:) + st%rs_state_const_amp(:,ic) * (tf_new - tf_old)
1526 st%rs_state_const(:) = st%rs_state_const(:) + st%rs_state_const_amp(:, ic)
1528 st%rs_state_const(:) = st%rs_state_const(:) * tf_new
1539 logical,
intent(in) :: constant_calc
1543 complex(real64),
intent(inout) :: rs_state(:,:)
1545 integer :: ip_in, ip
1550 if (hm%spatial_constant_apply)
then
1551 if (constant_calc)
then
1552 do ip_in = 1, bc%constant_points_number
1553 ip = bc%constant_points_map(ip_in)
1554 rs_state(ip,:) = st%rs_state_const(:)
1555 bc%constant_rs_state(ip_in,:) = st%rs_state_const(:)
1569 complex(real64),
intent(inout) :: rs_state(:,:)
1571 integer :: ip, ip_in, idim
1572 real(real64) :: e_field(st%dim), b_field(st%dim)
1578 do ip_in = 1, bc%mirror_points_number(idim)
1579 ip = bc%mirror_points_map(ip_in, idim)
1582 call build_rs_vector(e_field(:), b_field(:), st%rs_sign, rs_state(ip,:), st%ep(ip), st%mu(ip))
1594 complex(real64),
intent(inout) :: rs_state(:,:)
1596 integer :: ip, ip_in, idim
1597 real(real64) :: e_field(st%dim), b_field(st%dim)
1603 do ip_in = 1, bc%mirror_points_number(idim)
1604 ip = bc%mirror_points_map(ip_in,idim)
1607 call build_rs_vector(e_field(:), b_field(:), st%rs_sign, rs_state(ip,:), st%ep(ip), st%mu(ip))
1619 class(
mesh_t),
intent(in) :: mesh
1620 real(real64),
intent(in) :: time
1621 real(real64),
intent(in) :: time_delay
1622 complex(real64),
intent(inout) :: rs_state(:,:)
1624 integer :: ip, ip_in, wn
1625 real(real64) :: x_prop(mesh%box%dim), rr, vv(mesh%box%dim), k_vector(mesh%box%dim)
1626 real(real64) :: k_vector_abs, nn
1627 complex(real64) :: e0(mesh%box%dim)
1628 real(real64) :: e_field(mesh%box%dim), b_field(mesh%box%dim)
1629 complex(real64) :: rs_state_add(mesh%box%dim)
1630 complex(real64) :: mx_func
1636 if (hm%plane_waves_apply)
then
1637 do wn = 1, hm%bc%plane_wave%number
1638 k_vector(:) = hm%bc%plane_wave%k_vector(1:mesh%box%dim, wn)
1639 k_vector_abs = norm2(k_vector(1:mesh%box%dim))
1640 vv(:) = hm%bc%plane_wave%v_vector(1:mesh%box%dim, wn)
1641 e0(:) = hm%bc%plane_wave%e_field(1:mesh%box%dim, wn)
1642 do ip_in = 1, hm%bc%plane_wave%points_number
1643 ip = hm%bc%plane_wave%points_map(ip_in)
1644 if (wn == 1) rs_state(ip,:) =
m_z0
1646 x_prop(1:mesh%box%dim) = mesh%x(ip,1:mesh%box%dim) - vv(1:mesh%box%dim) * (time - time_delay)
1647 rr = norm2(x_prop(1:mesh%box%dim))
1648 if (hm%bc%plane_wave%modus(wn) == option__maxwellincidentwaves__plane_wave_mx_function)
then
1650 mx_func =
mxf(hm%bc%plane_wave%mx_function(wn), x_prop(1:mesh%box%dim))
1651 e_field(1:mesh%box%dim) = real(e0(1:mesh%box%dim) * mx_func, real64)
1654 call build_rs_vector(e_field, b_field, st%rs_sign, rs_state_add, st%ep(ip), st%mu(ip))
1655 rs_state(ip, :) = rs_state(ip, :) + rs_state_add(:)
1659 do ip_in = 1, hm%bc%plane_wave%points_number
1660 ip = hm%bc%plane_wave%points_map(ip_in)
1674 type(namespace_t),
intent(in) :: namespace
1676 type(
grid_t),
intent(in) :: gr
1677 real(real64),
intent(in) :: time
1678 real(real64),
intent(in) :: dt
1679 real(real64),
intent(in) :: time_delay
1689 call zbatch_init(ff_rs_stateb, 1, 1, hm%dim, gr%np_part)
1690 if (st%pack_states)
call ff_rs_stateb%do_pack(copy=.false.)
1696 hm%cpml_hamiltonian = .false.
1697 call tr%te%apply_batch(namespace, gr, hm, ff_rs_stateb, dt)
1700 call mxll_get_batch(st%rs_state_plane_wavesb, st%rs_state_plane_waves, gr%np, st%dim)
1702 call mxll_set_batch(st%rs_state_plane_wavesb, st%rs_state_plane_waves, gr%np, st%dim)
1703 call ff_rs_stateb%end()
1712 real(real64),
intent(in) :: time
1713 class(
space_t),
intent(in) :: space
1714 class(
mesh_t),
intent(in) :: mesh
1717 complex(real64),
intent(inout) :: rs_state(:,:)
1719 real(real64) :: e_field_total(mesh%np,st%dim), b_field_total(mesh%np,st%dim)
1720 complex(real64) :: rs_state_add(mesh%np,st%dim)
1730 rs_state_add(1:mesh%np,:), mesh, st%ep, st%mu)
1731 rs_state(1:mesh%np,:) = rs_state(1:mesh%np,:) + rs_state_add(1:mesh%np,:)
1743 type(
grid_t),
intent(in) :: gr
1744 type(namespace_t),
intent(in) :: namespace
1745 real(real64),
intent(in) :: time
1746 real(real64),
intent(in) :: dt
1747 type(
batch_t),
intent(inout) :: rs_stateb
1749 complex(real64),
allocatable :: rs_state(:, :)
1753 safe_allocate(rs_state(gr%np, st%dim))
1755 if (tr%bc_constant)
then
1758 if (st%rs_state_const_external)
then
1779 if (any(hm%bc%bc_ab_type == option__maxwellabsorbingboundaries__mask))
then
1786 if (tr%bc_plane_waves)
then
1793 safe_deallocate_a(rs_state)
batchified version of the BLAS axpy routine:
scale a batch by a constant or vector
There are several ways how to call batch_set_state and batch_get_state:
double sqrt(double __x) __attribute__((__nothrow__
subroutine, public accel_kernel_start_call(this, file_name, kernel_name, flags)
subroutine, public accel_finish()
pure logical function, public accel_is_enabled()
integer pure function, public accel_max_workgroup_size()
This module implements batches of mesh functions.
integer, parameter, public batch_not_packed
functions are stored in CPU memory, unpacked order
integer, parameter, public batch_device_packed
functions are stored in device memory in packed order
subroutine, public zbatch_init(this, dim, st_start, st_end, np, special, packed)
initialize a TYPE_CMPLX valued batch to given size without providing external memory
subroutine, public dbatch_init(this, dim, st_start, st_end, np, special, packed)
initialize a TYPE_FLOAT valued batch to given size without providing external memory
integer, parameter, public batch_packed
functions are stored in CPU memory, in transposed (packed) order
This module implements common operations on batches of mesh functions.
subroutine, public batch_split_complex(np, xx, yy, zz)
extract the real and imaginary parts of a complex batch
subroutine, public batch_set_zero(this, np, async)
fill all mesh functions of the batch with zero
This module implements a calculator for the density and defines related functions.
This module calculates the derivatives (gradients, Laplacians, etc.) of a function.
subroutine, public dderivatives_curl(der, ff, op_ff, ghost_update, set_bc)
apply the curl operator to a vector of mesh functions
subroutine, public zderivatives_batch_grad(der, ffb, opffb, ghost_update, set_bc, to_cartesian, factor)
apply the gradient to a batch of mesh functions
subroutine, public zderivatives_grad(der, ff, op_ff, ghost_update, set_bc, to_cartesian)
apply the gradient to a mesh function
subroutine, public energy_density_calc(mesh, st, rs_field, energy_dens, e_energy_dens, b_energy_dens, plane_waves_check, rs_field_plane_waves, energy_dens_plane_waves)
subroutine, public exponential_init(te, namespace, full_batch)
subroutine, public external_waves_eval(external_waves, time, mesh, type_of_field, out_field_total, der)
Calculation of external waves from parsed formula.
subroutine, public external_waves_init(external_waves, namespace)
Here, plane wave is evaluated from analytical formulae on grid.
Fast Fourier Transform module. This module provides a single interface that works with different FFT ...
real(real64), parameter, public m_two
real(real64), parameter, public m_zero
real(real64), parameter, public m_four
real(real64), parameter, public m_pi
some mathematical constants
real(real64), parameter, public m_fourth
real(real64), parameter, public p_mu
real(real64), parameter, public p_ep
complex(real64), parameter, public m_z0
complex(real64), parameter, public m_zi
real(real64), parameter, public m_epsilon
real(real64), parameter, public m_half
real(real64), parameter, public p_c
Electron gyromagnetic ratio, see Phys. Rev. Lett. 130, 071801 (2023)
real(real64), parameter, public m_one
real(real64), parameter, public m_three
This module implements the underlying real-space grid.
subroutine, public hamiltonian_mxll_apply_simple(hm, namespace, mesh, psib, hpsib, terms, set_bc)
subroutine, public mxll_update_pml_simple(hm, rs_stateb)
integer, parameter, public faraday_ampere_medium
subroutine, public hamiltonian_mxll_update(this, time)
Maxwell Hamiltonian update (here only the time is updated, can maybe be added to another routine)
subroutine, public mxll_copy_pml_simple(hm, rs_stateb)
The Helmholtz decomposition is intended to contain "only mathematical" functions and procedures to co...
This module implements the index, used for the mesh points.
This module is intended to contain "only mathematical" functions and procedures.
pure real(real64) function, dimension(1:3), public dcross_product(a, b)
integer, parameter, public mxll_bc_mirror_pmc
integer, parameter, public mxll_bc_mirror_pec
integer, parameter, public mxll_bc_plane_waves
integer, parameter, public mxll_bc_medium
subroutine, public bc_mxll_generate_pml_parameters(bc, space, gr, c_factor, dt)
integer, parameter, public mxll_bc_constant
integer, parameter, public mxll_bc_zero
This module defines functions over batches of mesh functions.
subroutine, public zmesh_batch_dotp_vector(mesh, aa, bb, dot, reduce, cproduct)
calculate the vector of dot-products of mesh functions between two batches
subroutine, public dmesh_batch_dotp_vector(mesh, aa, bb, dot, reduce, cproduct)
calculate the vector of dot-products of mesh functions between two batches
This module defines various routines, operating on mesh functions.
This module defines the meshes, which are used in Octopus.
subroutine, public messages_print_with_emphasis(msg, iunit, namespace)
character(len=256), dimension(max_lines), public message
to be output by fatal, warning
subroutine, public messages_fatal(no_lines, only_root_writes, namespace)
this module contains the output system
Some general things and nomenclature:
integer function, public parse_block(namespace, name, blk, check_varinfo_)
subroutine, public dpoisson_solve(this, namespace, pot, rho, all_nodes, kernel, reset)
Calculates the Poisson equation. Given the density returns the corresponding potential.
subroutine, public profiling_out(label)
Increment out counter and sum up difference between entry and exit time.
subroutine, public profiling_in(label, exclude)
Increment in counter and save entry time.
subroutine, public mirror_pec_boundaries_calculation(bc, st, rs_state)
subroutine td_function_mxll_init(st, namespace, hm)
subroutine, public mxll_propagate_expgauss2(hm, namespace, gr, space, st, tr, time, dt)
Exponential propagation scheme with Gauss collocation points, s=2.
subroutine, public energy_mxll_calc_batch(gr, st, hm, energy_mxll, rs_fieldb, rs_field_plane_wavesb)
subroutine, public calculate_matter_longitudinal_field(gr_mxll, st_mxll, hm_mxll, gr_elec, st_elec, hm_elec, rs_state_matter)
subroutine plane_waves_propagation(hm, tr, namespace, st, gr, time, dt, time_delay)
subroutine cpml_conv_function_update(hm, gr, ff_rs_state_pmlb)
subroutine transform_rs_state_batch(hm, gr, st, rs_stateb, ff_rs_stateb, sign)
subroutine, public mxll_propagate_leapfrog(hm, namespace, gr, space, st, tr, time, dt, counter)
subroutine, public mxll_propagate_expgauss1(hm, namespace, gr, space, st, tr, time, dt)
Exponential propagation scheme with Gauss collocation points, s=1.
subroutine, public constant_boundaries_calculation(constant_calc, bc, hm, st, rs_state)
subroutine, public mask_absorbing_boundaries(namespace, gr, hm, st, tr, time, dt, time_delay, rs_state)
subroutine, public calculate_vector_potential(namespace, poisson_solver, gr, st, field, vector_potential)
subroutine pml_propagation_stage_2_batch(hm, namespace, gr, st, tr, time, dt, time_delay, ff_rs_state_pmlb, ff_rs_stateb)
subroutine, public mxll_propagation_step(hm, namespace, gr, space, st, tr, rs_stateb, ff_rs_inhom_t1, ff_rs_inhom_t2, time, dt)
subroutine, public plane_waves_boundaries_calculation(hm, st, mesh, time, time_delay, rs_state)
subroutine, public get_vector_pot_and_transverse_field(namespace, trans_calc_method, gr_mxll, hm_mxll, st_mxll, tr_mxll, hm, st, poisson_solver, helmholtz, time, field, transverse_field, vector_potential)
subroutine, public spatial_constant_calculation(constant_calc, st, gr, hm, time, dt, delay, rs_state, set_initial_state)
subroutine, public set_medium_rs_state(st, gr, hm)
subroutine cpml_conv_function_update_via_riemann_silberstein(hm, gr, ff_rs_state_pmlb)
subroutine maxwell_mask(hm, rs_state)
integer, parameter mxwll_etrs_const
subroutine, public transform_rs_densities(hm, mesh, rs_charge_density, rs_current_density, ff_density, sign)
subroutine, public plane_waves_in_box_calculation(bc, time, space, mesh, der, st, rs_state)
subroutine, public energy_mxll_calc(gr, st, hm, energy_mxll, rs_field, rs_field_plane_waves)
integer, parameter, public rs_trans_backward
subroutine, public mirror_pmc_boundaries_calculation(bc, st, rs_state)
subroutine, public mxll_apply_boundaries(tr, st, hm, gr, namespace, time, dt, rs_stateb)
subroutine pml_propagation_stage_1_batch(hm, gr, st, tr, ff_rs_stateb, ff_rs_state_pmlb)
subroutine, public propagator_mxll_init(gr, namespace, st, hm, tr)
subroutine transform_rs_densities_to_6x6_rs_densities_backward(mesh, rs_density_6x6, rs_charge_density, rs_current_density)
subroutine transform_rs_densities_to_6x6_rs_densities_forward(mesh, rs_charge_density, rs_current_density, rs_density_6x6)
This module defines the quantity_t class and the IDs for quantities, which can be exposed by a system...
subroutine, public mxll_set_batch(rs_stateb, rs_state, np, dim, offset)
subroutine, public get_electric_field_vector(rs_state_vector, electric_field_vector, ep_element)
subroutine, public build_rs_vector(e_vector, b_vector, rs_sign, rs_vector, ep_element, mu_element)
subroutine, public mxll_get_batch(rs_stateb, rs_state, np, dim, offset)
subroutine, public build_rs_state(e_field, b_field, rs_sign, rs_state, mesh, ep_field, mu_field, np)
subroutine, public get_magnetic_field_state(rs_state, mesh, rs_sign, magnetic_field, mu_field, np)
subroutine, public get_magnetic_field_vector(rs_state_vector, rs_sign, magnetic_field_vector, mu_element)
subroutine, public tdf_read(f, namespace, function_name, ierr)
This function initializes "f" from the TDFunctions block.
Class defining batches of mesh functions.
class representing derivatives
Description of the grid, containing information on derivatives, stencil, and symmetries.
Describes mesh distribution to nodes.
The states_elec_t class contains all electronic wave functions.