Пример #1
0
 def test_as_dict_and_from_dict(self):
     file_name = os.path.join(test_dir, 'HEADER')
     header = Header.from_file(file_name)
     struct = header.struct
     pot = FeffPot(struct, 'O')
     d=pot.as_dict()
     pot2 = FeffPot.from_dict(d)
     self.assertEqual(str(pot), str(pot2),
                      "FeffPot to and from dict does not match")
Пример #2
0
 def test_as_dict_and_from_dict(self):
     file_name = os.path.join(test_dir, 'HEADER')
     header = Header.from_file(file_name)
     struct = header.struct
     pot = FeffPot(struct, 'O')
     d = pot.as_dict()
     pot2 = FeffPot.from_dict(d)
     self.assertEqual(str(pot), str(pot2),
                      "FeffPot to and from dict does not match")
Пример #3
0
    def get_feff_pot(self, structure, central_atom):
        """
        Creates string representation of potentials used in POTENTIAL file and
        feff.inp.

        Args:
            structure:
                structure object
            central_atom:
                symbol for absorbing atom

        Returns:
            string representation of potential indicies, etc. used in POTENTIAL
            file.
        """
        pot = FeffPot(structure, central_atom)
        return pot.get_string()
Пример #4
0
    def get_feff_pot(self, structure, central_atom):
        """
        Creates string representation of potentials used in POTENTIAL file and
        feff.inp.

        Args:
            structure: pymatgen structure object
            central_atom: atom symbol string for absorbing atom

        Returns:
            FeffPot object
        """
        return FeffPot(structure, central_atom)
Пример #5
0
 def test_init(self):
     filepath = os.path.join(test_dir, 'POTENTIALS')
     feffpot = FeffPot.pot_string_from_file(filepath)
     d, dr = FeffPot.pot_dict_from_string(feffpot)
     self.assertEqual(d['Co'], 1, "Wrong symbols read in for FeffPot")
Пример #6
0
 def test_init(self):
     filepath = os.path.join(test_dir, 'POTENTIALS')
     feffpot = FeffPot.pot_string_from_file(filepath)
     d, dr = FeffPot.pot_dict_from_string(feffpot)
     self.assertEqual(d['Co'], 1, "Wrong symbols read in for FeffPot")
Пример #7
0
    def test_get_feffPot(self):
        POT = str(FeffInputSet.get_feff_pot(x, structure, central_atom))
        d, dr = FeffPot.pot_dict_from_string(POT)

        self.assertEqual(d['Co'], 1, "Wrong symbols read in for FeffPot")
Пример #8
0
    def test_get_feffPot(self):
        POT = str(FeffInputSet.get_feff_pot(x, structure, central_atom))
        d, dr = FeffPot.pot_dict_from_string(POT)

        self.assertEqual(d['Co'], 1, "Wrong symbols read in for FeffPot")