(self, filename)
return mesh_points
Method to parse the file `filename`. It returns a matrix with all the
        coordinates. It reads only the section *NODE of the k files.

        :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 *NODE of the k files.
Method to parse the file filename . It returns a matrix with all the coordinates . It reads only the section * NODE of the k files .
def parse(self, filename):
        """
        Method to parse the file `filename`. It returns a matrix with all the
        coordinates. It reads only the section *NODE of the k files.

        :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

        mesh_points = []
        node_indicator = False

        with open(self.infile, 'r') as input_file:
            for num, line in enumerate(input_file):

                expression = re.compile(r'(.+?)(?:,|$)')
                expression = expression.findall(line)

                if line.startswith("$"):
                    continue

                if line.startswith('*NODE'):
                    node_indicator = True
                    continue

                if line.startswith('*ELEMENT'):
                    break

                if not node_indicator:
                    pass
                else:
                    if len(expression) == 1:
                        expression = re.findall(r'\S+', expression[0])
                    l = [float(expression[1]), float(expression[2]),
                         float(expression[3])]
                    mesh_points.append(l)

            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 mesh_points = [ ] node_indicator = False with open ( self . infile , 'r' ) as input_file : for num , line in enumerate ( input_file ) : expression = re . compile ( r'(.+?)(?:,|$)' ) expression = expression . findall ( line ) if line . startswith ( "$" ) : continue if line . startswith ( '*NODE' ) : node_indicator = True continue if line . startswith ( '*ELEMENT' ) : break if not node_indicator : pass else : if len ( expression ) == 1 : expression = re . findall ( r'\S+' , expression [ 0 ] ) l = [ float ( expression [ 1 ] ) , float ( expression [ 2 ] ) , float ( expression [ 3 ] ) ] mesh_points . append ( l ) mesh_points = np . array ( mesh_points ) return mesh_points