def voropp_for_non_orthorhombic_cells(_a, q='<STR_LIT>', voropp_path=VOROPP_PATH,<EOL>fast=False, dump=None):
<EOL>a = _a.copy()<EOL>nat = len(a)<EOL>a.set_scaled_positions(a.get_scaled_positions()%<NUM_LIT:1.0>)<EOL>if '<STR_LIT>' in a.info:<EOL><INDENT>lx, ly, lz = a.get_cell().diagonal()<EOL>cx, cy, cz = a.get_cell()<EOL>assert abs(cz[<NUM_LIT:0>]) < <NUM_LIT><EOL>assert abs(cz[<NUM_LIT:1>]) < <NUM_LIT><EOL>shear_dx = a.info['<STR_LIT>']<EOL>cz[<NUM_LIT:0>] = shear_dx[<NUM_LIT:0>]<EOL>cz[<NUM_LIT:1>] = shear_dx[<NUM_LIT:1>]<EOL>a.set_cell([cx, cy, cz], scale_atoms=False)<EOL>a.set_scaled_positions(a.get_scaled_positions()%<NUM_LIT:1.0>)<EOL><DEDENT>cx, cy, cz = a.get_cell()<EOL>if fast:<EOL><INDENT>a *= ( <NUM_LIT:2>, <NUM_LIT:2>, <NUM_LIT:2> )<EOL>a.translate(cx/<NUM_LIT:2>+cy/<NUM_LIT:2>+cz/<NUM_LIT:2>)<EOL><DEDENT>else:<EOL><INDENT>a *= ( <NUM_LIT:3>, <NUM_LIT:3>, <NUM_LIT:3> )<EOL>a.translate(cx+cy+cz)<EOL><DEDENT>a.set_scaled_positions(a.get_scaled_positions()%<NUM_LIT:1.0>)<EOL>lower, upper = get_enclosing_orthorhombic_box(a.get_cell())<EOL>elx, ely, elz = upper-lower<EOL>a.translate(-lower)<EOL>a.set_cell([elx,ely,elz], scale_atoms=False)<EOL>if dump:<EOL><INDENT>write(dump, a)<EOL><DEDENT>x, y, z = a.get_positions().T<EOL>f = open('<STR_LIT>', '<STR_LIT:w>')<EOL>for jn, ( jx, jy, jz ) in enumerate(zip(x, y, z)):<EOL><INDENT>print >> f, jn, jx, jy, jz<EOL><DEDENT>f.close()<EOL>if isinstance(q, str) or isinstance(q, unicode):<EOL><INDENT>c = '<STR_LIT:%s>' % format(q)<EOL><DEDENT>else:<EOL><INDENT>c = reduce(lambda x,y: '<STR_LIT>'.format(x,y), map(lambda x: '<STR_LIT:%>'+x, q))<EOL><DEDENT>os.system('<STR_LIT>'.format(voropp_path, c, elx, ely, elz))<EOL>r = np.loadtxt('<STR_LIT>', unpack=True)<EOL>os.remove('<STR_LIT>')<EOL>os.remove('<STR_LIT>')<EOL>r = r[:,np.array(r[<NUM_LIT:0>,:], dtype=int)]<EOL>if r.shape[<NUM_LIT:0>] == <NUM_LIT:2>:<EOL><INDENT>return r[<NUM_LIT:1>,:nat]<EOL><DEDENT>else:<EOL><INDENT>return r[<NUM_LIT:1>:,:nat]<EOL><DEDENT>
Run voro++ on current configuration and return selected quantities.
Parameter *q* can be a list of voro++ output quantities.
Run 'voro++ -hc' to see options. Will take care of Lees-Edwards boundary
conditions by embedding a sheared cell in its periodic images and then
throwing away the border (will hence be slower).