(self, filename)
return mesh_points
Method to parse the file `filename`. It returns a matrix with
        all the coordinates. It reads only the section 2411 of the unv
        files and it assumes there are only triangles.

        :param string filename: name of the input file.

        :return: mesh_points: it is a `n_points`-by-3 matrix containing
            the coordinates of the points of the mesh.
        :rtype: numpy.ndarray
Method to parse the file `filename`. It returns a matrix with
        all the coordinates. It reads only the section 2411 of the unv
        files and it assumes there are only triangles.
Method to parse the file filename . It returns a matrix with all the coordinates . It reads only the section 2411 of the unv files and it assumes there are only triangles .
def parse(self, filename):
        """
        Method to parse the file `filename`. It returns a matrix with
        all the coordinates. It reads only the section 2411 of the unv
        files and it assumes there are only triangles.

        :param string filename: name of the input file.

        :return: mesh_points: it is a `n_points`-by-3 matrix containing
            the coordinates of the points of the mesh.
        :rtype: numpy.ndarray
        """
        self._check_filename_type(filename)
        self._check_extension(filename)

        self.infile = filename

        index = -9
        mesh_points = []
        with open(self.infile, 'r') as input_file:
            for num, line in enumerate(input_file):
                if line.startswith('  2411'):
                    index = num
                if num == index + 2:
                    if line.startswith('    -1'):
                        break
                    else:
                        line = line.replace('D', 'E')
                        l = []
                        for t in line.split():
                            try:
                                l.append(float(t))
                            except ValueError:
                                pass
                        mesh_points.append(l)
                        index = num
            mesh_points = np.array(mesh_points)

        return mesh_points
def parse ( self , filename ) : self . _check_filename_type ( filename ) self . _check_extension ( filename ) self . infile = filename index = - 9 mesh_points = [ ] with open ( self . infile , 'r' ) as input_file : for num , line in enumerate ( input_file ) : if line . startswith ( '  2411' ) : index = num if num == index + 2 : if line . startswith ( '    -1' ) : break else : line = line . replace ( 'D' , 'E' ) l = [ ] for t in line . split ( ) : try : l . append ( float ( t ) ) except ValueError : pass mesh_points . append ( l ) index = num mesh_points = np . array ( mesh_points ) return mesh_points