(self, V, E, degree=1)
Initialize mesh.

        Parameters
        ----------
        V : ndarray
            nv x 2 list of coordinates

        E : ndarray
            ne x 3 list of vertices
Initialize mesh.
Initialize mesh .
def __init__(self, V, E, degree=1):
        """Initialize mesh.

        Parameters
        ----------
        V : ndarray
            nv x 2 list of coordinates

        E : ndarray
            ne x 3 list of vertices
        """
        # check to see if E is numbered 0 ... nv
        ids = np.full((E.max()+1,), False)
        ids[E.ravel()] = True
        nv = np.sum(ids)
        if V.shape[0] != nv:
            print('fixing V and E')
            I = np.where(ids)[0]
            J = np.arange(E.max()+1)
            J[I] = np.arange(nv)
            E = J[E]
            V = V[I, :]

        if not check_mesh(V, E):
            raise ValueError('triangles must be counter clockwise')

        self.V = V
        self.E = E
        self.X = V[:, 0]
        self.Y = V[:, 1]
        self.degree = degree

        self.nv = nv
        self.ne = E.shape[0]

        self.h = diameter(V, E)

        self.V2 = None
        self.E2 = None
        self.Edges = None
        self.newID = None

        if degree == 2:
            self.generate_quadratic()
def __init__ ( self , V , E , degree = 1 ) : # check to see if E is numbered 0 ... nv ids = np . full ( ( E . max ( ) + 1 , ) , False ) ids [ E . ravel ( ) ] = True nv = np . sum ( ids ) if V . shape [ 0 ] != nv : print ( 'fixing V and E' ) I = np . where ( ids ) [ 0 ] J = np . arange ( E . max ( ) + 1 ) J [ I ] = np . arange ( nv ) E = J [ E ] V = V [ I , : ] if not check_mesh ( V , E ) : raise ValueError ( 'triangles must be counter clockwise' ) self . V = V self . E = E self . X = V [ : , 0 ] self . Y = V [ : , 1 ] self . degree = degree self . nv = nv self . ne = E . shape [ 0 ] self . h = diameter ( V , E ) self . V2 = None self . E2 = None self . Edges = None self . newID = None if degree == 2 : self . generate_quadratic ( )