class NanoscaleStabilityTest(PymatgenTest): def setUp(self): # Load all entries La_hcp_entry_dict = get_entry_dict( os.path.join(get_path(""), "La_hcp_entries.txt")) La_fcc_entry_dict = get_entry_dict( os.path.join(get_path(""), "La_fcc_entries.txt")) with open(os.path.join(get_path(""), 'ucell_entries.txt')) as ucell_entries: ucell_entries = json.loads(ucell_entries.read()) La_hcp_ucell_entry = ComputedStructureEntry.from_dict( ucell_entries["La_hcp"]) La_fcc_ucell_entry = ComputedStructureEntry.from_dict( ucell_entries["La_fcc"]) # Set up the NanoscaleStabilityClass self.La_hcp_analyzer = SurfaceEnergyPlotter(La_hcp_entry_dict, La_hcp_ucell_entry) self.La_fcc_analyzer = SurfaceEnergyPlotter(La_fcc_entry_dict, La_fcc_ucell_entry) self.nanoscale_stability = NanoscaleStability( [self.La_fcc_analyzer, self.La_hcp_analyzer]) def test_stability_at_r(self): # Check that we have a different polymorph that is # stable below or above the equilibrium particle size r = self.nanoscale_stability.solve_equilibrium_point( self.La_hcp_analyzer, self.La_fcc_analyzer) * 10 # hcp phase of La particle should be the stable # polymorph above the equilibrium radius hcp_wulff = self.La_hcp_analyzer.wulff_from_chempot() bulk = self.La_hcp_analyzer.ucell_entry ghcp, rhcp = self.nanoscale_stability.wulff_gform_and_r( hcp_wulff, bulk, r + 10, from_sphere_area=True) fcc_wulff = self.La_fcc_analyzer.wulff_from_chempot() bulk = self.La_fcc_analyzer.ucell_entry gfcc, rfcc = self.nanoscale_stability.wulff_gform_and_r( fcc_wulff, bulk, r + 10, from_sphere_area=True) self.assertGreater(gfcc, ghcp) # fcc phase of La particle should be the stable # polymorph below the equilibrium radius hcp_wulff = self.La_hcp_analyzer.wulff_from_chempot() bulk = self.La_hcp_analyzer.ucell_entry ghcp, rhcp = self.nanoscale_stability.wulff_gform_and_r( hcp_wulff, bulk, r - 10, from_sphere_area=True) fcc_wulff = self.La_fcc_analyzer.wulff_from_chempot() bulk = self.La_fcc_analyzer.ucell_entry gfcc, rfcc = self.nanoscale_stability.wulff_gform_and_r( fcc_wulff, bulk, r - 10, from_sphere_area=True) self.assertLess(gfcc, ghcp)
class NanoscaleStabilityTest(PymatgenTest): def setUp(self): # Load all entries La_hcp_entry_dict = get_entry_dict(os.path.join(get_path(""), "La_hcp_entries.txt")) La_fcc_entry_dict = get_entry_dict(os.path.join(get_path(""), "La_fcc_entries.txt")) with open(os.path.join(get_path(""), 'ucell_entries.txt')) as ucell_entries: ucell_entries = json.loads(ucell_entries.read()) La_hcp_ucell_entry = ComputedStructureEntry.from_dict(ucell_entries["La_hcp"]) La_fcc_ucell_entry = ComputedStructureEntry.from_dict(ucell_entries["La_fcc"]) # Set up the NanoscaleStabilityClass self.La_hcp_analyzer = SurfaceEnergyPlotter(La_hcp_entry_dict, La_hcp_ucell_entry) self.La_fcc_analyzer = SurfaceEnergyPlotter(La_fcc_entry_dict, La_fcc_ucell_entry) self.nanoscale_stability = NanoscaleStability([self.La_fcc_analyzer, self.La_hcp_analyzer]) def test_stability_at_r(self): # Check that we have a different polymorph that is # stable below or above the equilibrium particle size r = self.nanoscale_stability.solve_equilibrium_point(self.La_hcp_analyzer, self.La_fcc_analyzer)*10 # hcp phase of La particle should be the stable # polymorph above the equilibrium radius hcp_wulff = self.La_hcp_analyzer.wulff_from_chempot() bulk = self.La_hcp_analyzer.ucell_entry ghcp, rhcp = self.nanoscale_stability.wulff_gform_and_r(hcp_wulff, bulk, r+10, from_sphere_area=True) fcc_wulff = self.La_fcc_analyzer.wulff_from_chempot() bulk = self.La_fcc_analyzer.ucell_entry gfcc, rfcc = self.nanoscale_stability.wulff_gform_and_r(fcc_wulff, bulk, r+10, from_sphere_area=True) self.assertGreater(gfcc, ghcp) # fcc phase of La particle should be the stable # polymorph below the equilibrium radius hcp_wulff = self.La_hcp_analyzer.wulff_from_chempot() bulk = self.La_hcp_analyzer.ucell_entry ghcp, rhcp = self.nanoscale_stability.wulff_gform_and_r(hcp_wulff, bulk, r-10, from_sphere_area=True) fcc_wulff = self.La_fcc_analyzer.wulff_from_chempot() bulk = self.La_fcc_analyzer.ucell_entry gfcc, rfcc = self.nanoscale_stability.wulff_gform_and_r(fcc_wulff, bulk, r-10, from_sphere_area=True) self.assertLess(gfcc, ghcp)
def setUp(self): # Load all entries La_hcp_entry_dict = get_entry_dict(os.path.join(get_path(""), "La_hcp_entries.txt")) La_fcc_entry_dict = get_entry_dict(os.path.join(get_path(""), "La_fcc_entries.txt")) with open(os.path.join(get_path(""), "ucell_entries.txt")) as ucell_entries: ucell_entries = json.loads(ucell_entries.read()) La_hcp_ucell_entry = ComputedStructureEntry.from_dict(ucell_entries["La_hcp"]) La_fcc_ucell_entry = ComputedStructureEntry.from_dict(ucell_entries["La_fcc"]) # Set up the NanoscaleStabilityClass self.La_hcp_analyzer = SurfaceEnergyPlotter(La_hcp_entry_dict, La_hcp_ucell_entry) self.La_fcc_analyzer = SurfaceEnergyPlotter(La_fcc_entry_dict, La_fcc_ucell_entry) self.nanoscale_stability = NanoscaleStability([self.La_fcc_analyzer, self.La_hcp_analyzer])
def setUp(self): # Load all entries La_hcp_entry_dict = get_entry_dict(os.path.join(get_path(""), "La_hcp_entries.txt")) La_fcc_entry_dict = get_entry_dict(os.path.join(get_path(""), "La_fcc_entries.txt")) with open(os.path.join(get_path(""), 'ucell_entries.txt')) as ucell_entries: ucell_entries = json.loads(ucell_entries.read()) La_hcp_ucell_entry = ComputedStructureEntry.from_dict(ucell_entries["La_hcp"]) La_fcc_ucell_entry = ComputedStructureEntry.from_dict(ucell_entries["La_fcc"]) # Set up the NanoscaleStabilityClass self.La_hcp_analyzer = SurfaceEnergyPlotter(La_hcp_entry_dict, La_hcp_ucell_entry) self.La_fcc_analyzer = SurfaceEnergyPlotter(La_fcc_entry_dict, La_fcc_ucell_entry) self.nanoscale_stability = NanoscaleStability([self.La_fcc_analyzer, self.La_hcp_analyzer])