Beispiel #1
0
    def potential(self, potential_filename):
        """
        Execute view_potential() or list_potential() in order to see the pre-defined potential files

        Args:
            potential_filename:

        Returns:

        """
        stringtypes = str
        if isinstance(potential_filename, stringtypes):
            if ".lmp" in potential_filename:
                potential_filename = potential_filename.split(".lmp")[0]
            potential_db = LammpsPotentialFile()
            potential = potential_db.find_by_name(potential_filename)
        elif isinstance(potential_filename, pd.DataFrame):
            potential = potential_filename
        else:
            raise TypeError(
                "Potentials have to be strings or pandas dataframes.")
        self.input.potential.df = potential
        for val in ["units", "atom_style", "dimension"]:
            v = self.input.potential[val]
            if v is not None:
                self.input.control[val] = v
                if val == "units" and v != "metal":
                    warnings.warn(
                        "WARNING: Non-'metal' units are not fully supported. Your calculation should run OK, but "
                        "results may not be saved in pyiron units.")
        self.input.potential.remove_structure_block()
Beispiel #2
0
    def potential(self, potential_filename):
        """
        Execute view_potential() or list_potential() in order to see the pre-defined potential files

        Args:
            potential_filename:

        Returns:

        """
        if sys.version_info.major == 2:
            stringtypes = (str, unicode)
        else:
            stringtypes = str
        if isinstance(potential_filename, stringtypes):
            if '.lmp' in potential_filename:
                potential_filename = potential_filename.split('.lmp')[0]
            potential_db = LammpsPotentialFile()
            potential = potential_db.find_by_name(potential_filename)
        elif isinstance(potential_filename, pd.DataFrame):
            potential = potential_filename
        else:
            raise TypeError(
                'Potentials have to be strings or pandas dataframes.')
        self.input.potential.df = potential
        for val in ["units", "atom_style", "dimension"]:
            v = self.input.potential[val]
            if v is not None:
                self.input.control[val] = v
        self.input.potential.remove_structure_block()
Beispiel #3
0
    def view_potentials(self):
        """
        List all interatomic potentials for the current atomistic sturcture including all potential parameters.

        To quickly get only the names of the potentials you can use: self.potentials_list()

        Returns:
            pandas.Dataframe: Dataframe including all potential parameters.
        """
        from pyiron.lammps.potential import LammpsPotentialFile
        if not self.structure:
            raise ValueError('No structure set.')
        list_of_elements = set(self.structure.get_chemical_symbols())
        list_of_potentials = LammpsPotentialFile().find(list_of_elements)
        if list_of_potentials is not None:
            return list_of_potentials
        else:
            raise TypeError('No potentials found for this kind of structure: ', str(list_of_elements))
 def inspect_emperical_potentials():
     return LammpsPotentialFile()
Beispiel #5
0
 def setUpClass(cls):
     cls.kim = LammpsPotentialFile()
     cls.potential_path = os.path.join(
         os.path.dirname(os.path.abspath(__file__)),
         '../../static/lammps/potentials')
Beispiel #6
0
 def setUp(self):
     self.kim = LammpsPotentialFile()
     self.potential_path = os.path.join(
         os.path.dirname(os.path.abspath(__file__)),
         '../../static/lammps/potentials')