gplugins.gmsh.xy_xsection_mesh

gplugins.gmsh.xy_xsection_mesh#

gplugins.gmsh.xy_xsection_mesh(component: Component | ComponentReference, z: float, layer_stack: LayerStack, layer_physical_map: dict, layer_meshbool_map: dict, resolutions: dict | None = None, default_characteristic_length: float = 0.5, background_tag: str | None = None, background_padding: tuple[float, float, float, float, float, float] = (2.0, 2.0, 2.0, 2.0, 2.0, 2.0), background_mesh_order: int | float = 9223372036854775807, global_scaling: float = 1, global_scaling_premesh: float = 1, global_2D_algorithm: int = 6, filename: str | None = None, verbosity: int | None = 0, round_tol: int = 3, simplify_tol: float = 0.001, n_threads: int = 4, port_names: list[str] | None = None, gmsh_version: float | None = None, interface_delimiter: str = '___', layer_port_delimiter: str | None = None, background_remeshing_file=None, optimization_flags: tuple[tuple[str, int]] | None = None, **kwargs)[source]#

Mesh xy cross-section of component at height z.

Parameters:
  • component (Component) – gdsfactory component to mesh

  • z (float) – z-coordinate at which to sample the LayerStack

  • layer_stack (LayerStack) – gdsfactory LayerStack to parse

  • layer_physical_map – map layer names to physical names

  • layer_meshbool_map – map layer names to mesh_bool (True: mesh the prisms, False: don’t mesh)

  • resolutions (Dict) – Pairs {“layername”: {“resolution”: float, “distance”: “float}} to roughly control mesh refinement

  • 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

  • background_mesh_order (int, float) – mesh order to assign to the background

  • filename (str, path) – where to save the .msh file

  • 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] = OrderedDict of {key: geo} with key a label and geo a shapely (Multi)Polygon or (Multi)LineString of extra shapes to override component

  • round_tol – during gds –> mesh conversion cleanup, number of decimal points at which to round the gdsfactory/shapely points before introducing to gmsh

  • simplify_tol – during gds –> mesh conversion cleanup, shapely “simplify” tolerance (make it so all points are at least separated by this amount)

  • atol – tolerance used to establish equivalency between vertices

  • layer_port_delimiter – Delimiter to use for new layers generated for ports: “layer{delimiter}port_name”.