Beispiel #1
0
    def __init__(self,
                 atoms=None,
                 restart=None,
                 directory='',
                 label='vasp',
                 ignore_bad_restart_file=False,
                 command=None,
                 txt=None,
                 **kwargs):

        # Initialize parameter dictionaries
        GenerateVaspInput.__init__(self)
        self._store_param_state()  # Initialize an empty parameter state

        # Store atoms objects from vasprun.xml here - None => uninitialized
        self._xml_data = None

        label = os.path.join(directory, label)

        if restart is True:
            # We restart in the label directory
            restart = label

        Calculator.__init__(self,
                            restart=restart,
                            ignore_bad_restart_file=ignore_bad_restart_file,
                            label=label,
                            atoms=atoms,
                            **kwargs)

        self.command = command

        self.set_txt(txt)  # Set the output txt stream
        self.verison = None
Beispiel #2
0
    def __init__(self,
                 atoms=None,
                 restart=None,
                 directory='.',
                 label='vasp',
                 ignore_bad_restart_file=False,
                 command=None,
                 txt='vasp.out',
                 **kwargs):

        self._atoms = None
        self.results = {}

        # Initialize parameter dictionaries
        GenerateVaspInput.__init__(self)
        self._store_param_state()  # Initialize an empty parameter state

        # Store atoms objects from vasprun.xml here - None => uninitialized
        self._xml_data = None

        Calculator.__init__(self,
                            restart=restart,
                            ignore_bad_restart_file=ignore_bad_restart_file,
                            label=label,
                            directory=directory,
                            atoms=atoms,
                            **kwargs)

        self.command = command

        self._txt = None
        self.txt = txt  # Set the output txt stream
        self.version = None
Beispiel #3
0
    def __init__(self,
                 atoms=None,
                 restart=None,
                 directory='.',
                 label='vasp',
                 ignore_bad_restart_file=Calculator._deprecated,
                 command=None,
                 txt='vasp.out',
                 **kwargs):

        self._atoms = None
        self.results = {}

        # Initialize parameter dictionaries
        GenerateVaspInput.__init__(self)
        self._store_param_state()  # Initialize an empty parameter state

        # Store calculator from vasprun.xml here - None => uninitialized
        self._xml_calc = None

        # Set directory and label
        self.directory = directory
        if '/' in label:
            warn(
                'Specifying directory in "label" is deprecated, use "directory" instead.',
                np.VisibleDeprecationWarning)
            if self.directory != '.':
                raise ValueError('Directory redundantly specified though '
                                 'directory="{}" and label="{}".  '
                                 'Please omit "/" in label.'.format(
                                     self.directory, label))
            self.label = label
        else:
            self.prefix = label  # The label should only contain the prefix

        if isinstance(restart, bool):
            if restart is True:
                restart = self.label
            else:
                restart = None

        Calculator.__init__(
            self,
            restart=restart,
            ignore_bad_restart_file=ignore_bad_restart_file,
            # We already, manually, created the label
            label=self.label,
            atoms=atoms,
            **kwargs)

        self.command = command

        self._txt = None
        self.txt = txt  # Set the output txt stream
        self.version = None