# Richard Darst, May 2009 import saiga12 #import saiga12.geom from saiga12.geom.grid import * from saiga12.geom.util import checkConnDistances, checkConnReversibility ccr = checkConnReversibility ccd = lambda S: checkConnDistances(S, 1., doAssert=True) S = Grid1d() ; S.makegrid(6) ; ccd(S) ; ccr(S) S = Grid2d() ; S.makegrid(6,6) ; ccd(S) ; ccr(S) S = Grid3d() ; S.makegrid(6,6,6) ; ccd(S) ; ccr(S) S = GridHex2d() ; S.makegrid(6,6) ; ccd(S) ; ccr(S) S = Grid3dHCP() ; S.makegrid(6,6,6) ; ccd(S) ; ccr(S)
# First, test the 3d grid (hexagonal close-packed) # S = Grid3dHCP() S.makegrid(a, b, c) S.addParticleRandomDensity(density, type_=12) # set the first two particles on the x-axis to be a different color: S.atomtype[S.lattsite[0]] = 3 S.atomtype[S.lattsite[36]] = 3 #print S.coords(numpy.arange(64)) # Print out distance of every atom from every other atom it is # connected to. # All of these distances should be 1: checkConnDistances(S, 1, setType=2, doAssert=True) # See if any connections are not symmetric: findAsymmetry(S, doAssert=True) if not globals().has_key("noviz"): V = saiga12.viz.VizSystem(S) V.vizMakeBox() V.vizDisplay() # draw connections: drawConn(V, S, pos=1, ) #drawConn(V, S, 1, whichi=(8, 10)) if __name__ == "__main__": interact(local=locals(), banner="")