Révision 17 ase/embed.py

embed.py (revision 17)
111 111
            self.atoms_cluster.set_cell(self.atoms_system.get_cell())
112 112
        elif self.cell_cluster == "Auto":
113 113
            positions = self.atoms_cluster.get_positions()
114
            #find the biggest dimensions of the cluster in x,y,z direction
115
            l = 0
116
            for idir in xrange(3):
117
                l = max(l, positions[:, idir].max() - positions[:, idir].min())
118
            # calculate the box parameters (cluster + min 5 Ang)
119
            l = (math.floor(l/2.5)+1)*2.5 + 5.0
120 114
            # build cell
121 115
            cell = np.zeros((3, 3),  float)
122
            # apply cell parameters
116
            #for all directions
123 117
            for idir in xrange(3):
118
                #find the biggest dimensions of the cluster in x,y,z direction
119
                l = positions[:, idir].max() - positions[:, idir].min()
120
                # calculate the box parameters (2*cluster + 60 pm)
121
                l = (math.floor((2*l+6)/2.5)+1)*2.5
122
                # apply cell parameters
124 123
                cell[idir, idir] = l
125 124
            # set parameters to cluster
126 125
            self.atoms_cluster.set_cell(cell)
127 126
            # print information on the screen
128
            print "length of box surrounding the cluster: ", 
129
            print l*10, 
130
            print "pm"
127
            print "dimension of box surrounding the cluster: ", 
128
            for idir in xrange(3):
129
                print cell[idir, idir]*10, 
130
            print " pm"
131
            exit()
131 132
        else:
132 133
            self.atoms_cluster.set_cell(self.cell_cluster)
133 134

  

Formats disponibles : Unified diff