feec.polar.examples.maxwell_2d#
Solve the 2D transverse-electric time-dependent Maxwell problem on a disk.
This file is not meant to be imported as a standard module, but rather run as
a script, either serially or in parallel. Typing python maxwell_2d.py -h
shows all the available command-line options. Here is an example command for
running a parallel simulation with 6 MPI processes:
mpirun -n 6 python maxwell_2d.py -S -n 16 32 -d 3 3 -T 1 -D 0.2 -s 1
Functions#
|
Compute stable time step for a leap-frog Maxwell solver, given the (discrete) primal and dual curl operators |
|
|
|
|
|
|
|
Classes#

|
Analytical TE Maxwell model on a mapped polar disk. |
Details#
Solve the 2D transverse-electric time-dependent Maxwell problem on a disk.
This file is not meant to be imported as a standard module, but rather run as
a script, either serially or in parallel. Typing python maxwell_2d.py -h
shows all the available command-line options. Here is an example command for
running a parallel simulation with 6 MPI processes:
mpirun -n 6 python maxwell_2d.py -S -n 16 32 -d 3 3 -T 1 -D 0.2 -s 1
- class Maxwell2D(domain_log, mapping, exact_solution)[source]#
Bases:
PolarModel2DAnalytical TE Maxwell model on a mapped polar disk.
- property exact_solution#
- compute_stable_dt(cfl, C_m, dC_m, V, tau=None, light_c=1.0, comm=None)[source]#
Compute stable time step for a leap-frog Maxwell solver, given the (discrete) primal and dual curl operators
- Parameters:
- cfl: float
Stability factor (1 to choose the maximum stable dt).
- C_m: LinearOperator
(primal) curl V -> dV.
- dC_m: LinearOperator
(dual) curl dV -> V.
- V: FEMSpace
Finite element space.
- tau: float, optional
Time to solve with an integer number of time steps.
- light_c: float, default = 1.0
Speed of light, i.e. the parameter c in Maxwell’s equations.
- comm: mpi4py.MPI.Comm, optional
If given, only the “root” MPI process with rank=0 will print to std out.
- Returns:
- Nt_per_tau: int
Integer number of time steps (>0) in simulation.
- dt: float
Stable time step size (>0).
- norm_op: float
Operator norm (>0) of the time evolution matrix which computes the solution vector at time t+∆t given the solution vector at time t.
- plot_curve_along_s(name, s_str, time_str, theta0, s, curve_h, curve_ref=None, left_s=None, left_curve_h=None, left_curve_ref=None)[source]#