gplugins.femwell.mode_solver.compute_cross_section_modes

gplugins.femwell.mode_solver.compute_cross_section_modes#

gplugins.femwell.mode_solver.compute_cross_section_modes(cross_section: Callable[[...], CrossSection] | CrossSection | SymmetricalCrossSection | dict[str, Any] | str, layer_stack: LayerStack, wavelength: float = 1.55, num_modes: int = 4, order: int = 1, radius: float = inf, wafer_padding: float = 2.0, **kwargs) Modes[source]#

Calculate effective index of a cross-section.

Defines a “straight” component of the cross_section, and calls compute_component_slice_modes.

Parameters:
  • cross_section

  • layer_stack

  • wavelength – in um.

  • num_modes – to compute.

  • order – order of the mesh elements. 1: linear, 2: quadratic.

  • radius – defaults to inf.

  • wafer_padding – in um.

Keyword Arguments:
  • solver – can be slepc or scipy.

  • resolutions (Dict) – Pairs {“layername”: {“resolution”: float, “distance”: “float}} to roughly control mesh refinement within and away from entity, respectively.

  • mesh_scaling_factor (float) – factor multiply mesh geometry by.

  • default_resolution_min (float) – gmsh minimal edge length.

  • default_resolution_max (float) – gmsh maximal edge length.

  • background_tag (str) – name of the background layer to add (default: no background added).

  • background_padding (Tuple) – [xleft, ydown, xright, yup] distances to add to the components and to fill with background_tag.

  • global_meshsize_array – np array [x,y,z,lc] to parametrize the mesh.

  • global_meshsize_interpolant_func – interpolating function for global_meshsize_array.

  • extra_shapes_dict – Optional[OrderedDict] of {key: geo} with key a label and geo a shapely (Multi)Polygon or (Multi)LineString of extra shapes to override component.

  • merge_by_material – boolean, if True will merge polygons from layers with the same layer.material. Physical keys will be material in this case.