Example #1
0
    def write_input_file(self, folder=None):
        """Save KSTR input data to file named filename.

        :param folder:  (Default value = None)
        :type folder:
        :returns: None
        :rtype: None
        """

        # Check data integrity before anything is written on disk or run
        self.check_input_file()

        if folder is None:
            #sys.exit('Kstr.create_input_file: \'path\' has to be given!')
            folder = "./"
        else:
            common.check_folders(folder)

        fl = open(folder + '/{0}.kstr'.format(self.jobname_lat), "w")
        fl.write(self.output(1))
        fl.close()
        if self.twocenter:
            fl = open(folder + '/{0}.kstr'.format(self.jobname_lat2), "w")
            fl.write(self.output(2))
            fl.close()

        # Re-initialize some of the input parameters
        # to avoid situations, where an input parameter
        # doesn't get updated correctly, because it already
        # existed.
        self.finalize()
        return
Example #2
0
    def write_input_file(self, folder=None):
        """Writes input file to disk.

        Save KFCD input data to file named filename.

        :param folder: Folder where the data will be written (Default value = None)
        :type folder: str
        :returns: None
        :rtype: None
        """

        # Check data integrity before anything is written on disk or run
        self.check_input_file()

        if folder is None:
            #sys.exit('Kfcd.create_input_file: \'folder\' has to be given!')
            folder = './'
        else:
            common.check_folders(folder)

        fl = open(
            folder + '/{0}.{1}'.format(self.jobname, self.KFCD_file_type), "w")
        fl.write(self.output())
        fl.close()
        return
Example #3
0
    def write_input_file(self, folder=None):
        """Save BMDL input data to file named by self.jobname_lat

        :param folder:  (Default value = None)
        :type folder:
        :returns:
        :rtype:
        """

        # Check data integrity before anything is written on disk or run
        self.check_input_file()

        if folder is None:
            #sys.exit('Bmdl.write_input_file: \'folder\' has to be given!')
            folder = "./"
        else:
            common.check_folders(folder)

        fl = open(folder + '/{0}.bmdl'.format(self.jobname_lat), "w")
        fl.write(self.output())
        fl.close()
Example #4
0
    def write_input_file(self, folder=None):
        """Save SHAPE input data to file named filename

        :param folder: directory to write  (Default value = None)
        :type folder:
        :returns:
        :rtype:
        """

        # Check data integrity before anything is written on disk or run
        self.check_input_file()

        if folder is None:
            #sys.exit('Shape.create_input_file: \'path\' has to be given!')
            folder = "./"
        else:
            common.check_folders(folder)

        fl = open(folder + '/{0}.shape'.format(self.jobname_lat), "w")
        fl.write(self.output())
        fl.close()
        return
Example #5
0
    def write_structure_input_files(self, jobname_lat=None, lat=None, folder=None, **kwargs):
        """For a given lattice type, this function writes
        the corresponding structure input files into a
        given folder

        :param jobname_lat: Name of the job
        :type jobname_lat: str
        :param lat: Name of the lattice
        :type lat: str
        :param folder: Name of the folder
        :type folder: str
        """

        # Mission critical parameters:
        if folder is None:
            folder = "./"
        else:
            common.check_folders(folder,folder+'/bmdl',folder+'/kstr',folder+'/shape')

        #if lat is None:
        #    sys.exit('Latticeinputs.write_structure_input_files: \'lat\' has to be given!')

        if jobname_lat is None:
            sys.exit('Latticeinputs.write_structure_input_files: \'jobname_lat\' has to be given!')
            #jobname_lat = lat

        # Pass down necessary arguments:
        self.set_values(jobname_lat=jobname_lat,latpath=folder)

        # Pass down optional arguments:
        self.set_values(**kwargs)

        # Call the write functions of each subprogram
        self.batch.write_input_file(folder=folder)
        self.bmdl.write_input_file(folder=folder)
        self.kstr.write_input_file(folder=folder)
        self.shape.write_input_file(folder=folder)

        return
Example #6
0
    def write_input_file(self, folder=None):
        """(self,str) ->(None)

            Save BMDL input data to file named filename

        :param folder:  (Default value = None)
        :type folder:
        :returns:
        :rtype:
        """

        # Check data integrity before anything is written on disk or run
        self.check_input_file()

        if folder is None:
            #sys.exit('Batch_emto.write_input_file: \'folder\' has to be given!')
            folder = "./"
        else:
            common.check_folders(folder)

        fl = open(folder + '/{0}.'.format(self.jobname) + self.queue_type, "w")
        fl.write(self.output())
        fl.close()
        return
Example #7
0
    def write_input_file(self, folder=None):
        """(self,str) ->(None)

            Save KGRN input data to file named filename

        :param folder:  (Default value = None)
        :type folder:
        :returns:  None
        :rtype:
        """

        # Check data integrity before anything is written on disk or run
        self.check_input_file()

        if folder is None:
            #sys.exit('Kgrn.create_input_file: \'folder\' has to be given!')
            folder = './'
        else:
            common.check_folders(folder)

        fl = open(
            folder + '/{0}.{1}'.format(self.jobname, self.KGRN_file_type), "w")
        fl.write(self.output())
        fl.close()