Layered#
- class gyptis.Layered(dim, period, thicknesses, **kwargs)[source]#
Layered media for diffraction problems, defining the periodic unit cell for mono or bi periodic gratings.
- Parameters:
dim (int) – Geometric dimension (either 2 or 3, the default is 3).
period (float or tuple) – In 2D, periodicity of the grating \(d\) along \(x\) (float). In 3D, periodicity of the grating \((d_x,d_y)\) along \(x\) and \(y\) (tuple of floats of lenght 2).
thicknesses (
OrderedDict
) – Dictionary containing physical names and thicknesses from top to bottom. (thicknesses["phyiscal_name"]=thickness_value
)**kwargs (dictionary) – Additional parameters. See the parent class
Geometry
.
Examples
>>> from collections import OrderedDict >>> from gyptis import Layered >>> t = OrderedDict(pml_top=1, slab=3, pml_bot=1) >>> lays = Layered(dim=2, period=1.3, thicknesses=t) >>> lays.build()
- add_physical(idf, name, dim=None)#
Add a physical domain.
- add_polygon(vertices, surface=True, mesh_size=0.0, **kwargs)#
Adds a polygon.
- add_spline(points, mesh_size=0.0, surface=True, **kwargs)#
Adds a spline.
- build(interactive=False, generate_mesh=True, write_mesh=True, read_info=True, read_mesh=True, finalize=True, check_subdomains=True)#
Build the geometry.
- Parameters:
interactive (bool) – Open
gmsh
GUI? (the default is False).generate_mesh (type) – Mesh with
gmsh
? (the default is True).write_mesh (type) – Write mesh to disk? (the default is True).
read_info (type) – Read subdomain markers information? (the default is True).
read_mesh (type) – Read mesh information? (the default is True).
finalize (type) – Finalize
gmsh
API? (the default is True).check_subdomains (type) – Sanity check of subdomains names? (the default is True).
- Returns:
A dictionary containing the mesh and markers.
- Return type: