def test_run(self):
     job = self.project.create_job(
         self.project.job_type.AtomisticExampleJob, "job_test")
     basis = CrystalStructure(element="Fe",
                              bravais_basis="bcc",
                              lattice_constant=2.83)
     basis.set_initial_magnetic_moments([2, 2])
     job.structure = basis
     phono = self.project.create_job("PhonopyJob", "phono")
     phono.ref_job = job
     structure = phono.list_structures()[0]
     magmoms = structure.get_initial_magnetic_moments()
     self.assertAlmostEqual(sum(magmoms - 2), 0)
Exemple #2
0
 def test_run(self):
     job = self.project.create_job(
         'HessianJob', "job_test"
     )
     basis = CrystalStructure(
         element="Fe", bravais_basis="bcc", lattice_constant=2.85
     )
     basis.set_initial_magnetic_moments([2]*len(basis))
     job.set_reference_structure(basis)
     phono = job.create_job("PhonopyJob", "phono")
     structure = phono.list_structures()[0]
     magmoms = structure.get_initial_magnetic_moments()
     self.assertAlmostEqual(sum(magmoms-2), 0)
     rep = phono._phonopy_supercell_matrix().diagonal().astype(int)
     job._reference_structure.set_repeat(rep)
     job.structure.set_repeat(rep)
     job.set_force_constants(1)