bluemira.mesh.tools =================== .. py:module:: bluemira.mesh.tools .. autoapi-nested-parse:: Converter from MSH to XDMF mesh file formats, derived from F. Loiseau, R. Delaporte-Mathurin, and C. Weickhmann's https://github.com/floiseau/msh2xdmf Credit: F. Loiseau, R. Delaporte-Mathurin, and C. Weickhmann Functions --------- .. autoapisummary:: bluemira.mesh.tools.msh_to_xdmf bluemira.mesh.tools.import_mesh Module Contents --------------- .. py:function:: msh_to_xdmf(mesh_name: str, dimensions: tuple[int, Ellipsis] | int = (0, 2), directory: str = '.') Convert a MSH file to an XMDF file. :param mesh_name: Name of the MSH file to convert to XDMF :type mesh_name: str :param dimensions: Dimensions of the mesh (0: x, 1: y, 2: z), defaults to x-z (0, 1, 2) would be a 3-D mesh :type dimensions: Union[Tuple[int], int] :param directory: Directory in which the MSH file exists and where the XDMF files will be written :type directory: str :raises MeshConversionError: * If the file does not exist * If the dimensionality != [2, 3] * If no domain physical groups are found .. rubric:: Notes Creates the following files: * DOMAIN_SUFFIX * BOUNDARY_SUFFIX * LINKFILE_SUFFIX .. py:function:: import_mesh(file_prefix: str = 'mesh', *, subdomains: bool = False, directory: str = '.') -> tuple[dolfinx.mesh.Mesh, dolfinx.mesh.Mesh, dolfinx.mesh.Mesh, dict] Import a Dolfinx v0.9 mesh and optional boundary/subdomain tags. :param file_prefix: File prefix for the mesh (defaults to 'mesh') :param subdomains: Whether subdomains are present (defaults to False) :param directory: Directory containing the mesh and tag files :returns: * *mesh* -- Dolfin Mesh object containing the domain * *boundaries_mf* -- Dolfin MeshFunctionSizet object containing the boundaries * *subdomains_mf* -- Dolfin MeshFunctionSizet object containing the subdomains * *link_dict* -- Link dictionary between MSH and XDMF objects :raises FileNotFoundError: If required mesh files are missing