Beispiel #1
0
    def draw_with(eng):
        eng.clear()
        vo = Voron(*u.rep)
        eng(vo)
        u.to_decart()
        for n, vs in u * 1:  ## for each atoms in extended unitcell
            r, col = UCell.data[n]
            col = [x / 255.0 for x in col]

            for v in vo.touch(vs):
                eng(v, r=r, color=col, invis=False)
                eng(n, pos=v)

            for v in vo.has(vs):  ## only draw atoms which are in Voron cell
                if not vo.touch(v):
                    eng(v, r=r, color=col, invis=False)
                    eng(n, pos=v)
Beispiel #2
0
    def draw_with( eng ):
        eng.clear()
        vo = Voron( *u.rep )
        eng( vo )
        u.to_decart()
        for n, vs in u*1:                 ## for each atoms in extended unitcell
            r, col = UCell.data[ n ]
            col = [ x/255.0 for x in col ]

            for v in vo.touch( vs ):
                eng( v, r = r, color = col, invis = False )
                eng( n, pos = v )

            for v in vo.has( vs ):        ## only draw atoms which are in Voron cell
                if not vo.touch( v ):
                    eng( v, r = r, color = col, invis = False )
                    eng( n, pos = v )
Beispiel #3
0
    def draw_with(eng):
        eng.clear()
        vo = Voron(*u.rep)
        eng(vo)
        u.to_decart()

        if args.atoms:
            for n, vs in u * 1:  ## for each atoms in extended unitcell
                r, col = UCell.data[n]
                col = [x / 255.0 for x in col]

                for v in vo.touch(vs):
                    eng(v, r=r, color=col, invis=False)
                    eng(n, pos=v)

                for v in vo.has(
                        vs):  ## only draw atoms which are in Voron cell
                    if not vo.touch(v):
                        eng(v, r=r, color=col, invis=False)
                        eng(n, pos=v)

        if args.wycksub:
            u.to_fract()
            Z = u.to_min().rep.minimize().to_zell().norm()
            for wname, ws in zip('abcdefghijklmnopqrstuvwxyz',
                                 c.spgrp.wyckpos()):
                for n, vs in u_basis:
                    for v in vs:
                        if v in ws:
                            print '--(%s)-->' % wname, n, v, c.spgrp * v,
                            u4min = UCell(u_basis.rep)
                            u4min.add('A', ws)
                            u4min = u4min.to_min()

                            z = u4min.rep.minimize().to_zell().norm()
                            if Z != z:
                                print 'FOUND %s' % z.to_sort()
                                vo = Voron(*u4min.rep)
                                eng(vo)
                            else:
                                print 'not wyck sublattice'
Beispiel #4
0
    def draw_with( eng ):
        eng.clear()
        vo = Voron( *u.rep )
        eng( vo )
        u.to_decart()

        if args.atoms:
            for n, vs in u*1:                 ## for each atoms in extended unitcell
                r, col = UCell.data[ n ]
                col = [ x/255.0 for x in col ]

                for v in vo.touch( vs ):
                    eng( v, r = r, color = col, invis = False )
                    eng( n, pos = v )

                for v in vo.has( vs ):        ## only draw atoms which are in Voron cell
                    if not vo.touch( v ):
                        eng( v, r = r, color = col, invis = False )
                        eng( n, pos = v )

        if args.wycksub:
            u.to_fract()
            Z = u.to_min().rep.minimize().to_zell().norm()
            for wname, ws in zip( 'abcdefghijklmnopqrstuvwxyz', c.spgrp.wyckpos() ):
                for n, vs in u_basis:
                    for v in vs:
                        if v in ws:
                            print '--(%s)-->' % wname, n, v, c.spgrp * v,
                            u4min = UCell( u_basis.rep )
                            u4min.add( 'A', ws )
                            u4min = u4min.to_min()

                            z = u4min.rep.minimize().to_zell().norm()
                            if Z != z:
                                print 'FOUND %s' % z.to_sort()
                                vo = Voron( *u4min.rep )
                                eng( vo )
                            else:
                                print 'not wyck sublattice'