def main(): try: filename = sys.argv[1] except IndexError: print "No Filename given" sys.exit() try: R = float(sys.argv[2]) except IndexError: print "Using default R value" R = 25.0 a, b, c, atomRadius, nPerPart = 12.5, 12.5, 25, 1, 4684 areaDensity = 4*np.pi*(((a*b)**1.6 + (a*c)**1.6 + (b*c)**1.6)/3)**(1/1.6)/nPerPart sideLength = 4*R # generate a surface with a hole in the center surface = makeSurface(areaDensity, sideLength, R) # surface = np.around(surface,6) box = makeBox(3, surface) # generate index information for configuration file info = makeFile(surface) # combine coordinate and index info atoms = np.concatenate((info.astype('|S10'), surface.astype('|S10')), axis=1) # generate input files for lammps and VMD write_conf(filename+'_out', atoms, title='Surface with cut-out R = %d' % R, box=box) write_xyz(filename+'_out', atoms[:,2:])
def main(): try: filename = sys.argv[1] except IndexError: print "No Filename given" sys.exit() a, b, c, atomRadius, nPerPart = 12.5, 12.5, 25, 1, 4684 areaDensity = 4*np.pi*(((a*b)**1.6 + (a*c)**1.6 + (b*c)**1.6)/3)**(1/1.6)/nPerPart try: cylDims = (float(sys.argv[2]),100) except IndexError: cylDims = (25,100) print "Default R value used" # generate a cylinder with length L and radius R cylinder = makeCylinder(areaDensity, cylDims) box = makeBox(3, cylinder) # generate indices, molecule, and atom types info = makeFile(cylinder) # combine coordinate and index information atoms = np.concatenate((info.astype('|S10'), cylinder.astype('|S10')), axis=1) # generate input files for VMD and LAMMPS write_conf(filename+'_out', atoms, title='Capillary R = %d' % cylDims[0], box=box) write_xyz(filename+'_out', atoms[:,2:])