Esempio n. 1
0
 def get_mull_charges(self):
     """
     return atomic charges as obtained by Mulliken analysis
     by Martin Stoehr ([email protected]) Oct 2015
     """
     atoms = self.atoms
     if ('output' in self.parameters
             and 'mulliken' not in self.parameters['output']):
         raise NotImplementedError('Tell AIMS to do Mulliken analysis!')
     return FileIOCalculator.get_property(self, 'mull_charges', atoms)
Esempio n. 2
0
 def get_hirsh_charges(self):
     """
     return atomic charges as obtained by Hirshfeld analysis
     by Martin Stoehr ([email protected]) Oct 2015
     """
     atoms = self.atoms
     if ('output' in self.parameters
             and 'hirshfeld' not in self.parameters['output']):
         raise NotImplementedError
     return FileIOCalculator.get_property(self, 'hirsh_charges', atoms)
Esempio n. 3
0
    def get_property(self, name, atoms=None, allow_calculation=True):
        dft_result = None
        if self.dft is not None:
            dft_result = self.dft.get_property(name, atoms, allow_calculation)

        dftd3_result = FileIOCalculator.get_property(self, name, atoms,
                                                     allow_calculation)

        if dft_result is None and dftd3_result is None:
            return None
        elif dft_result is None:
            return dftd3_result
        elif dftd3_result is None:
            return dft_result
        else:
            return dft_result + dftd3_result
Esempio n. 4
0
    def get_property(self, name, atoms=None, allow_calculation=True):
        dft_result = None
        if self.dft is not None:
            dft_result = self.dft.get_property(name, atoms, allow_calculation)

        dftd3_result = FileIOCalculator.get_property(self, name, atoms,
                                                     allow_calculation)

        if dft_result is None and dftd3_result is None:
            return None
        elif dft_result is None:
            return dftd3_result
        elif dftd3_result is None:
            return dft_result
        else:
            return dft_result + dftd3_result
Esempio n. 5
0
    def get_hirsh_volrat(self, approach_tmp=None):
        atoms = self.atoms
        if ((not approach_tmp is None) and \
            (approach_tmp in valid_hvr_approaches)):
            hvr_model = approach_tmp
        else:
            hvr_model = self.hvr_approach

        if (hvr_model == 'const'):
            return np.array([
                1.,
            ] * len(atoms))
        elif (hvr_model == 'CPA'):
            write_restart_args = ['restart_aims', 'restart_write_only']
            correct_settings, restart_set_correct = False, False
            for keystr in write_restart_args:
                if keystr in self.parameters.keys():
                    if (self.parameters[keystr] == 'wvfn.dat'):
                        restart_set_correct = True
                        break

            if ('output' in self.parameters.keys()):
                basis_present = ('h_s_matrices' in self.parameters['output'])
                correct_settings = basis_present
                if np.any(self.atoms.pbc):
                    k_list_present = ('k_point_list'
                                      in self.parameters['output'])
                    correct_settings = correct_settings and k_list_present

            if (correct_settings and restart_set_correct):
                return self.get_hvr_CPA()
            else:
                my_err_str = "Set either 'restart_aims' or 'restart_write_only' to 'wvfn.dat' "
                my_err_str += "in order to perform external charge population analysis!"
                raise ValueError(my_err_str)
        elif (hvr_model == 'HA'):
            if ('output' in self.parameters
                    and 'hirshfeld' not in self.parameters['output']):
                my_err_str = "Set output 'hirshfeld' in order to use results from "
                my_err_str += "Hirshfeld analysis!"
                raise ValueError(my_err_str)
            return FileIOCalculator.get_property(self, 'hirsh_volrat', atoms)
Esempio n. 6
0
 def get_friction_tensor(self, atoms):
     if ('calculate_friction' not in self.parameters):
         raise NotImplementedError
     return FileIOCalculator.get_property(self, 'friction', atoms)
Esempio n. 7
0
 def get_hirsh_charge(self, atoms):
     if ('output' in self.parameters
             and 'hirshfeld' not in self.parameters['output']):
         raise NotImplementedError
     return FileIOCalculator.get_property(self, 'hirsh_charge', atoms)