gplugins.gmsh.uz_xsection_mesh

gplugins.gmsh.uz_xsection_mesh#

gplugins.gmsh.uz_xsection_mesh(component: Component | ComponentReference, xsection_bounds: tuple[tuple[float, float], tuple[float, 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: Sequence[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, round_tol: int = 4, simplify_tol: float = 0.0001, u_offset: float = 0.0, left_right_periodic_bcs: bool = False, verbosity: int | None = 0, n_threads: int = 4, gmsh_version: float | None = None, interface_delimiter: str = '___', background_remeshing_file=None, optimization_flags: tuple[tuple[str, int]] | None = None, **kwargs)[source]#

Mesh uz cross-section of component along line u = [[x1,y1] , [x2,y2]].

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

  • xsection_bounds (Tuple) – Tuple [[x1,y1] , [x2,y2]] parametrizing the line u

  • 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)

  • u_offset – quantity to add to the “u” coordinates, useful to convert back to x or y if parallel to those axes

  • atol – tolerance used to establish equivalency between vertices

  • left_right_periodic_bcs – if True, makes the left and right simulation edge meshes periodic

  • background_remeshing_file – .pos file to use as a remeshing field. Overrides resolutions if not None.