def write(self, path: Union[(str, os.PathLike)], overwrite: bool=False, format: Literal[('grd', '2dm', 'msh', 'vtk')]='grd') -> None:
    "Export the mesh object to the disk\n\n        Parameters\n        ----------\n        path : path-like\n            Path to which the mesh should be exported.\n        overwrite : bool, default=False\n            Whether to overwrite, if a file already exists in `path`\n        format : { 'grd', '2dm', 'msh', 'vtk' }\n            Format of the export, SMS-2DM or GRD.\n\n        Returns\n        -------\n        None\n\n        Raises\n        ------\n        ValueError\n            If specified export format is **not** supported.\n        "
    path = pathlib.Path(path)
    if (path.exists() and (overwrite is not True)):
        raise IOError(f'File {str(path)} exists and overwrite is not True.')
    if (format == 'grd'):
        grd_dict = utils.msh_t_to_grd(self.msh_t)
        if (self._boundaries and self._boundaries.data):
            grd_dict.update(boundaries=self._boundaries.data)
        grd.write(grd_dict, path, overwrite)
    elif (format == '2dm'):
        sms2dm.writer(utils.msh_t_to_2dm(self.msh_t), path, overwrite)
    elif (format == 'msh'):
        savemsh(str(path), self.msh_t)
    elif (format == 'vtk'):
        savevtk(str(path), self.msh_t)
    else:
        raise ValueError(f'Unhandled format {format}.')
Export the mesh object to the disk

Parameters
----------
path : path-like
    Path to which the mesh should be exported.
overwrite : bool, default=False
    Whether to overwrite, if a file already exists in `path`
format : { 'grd', '2dm', 'msh', 'vtk' }
    Format of the export, SMS-2DM or GRD.

Returns
-------
None

Raises
------
ValueError
    If specified export format is **not** supported.
def write(self, path: Union[(str, os.PathLike)], overwrite: bool=False, format: Literal[('grd', '2dm', 'msh', 'vtk')]='grd') -> None:
    "Export the mesh object to the disk\n\n        Parameters\n        ----------\n        path : path-like\n            Path to which the mesh should be exported.\n        overwrite : bool, default=False\n            Whether to overwrite, if a file already exists in `path`\n        format : { 'grd', '2dm', 'msh', 'vtk' }\n            Format of the export, SMS-2DM or GRD.\n\n        Returns\n        -------\n        None\n\n        Raises\n        ------\n        ValueError\n            If specified export format is **not** supported.\n        "
    path = pathlib.Path(path)
    if (path.exists() and (overwrite is not True)):
        raise IOError(f'File {str(path)} exists and overwrite is not True.')
    if (format == 'grd'):
        grd_dict = utils.msh_t_to_grd(self.msh_t)
        if (self._boundaries and self._boundaries.data):
            grd_dict.update(boundaries=self._boundaries.data)
        grd.write(grd_dict, path, overwrite)
    elif (format == '2dm'):
        sms2dm.writer(utils.msh_t_to_2dm(self.msh_t), path, overwrite)
    elif (format == 'msh'):
        savemsh(str(path), self.msh_t)
    elif (format == 'vtk'):
        savevtk(str(path), self.msh_t)
    else:
        raise ValueError(f'Unhandled format {format}.')