def setUp(self):
     self.kwargs = {
         "poscar_filename": get_path("CONTCAR.relax1.gz"),
         "locpot_filename": get_path("LOCPOT.gz"),
         "outcar_filename": get_path("OUTCAR.relax1.gz"),
     }
     self.wf_analyzer = WorkFunctionAnalyzer.from_files(**self.kwargs)
Exemplo n.º 2
0
def wf(directory, plot_potential=False):

    directory = os.path.abspath(directory)

    wf_analyzer = WorkFunctionAnalyzer.from_files(
        poscar_filename=os.path.join(directory, "POSCAR"),
        locpot_filename=os.path.join(directory, "LOCPOT"),
        outcar_filename=os.path.join(directory, "OUTCAR")
    )

    if plot_potential:
        wf_analyzer.get_locpot_along_slab_plot().show()
        pass #TODO Finish this part

    work_function = wf_analyzer.work_function
    print("Work function = " + str(work_function) + " eV")
Exemplo n.º 3
0
 def test_shift(self):
     wf_analyzer_shift = WorkFunctionAnalyzer.from_files(shift=-0.25, blength=3.7, **self.kwargs)
     self.assertEqual("%.f" % (self.wf_analyzer.ave_bulk_p),
                      "%.f" % (wf_analyzer_shift.ave_bulk_p))
Exemplo n.º 4
0
 def test_attributes(self):
     wf_analyzer_shift = WorkFunctionAnalyzer.from_files(shift=0.25, **self.kwargs)
     self.assertEqual("%.1f" %(self.wf_analyzer.ave_bulk_p),
                      "%.1f" %(wf_analyzer_shift.ave_bulk_p))
Exemplo n.º 5
0
    def setUp(self):

        self.kwargs = {"poscar_filename": get_path("CONTCAR.relax1.gz"),
                       "locpot_filename": get_path("LOCPOT.gz"),
                       "outcar_filename": get_path("OUTCAR.relax1.gz")}
        self.wf_analyzer = WorkFunctionAnalyzer.from_files(**self.kwargs)
Exemplo n.º 6
0
 def test_attributes(self):
     wf_analyzer_shift = WorkFunctionAnalyzer.from_files(shift=0.25, **self.kwargs)
     self.assertEqual("%.1f" %(self.wf_analyzer.ave_bulk_p),
                      "%.1f" %(wf_analyzer_shift.ave_bulk_p))
Exemplo n.º 7
0
 def test_plt(self):
     wf_analyzer = WorkFunctionAnalyzer.from_files(**self.kwargs)
     plt = wf_analyzer.get_locpot_along_slab_plot()
     self.assertEqual(type(plt).__name__, "module")
Exemplo n.º 8
0
 def test_plt(self):
     wf_analyzer = WorkFunctionAnalyzer.from_files(**self.kwargs)
     plt = wf_analyzer.get_locpot_along_slab_plot()
     self.assertEqual(type(plt).__name__, "module")
Exemplo n.º 9
0
 def test_shift(self):
     wf_analyzer_shift = WorkFunctionAnalyzer.from_files(shift=-0.25, blength=3.7, **self.kwargs)
     self.assertAlmostEqual(self.wf_analyzer.ave_bulk_p, wf_analyzer_shift.ave_bulk_p, places=0)
Exemplo n.º 10
0
 def test_shift(self):
     wf_analyzer_shift = WorkFunctionAnalyzer.from_files(shift=-0.25, blength=3.7, **self.kwargs)
     self.assertEqual("%.f" %(self.wf_analyzer.ave_bulk_p),
                      "%.f" %(wf_analyzer_shift.ave_bulk_p))