예제 #1
0
파일: tetrol.py 프로젝트: wwwtyro/PyGMIN
 def takeStep(self, coords, **kwargs):
     from pygmin.takestep import buildingblocks as bb
     ca = CoordsAdapter(nrigid=GMIN.getNRigidBody(), nlattice=6, coords=coords)
     bb.rotate(1.6, ca.rotRigid)
     #from pygmin.utils import lattice
     #bb.reduced_coordinates_displace(0.0, lattice.lowerTriangular(ca.lattice), ca.posRigid)
     ca.lattice*=1.2              
예제 #2
0
파일: dmagmin.py 프로젝트: wwwtyro/PyGMIN
    def takeStep(self, coords, **kwargs):
        from pygmin.takestep import buildingblocks as bb
        
        ca = CoordsAdapter(nrigid=GMIN.getNRigidBody(), nlattice=6, coords=coords)
        
        #tmp = np.loadtxt("aligned.dat")
        #coords[-6:]=tmp[-6:]        
        #coords[:]=tmp[:]
        #return        
        conf_ok = False
        if(not self.overlap_cutoff is None):
            safe_coords = coords.copy()
        
        while conf_ok is False:        
            indices=None
            if(self.nmols):
                indices=[]
                indices = [np.random.randint(0,GMIN.getNRigidBody()) for i in xrange(self.nmols)]
            
            if(self.rotate != 0.):
                bb.rotate(self.rotate, ca.rotRigid, indices)
            if(self.translate != 0.):
                bb.uniform_displace(self.translate, ca.rotRigid, indices)
                
            #from pygmin.utils import lattice
            #bb.reduced_coordinates_displace(0.0, lattice.lowerTriangular(ca.lattice), ca.posRigid)
            ca.lattice[:]*=self.expand

            if(self.max_volume):
                vol = lattice.volume(ca.lattice)
                if(vol > self.max_volume):
                    ca.lattice[:]*=(self.max_volume / vol)**(1./3.)
            
            conf_ok = True
            if(self.overlap_cutoff):
                atomistic = np.zeros(3*GMIN.getNAtoms())
                GMIN.toAtomistic(atomistic, coords)                
                overlap =  crystals.has_overlap(atomistic, self.overlap_cutoff)
                if(overlap is True):
                    conf_ok = False
                    coords[:] = safe_coords           
예제 #3
0
파일: run_gui.py 프로젝트: wwwtyro/PyGMIN
 def takeStep(self, coords, **kwargs):
     from pygmin.takestep import buildingblocks as bb
     print coords.size
     ca = CoordsAdapter(nrigid=2, nlattice=6, coords=coords)
     bb.rotate(1.6, ca.rotRigid)
     ca.lattice*=1.2