pytheas.Scatt2D

class pytheas.Scatt2D[source]

A class for a finite element model of a 2D medium

A = None

incident plane wave amplitude

Type

flt

Ni_theta = None

number of theta points for computing the angular dependance of the modal coupling coefficients

Type

int

Nibox_x = None

number of x interpolation points on the design box

Type

int

Nibox_y = None

number of y interpolation points on the design box

Type

int

Nin2f_x = None

number of x interpolation points for near to far field calculations

Type

int

Nin2f_y = None

number of y interpolation points for near to far field calculations

Type

int

Nix = None

number of x points for postprocessing field maps

Type

int

a_pml = None

PMLs parameter, real part

Type

flt

analysis = None

analysys type (either “direct” or “modal”)

Type

str

b_pml = None

PMLs parameter, imaginary part

Type

flt

beam_flag = None

beam?

cleanup()

Remove gmsh/getdp/python generated files from the temporary folder

compute_solution(res_list=None)

Compute the solution of the FEM problem using getdp

dom_des = None

design domain number (check .geo/.pro files)

eps_des = None

permittivity scattering box

Type

flt

eps_host = None

permittivity host

Type

flt

eps_incl = None

permittivity inclusion

Type

flt

eps_sub = None

permittivity substrate

Type

flt

h_pml = None

thickness pml

Type

flt

hx_des = None

x - thickness scattering box (design)

Type

flt

hy_des = None

y - thickness scattering box

Type

flt

initialize()

Initialize the problem parameters.

lambda0 = None

incident plane wave wavelength in free space

Type

flt

lambda0search = None

wavelength around which to search eigenvalues

Type

flt

lambda_mesh = None

wavelength to use for meshing

Type

flt

ls_flag = None

line source position

make_inclusion(points, lcar='lc_incl', **kwargs)

Make a diffractive element geometry from points.

Parameters
  • points (array of size (Npoints, 2)) – The points defining the simply connected 2D geometry of the object.

  • lcar (str (default "lc_incl")) – Caracteristic length for the mesh.

  • **kwargs (dict) – Extra arguments.

make_mesh(other_option=None)

Mesh the geometry using gmsh.

Parameters

other_option (str) – Extra flag to pass to gmsh.

Returns

The content of the .msh file.

Return type

str

mk_tmp_dir()

Create a temporary directory

nb_slice = None

number of y slices points for postprocessing diffraction efficiencies

Type

int

neig = None

number of eigenvalues searched for in modal analysis

Type

int

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.

pola = None

polarisation of the incident plane wave (either “TE” or “TM”)

Type

str

postpro_fields(filetype='txt', postop='postop_fields')

Compute the field maps and output to a file.

Parameters
  • filetype (str, default "txt") – Type of output files. Either “txt” (to be read by the method get_field_map in python) or “pos” to be read by gmsh/getdp.

  • postop (str, default "postop_fields") – Name of the postoperation

postprocess(postop)

Run getdp postoperation.

Parameters

postop (str) – Name of the postoperation to run.

rm_tmp_dir()

Remove the temporary directory

scan_dist_ratio = None

such that scan_dist = min(h_sup, hsub)/scan_dist_ratio

Type

flt

theta_deg = None

incident plane wave angle (in degrees). Light comes from the top (travels along -y if normal incidence, theta_deg=0 is set)

Type

flt

update_params()

Update the dictionary of parameters and the corresponding file

xpp = None

coords of point for PostProcessing

ypp = None

coords of point for PostProcessing

Examples using pytheas.Scatt2D