コード例 #1
0
    def test_no_throw(self):
        if not available:
            self.skipTest(skipMsg)

        no_throw = True
        msg = ""
        try:
            bc = get_ternary_BC()
            eci = get_example_ecis(bc)

            atoms = bc.atoms.copy()
            CE(atoms, bc, eci=eci)

            mc = Montecarlo(atoms, 1000)
            mc.insert_symbol_random_places("Mg", num=10, swap_symbs=["Al"])

            # Note: convergence_factor should never be
            # set to a negative value! Here it is done
            # to make the test converged after one step
            bias = AdaptiveBiasReactionPathSampler(
                mc_obj=mc,
                react_crd_init=DummyReacCrdInit(),
                react_crd=[-1.0, 1.0],
                convergence_factor=-1.0)
            bias.run()
        except Exception as exc:
            msg = str(exc)
            no_throw = False
        self.assertTrue(no_throw, msg=msg)
コード例 #2
0
    def test_no_throw(self):
        if not available:
            self.skipTest(import_msg)

        ceBulk, atoms = self.init_bulk_crystal()
        mc = Montecarlo(atoms, 100.0)
        mc.insert_symbol_random_places("Mg", num=5, swap_symbs=["Al"])
        mc.insert_symbol_random_places("Si", num=5, swap_symbs=["Al"])
        par_temp = ParallelTempering(mc_obj=mc, Tmax=100.0, Tmin=0.001)
        mc_args = {"steps": 100, "equil": False}
        par_temp.run(mc_args=mc_args, num_exchange_cycles=3)
        os.remove("temp_scheme.csv")
コード例 #3
0
    def test_run(self):
        if not available:
            self.skipTest(reason)

        bc = get_ternary_BC()
        eci = get_example_ecis(bc)
        atoms = bc.atoms.copy()
        calc = CE(atoms, bc, eci=eci)

        mc = Montecarlo(atoms, 1000000)
        mc.insert_symbol_random_places("Mg", swap_symbs=["Al"], num=3)
        performance_monitor = MultithreadPerformance(4)
        performance_monitor.run(mc, 100)
コード例 #4
0
def main():
    atoms = get_atoms(cubic=True)

    T = 1500
    mc = Montecarlo(atoms, T)
    mc.insert_symbol_random_places("Mg", num=400, swap_symbs=["Al"])
    mc.insert_symbol_random_places("Si", num=400, swap_symbs=["Al"])
    snap = Snapshot(trajfile="data/mc_digi{}K.traj", atoms=atoms)
    mc.attach(snap, interval=50000)
    mc.runMC(steps=500000)

    T = 293
    mc = Montecarlo(atoms, T)
    snap = Snapshot(trajfile="data/mc_digi{}K.traj", atoms=atoms)
    mc.attach(snap, interval=50000)
    mc.runMC(steps=500000)
コード例 #5
0
    def test_no_throw(self):
        if not available:
            self.skipTest(import_msg)

        msg = ""
        no_throw = True
        try:
            ceBulk = self.init_bulk_crystal()
            mc = Montecarlo(ceBulk.atoms, 100.0)
            mc.insert_symbol_random_places("Mg", num=5, swap_symbs=["Al"])
            mc.insert_symbol_random_places("Si", num=5, swap_symbs=["Al"])
            par_temp = ParallelTempering(mc_obj=mc, Tmax=100.0, Tmin=0.001)
            mc_args = {"steps": 100, "equil": False}
            par_temp.run(mc_args=mc_args, num_exchange_cycles=3)
            os.remove("temp_scheme.csv")
        except Exception as exc:
            msg = "{}: {}".format(type(exc).__name__, str(exc))
            no_throw = False
        self.assertTrue(no_throw, msg=msg)