pytheas
.Periodic2D¶
-
class
pytheas.
Periodic2D
(analysis='direct', pola='TE', A=1, lambda0=1, lambda_mesh=1, theta_deg=0, d=0.8, h_sup=1, h_sub=1, h_layer1=0.1, h_layer2=0.1, h_des=1.0, h_pmltop=1.0, h_pmlbot=1.0, a_pml=1, b_pml=1, eps_sup=(1+0j), eps_sub=(1+0j), eps_layer1=(1+0j), eps_layer2=(1+0j), eps_des=(1+0j), eps_incl=(1+0j), mu_incl=(1+0j), mu_des=(1+0j))[source]¶ A class for a finite element model of a 2D mono-periodic medium.
The model consist of a single unit cell with quasi-periodic boundary conditions in the \(x\) direction enclosed with perfectly matched layers (PMLs) in the \(y\) direction to truncate the semi infinite media. From top to bottom:
PML top
superstrate (incident medium)
layer 2
design layer: this is the layer containing the periodic pattern, can be continuous or discrete
layer 1
substrate
PML bottom
- Parameters
analysis (str, default "direct") – Analysis type: either “direct” (plane wave) or “modal” (spectral problem)
pola (str, default "TE") – Polarization case: either “TE” (E along z) or “TM” (H along z)
A (float, default 1) – Incident plane wave amplitude
lambda0 (float, default 1) – Incident plane wave wavelength in free space
lambda_mesh (float, default 1) – Wavelength to use for meshing
theta_deg (float, default 0) – Incident plane wave angle (in degrees). Light comes from the top (travels along -y if normal incidence,
theta_deg=0
is set)d (float, default 0.8) – Periodicity
h_sup (float, default 1) – Thickness superstrate
h_sub (float, default 1) – Thickness substrate
h_layer1 (float, default 0.1) – Thickness layer 1
h_layer2 (float, default 0.1) – Thickness layer 2
h_des (float, default 1) – Thickness layer design
h_pmltop (float, default 1) – Thickness pml top
h_pmlbot (float, default 1) – Thickness pml bot
a_pml (float, default 1) – PMLs complex y-stretching parameter, real part
b_pml (float, default 1) – PMLs complex y-stretching parameter, imaginary part
eps_sup (complex, default (1 - 0 * 1j)) – Permittivity superstrate
eps_sub (complex, default (1 - 0 * 1j)) – Permittivity substrate
eps_layer1 (complex, default (1 - 0 * 1j)) – Permittivity layer 1
eps_layer2 (complex, default (1 - 0 * 1j)) – Permittivity layer 2
eps_des (complex, default (1 - 0 * 1j)) – Permittivity layer design
eps_incl (complex, default (1 - 0 * 1j)) – Permittivity inclusion
-
cleanup
()¶ Remove gmsh/getdp/python generated files from the temporary folder
-
diffraction_efficiencies
(cplx_effs=False, orders=False)[source]¶ Postprocess diffraction efficiencies.
- Parameters
cplx_effs (bool) – If True, return complex coefficients (amplitude reflection and transmission). If False, return real coefficients (power reflection and transmission)
orders (bool) – If True, computes the transmission and reflection for all the propagating diffraction orders. If False, returns the sum of all the propagating diffraction orders.
- Returns
A dictionary containing the diffraction efficiencies.
- Return type
-
get_field_map
(name)[source]¶ Retrieve a field map.
- Parameters
name (str) – Choose between “u” (scattered field), “u_tot” (total field)
- Returns
A 2D complex array of shape (Nix, Niy)
- Return type
array
-
initialize
()¶ Initialize the problem parameters.
-
make_inclusion
(points, lcar='lc_incl', **kwargs)¶ Make a diffractive element geometry from points.
-
make_mesh
(other_option=None)¶ Mesh the geometry using gmsh.
-
mk_tmp_dir
()¶ Create a temporary directory
-
open_gmsh_gui
(pos_list=None)¶ Open gmsh GUI to visualize geometry and postprocessing results.
- Parameters
pos_list (list) – A list of .pos files giving the views to load. By default it will render all the generated views.
-
postpro_absorption
()[source]¶ Compute the absorption coefficient
- Returns
Q – Absorption coefficient
- Return type
-
postpro_fields
(filetype='txt', postop='postop_fields')¶ Compute the field maps and output to a file.
-
postprocess
(postop)¶ Run getdp postoperation.
- Parameters
postop (str) – Name of the postoperation to run.
-
rm_tmp_dir
()¶ Remove the temporary directory
-
update_params
()¶ Update the dictionary of parameters and the corresponding file