# snippet_start calc_mode
# ----- Calculation mode and parallelization ------------------------------------------------------

 CalculationMode   = td
 RestartWrite = no
 ExperimentalFeatures = yes
 FromScratch = yes
#snippet_end

# snippet_start systems
%Systems
  'Maxwell' | maxwell
%

 Maxwell.ParDomains = auto
 Maxwell.ParStates  = no
# snippet_end

# snippet_start box
# ----- Maxwell box variables ---------------------------------------------------------------------

 # free maxwell box limit of 10.0 plus 2.0 for the incident wave boundaries with
 # der_order = 4 times dx_mx

 lsize_mx = 12.0
 dx_mx         = 0.5 0.85

 Maxwell.BoxShape   = parallelepiped

 %Maxwell.Lsize
  lsize_mx | lsize_mx | lsize_mx
 %

 %Maxwell.Spacing
  dx_mx | dx_mx | dx_mx
 %
# snippet_end


# ----- Maxwell calculation variables -------------------------------------------------------------

 MaxwellHamiltonianOperator = faraday_ampere

# snippet_start boundaries
 %MaxwellBoundaryConditions
  plane_waves | plane_waves | plane_waves
 %

 %MaxwellAbsorbingBoundaries
  not_absorbing | not_absorbing | not_absorbing
 %
# snippet_end

# snippet_start output
# ----- Output variables --------------------------------------------------------------------------

 OutputFormat = plane_x + plane_y + plane_z + vtk + axis_x

# ----- Maxwell output variables ------------------------------------------------------------------

 %MaxwellOutput
  electric_field
  magnetic_field
  maxwell_energy_density
  poynting_vector | plane_z
  orbital_angular_momentum | plane_z
 %

 %MaxwellFieldsCoordinate
   0.00 | 0.00 | 0.00
   0.00 | 0.00 | -5.00
   0.00 | 0.00 | 5.00
 %

 MaxwellOutputInterval = 50
 MaxwellTDOutput       = maxwell_energy + maxwell_total_e_field + maxwell_total_b_field + maxwell_transverse_e_field + maxwell_transverse_b_field

# snippet_end


# snippet_start timestep
# ----- Time step variables -----------------------------------------------------------------------

 TDSystemPropagator = prop_expmid
 TDTimeStep                        = 0.002
 TDPropagationTime                 = 0.35
# snippet_end

# snippet_start field
# ----- Maxwell field variables -------------------------------------------------------------------

 lambda = 10.0
 omega  = 2 * pi * c / lambda
 kx     = omega / c
 Ez     = 0.05
 pw     = 10.0
 p_s     = - 5 * 5.0

 %MaxwellIncidentWaves
   plane_wave_mx_function | electric_field | 0 | 0 | Ez | "plane_waves_function"
 %

 %MaxwellFunctions
   "plane_waves_function" | mxf_cosinoidal_wave | kx | 0 | 0 | p_s | 0 | 0 | pw
 %
# snippet_end
