Example #1
0
 def test_add_periodicities(self):
     for counter in xrange(100):
         #print counter
         uc = UnitCell()
         uc.cell = numpy.random.uniform(-1, 1, (3, 3))
         uc.cell_active[:] = False
         uc.add_cell_vector(numpy.random.uniform(-2,2,3))
         uc.add_cell_vector(numpy.random.uniform(-2,2,3))
         uc.add_cell_vector(numpy.random.uniform(-2,2,3))
Example #2
0
 def test_add_periodicities(self):
     for counter in xrange(100):
         #print counter
         uc = UnitCell()
         uc.cell = numpy.random.uniform(-1, 1, (3, 3))
         uc.cell_active[:] = False
         uc.add_cell_vector(numpy.random.uniform(-2, 2, 3))
         uc.add_cell_vector(numpy.random.uniform(-2, 2, 3))
         uc.add_cell_vector(numpy.random.uniform(-2, 2, 3))
Example #3
0
        def create_pattern():
            "Read the atom positions and transform them to the flat coordinates"
            active, inactive = universe.get_active_inactive()
            tmp_cell = UnitCell()
            tmp_cell.add_cell_vector(universe.cell[:,active[0]])
            tmp_cell.add_cell_vector(universe.cell[:,active[1]])
            r = tmp_cell.calc_align_rotation_matrix()

            return [
                (atom.number, numpy.dot(r, atom.get_absolute_frame().t))
                for atom in yield_atoms([universe])
            ]