(self, mesh_points, filename)
Writes a elmer file, called filename, copying all the
        lines from self.filename but the coordinates. mesh_points
        is a matrix that contains the new coordinates to write in
        the elmer file.

        :param numpy.ndarray mesh_points: it is a `n_points`-by-3
            matrix containing the coordinates of the points of the mesh.
        :param string filename: name of the output file.

        .. todo:: DOCS
Writes a elmer file, called filename, copying all the
        lines from self.filename but the coordinates. mesh_points
        is a matrix that contains the new coordinates to write in
        the elmer file.
Writes a elmer file called filename copying all the lines from self . filename but the coordinates . mesh_points is a matrix that contains the new coordinates to write in the elmer file .
def write(self, mesh_points, filename):
        """
        Writes a elmer file, called filename, copying all the
        lines from self.filename but the coordinates. mesh_points
        is a matrix that contains the new coordinates to write in
        the elmer file.

        :param numpy.ndarray mesh_points: it is a `n_points`-by-3
            matrix containing the coordinates of the points of the mesh.
        :param string filename: name of the output file.

        .. todo:: DOCS
        """
        self._check_filename_type(filename)
        self._check_extension(filename)
        self._check_infile_instantiation()
        self.outfile = filename

        n_points = mesh_points.shape[0]
        i = 0
        with open(self.infile, 'r') as input_file, open(self.outfile,
                                                        'w') as output_file:
            for line in input_file:
                numbers = line.split() #[n1 p x y z]

                output_file.write(numbers[0] + ' ' +numbers[1] + ' ' \
                    + str(mesh_points[i][0]) + ' ' + str(mesh_points[i][1]) \
                    + ' ' + str(mesh_points[i][2]))
                i += 1

                if i != n_points:
                    output_file.write('\n')
def write ( self , mesh_points , filename ) : self . _check_filename_type ( filename ) self . _check_extension ( filename ) self . _check_infile_instantiation ( ) self . outfile = filename n_points = mesh_points . shape [ 0 ] i = 0 with open ( self . infile , 'r' ) as input_file , open ( self . outfile , 'w' ) as output_file : for line in input_file : numbers = line . split ( ) #[n1 p x y z] output_file . write ( numbers [ 0 ] + ' ' + numbers [ 1 ] + ' ' + str ( mesh_points [ i ] [ 0 ] ) + ' ' + str ( mesh_points [ i ] [ 1 ] ) + ' ' + str ( mesh_points [ i ] [ 2 ] ) ) i += 1 if i != n_points : output_file . write ( '\n' )