(  # noqa: C901
        self,
        dim: int = 3,
        order: int | None = None,
        # http://gmsh.info/doc/texinfo/gmsh.html#index-Mesh_002eAlgorithm
        algorithm: int | None = None,
        verbose: bool = False,
    )
return extract_to_meshio()
Return a meshio.Mesh, storing the mesh points, cells, and data, generated by
        Gmsh from the `self`.
Return a meshio.Mesh, storing the mesh points, cells, and data, generated by
        Gmsh from the `self`.
Return a meshio . Mesh storing the mesh points cells and data generated by Gmsh from the self .
def generate_mesh(  # noqa: C901
        self,
        dim: int = 3,
        order: int | None = None,
        # http://gmsh.info/doc/texinfo/gmsh.html#index-Mesh_002eAlgorithm
        algorithm: int | None = None,
        verbose: bool = False,
    ):
        """Return a meshio.Mesh, storing the mesh points, cells, and data, generated by
        Gmsh from the `self`.
        """
        self.synchronize()

        for item in self._AFTER_SYNC_QUEUE:
            item.exec()

        for item, host in self._EMBED_QUEUE:
            gmsh.model.mesh.embed(item.dim, [item._id], host.dim, host._id)

        # set compound entities after sync
        for c in self._COMPOUND_ENTITIES:
            gmsh.model.mesh.setCompound(*c)

        for s in self._RECOMBINE_ENTITIES:
            gmsh.model.mesh.setRecombine(*s)

        for t in self._TRANSFINITE_CURVE_QUEUE:
            gmsh.model.mesh.setTransfiniteCurve(*t)

        for t in self._TRANSFINITE_SURFACE_QUEUE:
            gmsh.model.mesh.setTransfiniteSurface(*t)

        for e in self._TRANSFINITE_VOLUME_QUEUE:
            gmsh.model.mesh.setTransfiniteVolume(*e)

        for item, size in self._SIZE_QUEUE:
            gmsh.model.mesh.setSize(
                gmsh.model.getBoundary(item.dim_tags, False, False, True), size
            )

        for entities, label in self._PHYSICAL_QUEUE:
            d = entities[0].dim
            assert all(e.dim == d for e in entities)
            tag = gmsh.model.addPhysicalGroup(d, [e._id for e in entities])
            if label is not None:
                gmsh.model.setPhysicalName(d, tag, label)

        for entity in self._OUTWARD_NORMALS:
            gmsh.model.mesh.setOutwardOrientation(entity.id)

        if order is not None:
            gmsh.model.mesh.setOrder(order)

        gmsh.option.setNumber("General.Terminal", 1 if verbose else 0)

        # set algorithm
        # http://gmsh.info/doc/texinfo/gmsh.html#index-Mesh_002eAlgorithm
        if algorithm:
            gmsh.option.setNumber("Mesh.Algorithm", algorithm)

        gmsh.model.mesh.generate(dim)

        return extract_to_meshio()
def generate_mesh ( # noqa: C901 self , dim : int = 3 , order : int | None = None , # http://gmsh.info/doc/texinfo/gmsh.html#index-Mesh_002eAlgorithm algorithm : int | None = None , verbose : bool = False , ) : self . synchronize ( ) for item in self . _AFTER_SYNC_QUEUE : item . exec ( ) for item , host in self . _EMBED_QUEUE : gmsh . model . mesh . embed ( item . dim , [ item . _id ] , host . dim , host . _id ) # set compound entities after sync for c in self . _COMPOUND_ENTITIES : gmsh . model . mesh . setCompound ( * c ) for s in self . _RECOMBINE_ENTITIES : gmsh . model . mesh . setRecombine ( * s ) for t in self . _TRANSFINITE_CURVE_QUEUE : gmsh . model . mesh . setTransfiniteCurve ( * t ) for t in self . _TRANSFINITE_SURFACE_QUEUE : gmsh . model . mesh . setTransfiniteSurface ( * t ) for e in self . _TRANSFINITE_VOLUME_QUEUE : gmsh . model . mesh . setTransfiniteVolume ( * e ) for item , size in self . _SIZE_QUEUE : gmsh . model . mesh . setSize ( gmsh . model . getBoundary ( item . dim_tags , False , False , True ) , size ) for entities , label in self . _PHYSICAL_QUEUE : d = entities [ 0 ] . dim assert all ( e . dim == d for e in entities ) tag = gmsh . model . addPhysicalGroup ( d , [ e . _id for e in entities ] ) if label is not None : gmsh . model . setPhysicalName ( d , tag , label ) for entity in self . _OUTWARD_NORMALS : gmsh . model . mesh . setOutwardOrientation ( entity . id ) if order is not None : gmsh . model . mesh . setOrder ( order ) gmsh . option . setNumber ( "General.Terminal" , 1 if verbose else 0 ) # set algorithm # http://gmsh.info/doc/texinfo/gmsh.html#index-Mesh_002eAlgorithm if algorithm : gmsh . option . setNumber ( "Mesh.Algorithm" , algorithm ) gmsh . model . mesh . generate ( dim ) return extract_to_meshio ( )