Пример #1
0
    def testConstructionBuckets(self):
        """ Test that the KMCInteractions class can be constructed. """
        # A first process.
        coords = [[1.0,2.0,3.4],[12.0,13.0,-1.0],[1.1,1.2,1.3]]
        minimum_match = ["A","*","B"]
        update = [[(-1,"A"), (1, "B")],"*",[(1,"A"), (-1, "B")]]
        rate_0_1 = 3.5
        process_0 = KMCBucketProcess(coordinates=coords,
                                     minimum_match=minimum_match,
                                     update=update,
                                     basis_sites=[0,1,3],
                                     rate_constant=rate_0_1)

        # A second process.
        coords = [[1.0,2.0,3.4],[12.0,13.0,-1.0],[1.1,1.2,1.3]]
        minimum_match = ["A","*","C"]
        update = [[(-1,"A"), (1, "C")],"*",[(1,"A"), (-1, "C")]]
        rate_0_1 = 1.5
        process_1 = KMCBucketProcess(coordinates=coords,
                                     minimum_match=minimum_match,
                                     update=update,
                                     basis_sites=[0,1,3],
                                     rate_constant=rate_0_1)

        processes = [process_0, process_1]

        # Construct the interactions object.
        kmc_interactions = KMCInteractions(processes=processes)

        # Check the default implicit wildcard.
        self.assertTrue( kmc_interactions.implicitWildcards() )

        # Construct again with non default value.
        kmc_interactions = KMCInteractions(processes=processes,
                                           implicit_wildcards=False)

        # Check the wildcard again.
        self.assertFalse( kmc_interactions.implicitWildcards() )

        # Check the processes stored on the object.
        stored_processes = kmc_interactions._KMCInteractions__processes

        # Checks that the address is the same.
        self.assertTrue(stored_processes == processes)
Пример #2
0
    def testConstructionBuckets(self):
        """ Test that the KMCInteractions class can be constructed. """
        # A first process.
        coords = [[1.0, 2.0, 3.4], [12.0, 13.0, -1.0], [1.1, 1.2, 1.3]]
        minimum_match = ["A", "*", "B"]
        update = [[(-1, "A"), (1, "B")], "*", [(1, "A"), (-1, "B")]]
        rate_0_1 = 3.5
        process_0 = KMCBucketProcess(coordinates=coords,
                                     minimum_match=minimum_match,
                                     update=update,
                                     basis_sites=[0, 1, 3],
                                     rate_constant=rate_0_1)

        # A second process.
        coords = [[1.0, 2.0, 3.4], [12.0, 13.0, -1.0], [1.1, 1.2, 1.3]]
        minimum_match = ["A", "*", "C"]
        update = [[(-1, "A"), (1, "C")], "*", [(1, "A"), (-1, "C")]]
        rate_0_1 = 1.5
        process_1 = KMCBucketProcess(coordinates=coords,
                                     minimum_match=minimum_match,
                                     update=update,
                                     basis_sites=[0, 1, 3],
                                     rate_constant=rate_0_1)

        processes = [process_0, process_1]

        # Construct the interactions object.
        kmc_interactions = KMCInteractions(processes=processes)

        # Check the default implicit wildcard.
        self.assertTrue(kmc_interactions.implicitWildcards())

        # Construct again with non default value.
        kmc_interactions = KMCInteractions(processes=processes,
                                           implicit_wildcards=False)

        # Check the wildcard again.
        self.assertFalse(kmc_interactions.implicitWildcards())

        # Check the processes stored on the object.
        stored_processes = kmc_interactions._KMCInteractions__processes

        # Checks that the address is the same.
        self.assertTrue(stored_processes == processes)
Пример #3
0
    def testConstruction(self):
        """ Test that the KMCInteractions class can be constructed. """
        # A first process.
        coords = [[1.0, 2.0, 3.4], [12.0, 13.0, -1.0], [1.1, 1.2, 1.3]]
        types0 = ["A", "*", "B"]
        types1 = ["B", "*", "A"]
        rate_0_1 = 3.5
        process_0 = KMCProcess(coords,
                               types0,
                               types1,
                               basis_sites=[0, 1, 3],
                               rate_constant=rate_0_1)

        # A second process.
        coords = [[1.0, 2.0, 3.4], [1.1, 1.2, 1.3]]
        types0 = ["A", "C"]
        types1 = ["C", "A"]
        rate_0_1 = 1.5
        process_1 = KMCProcess(coords,
                               types0,
                               types1,
                               basis_sites=[0, 1, 3],
                               rate_constant=rate_0_1)

        processes = [process_0, process_1]

        # Construct the interactions object.
        kmc_interactions = KMCInteractions(processes=processes)

        # Check the default implicit wildcard.
        self.assertTrue(kmc_interactions.implicitWildcards())

        # Construct again with non default value.
        kmc_interactions = KMCInteractions(processes=processes,
                                           implicit_wildcards=False)

        # Check the wildcard again.
        self.assertFalse(kmc_interactions.implicitWildcards())

        # Check the processes stored on the object.
        stored_processes = kmc_interactions._KMCInteractions__processes

        # Checks that the address is the same.
        self.assertTrue(stored_processes == processes)
Пример #4
0
    def testConstruction(self):
        """ Test that the KMCInteractions class can be constructed. """
        # A first process.
        coords = [[1.0,2.0,3.4],[12.0,13.0,-1.0],[1.1,1.2,1.3]]
        types0 = ["A","*","B"]
        types1 = ["B","*","A"]
        rate_0_1 = 3.5
        process_0 = KMCProcess(coords, types0, types1, basis_sites=[0,1,3], rate_constant=rate_0_1)

        # A second process.
        coords = [[1.0,2.0,3.4],[1.1,1.2,1.3]]
        types0 = ["A","C"]
        types1 = ["C","A"]
        rate_0_1 = 1.5
        process_1 = KMCProcess(coords, types0, types1, basis_sites=[0,1,3], rate_constant=rate_0_1)

        processes = [process_0, process_1]

        # Construct the interactions object.
        kmc_interactions = KMCInteractions(processes=processes)

        # Check the default implicit wildcard.
        self.assertTrue( kmc_interactions.implicitWildcards() )

        # Construct again with non default value.
        kmc_interactions = KMCInteractions(processes=processes,
                                           implicit_wildcards=False)

        # Check the wildcard again.
        self.assertFalse( kmc_interactions.implicitWildcards() )

        # Check the processes stored on the object.
        stored_processes = kmc_interactions._KMCInteractions__processes

        # Checks that the address is the same.
        self.assertTrue(stored_processes == processes)