# Path: openmodes/helpers.py
# class MeshError(Exception):
#     "An exeception indicating a failure generating or reading the mesh"
#     pass


import subprocess
import os.path as osp
import os
import struct
import numpy as np
import re
import logging
import tempfile
    import meshio
from collections import defaultdict
from openmodes.helpers import MeshError
    tolerance

    Parameters
    ----------
    filename : string
        the name of the file to be meshed
    dirname : string
        The location in which to create the mesh file
    mesh_tol : number, optional
        override the maximum mesh tolerance distance of all edges
    binary : boolean, optional
        (default True) output a binary file
    parameters : dictionary, optional
        A dictionary containing the values of geometric parameters to be
        modified within the gmsh geometry before meshing. Note that the
        geometry file must be written to check for these values, otherwise
        they will be overwritten if they are assigned within the geometry file

    Returns
    -------
    meshname : string
        the full path of the .msh file

    This routine instructs gmsh to use algorithm 1 for 2D meshing, which seems
    to yield the most consistent and uniform mesh.
    """

    check_installed()

    if not osp.exists(filename):

# Path: openmodes/helpers.py
# class MeshError(Exception):
#     "An exeception indicating a failure generating or reading the mesh"
#     pass


# Path: openmodes/mesh/gmsh.py
import subprocess
import os.path as osp
import os
import struct
import numpy as np
import re
import logging
import tempfile
    import meshio
from collections import defaultdict
from openmodes.helpers import MeshError

    tolerance

    Parameters
    ----------
    filename : string
        the name of the file to be meshed
    dirname : string
        The location in which to create the mesh file
    mesh_tol : number, optional
        override the maximum mesh tolerance distance of all edges
    binary : boolean, optional
        (default True) output a binary file
    parameters : dictionary, optional
        A dictionary containing the values of geometric parameters to be
        modified within the gmsh geometry before meshing. Note that the
        geometry file must be written to check for these values, otherwise
        they will be overwritten if they are assigned within the geometry file

    Returns
    -------
    meshname : string
        the full path of the .msh file

    This routine instructs gmsh to use algorithm 1 for 2D meshing, which seems
    to yield the most consistent and uniform mesh.
    """

    check_installed()

    if not osp.exists(filename):

        raise MeshError("Geometry file %s not found" % filename)