rc = 1.12 skin = 0.3 # skin for Verlet lists nvt = True timestep = 0.01 spline = 2 # spline interpolation type (1, 2, 3) conffile = 'polymer_melt.start' # file with inital configuration tabfileLJ = "pot-lj.txt" tabfileFENE = "pot-fene.txt" tabfileCosine = "pot-cosine.txt" ###################################################################### ## IT SHOULD BE UNNECESSARY TO MAKE MODIFICATIONS BELOW THIS LINE ## ###################################################################### bonds, angles, x, y, z, Lx, Ly, Lz = lammps.read(conffile) num_particles = len(x) density = num_particles / (Lx * Ly * Lz) size = (Lx, Ly, Lz) print '\n-- Tabulated Potentials Test --\n' print 'Steps: %3s' % steps print 'Particles: %3s' % num_particles print 'Cutoff: %3s' % rc print 'Density = %.4f' % (density) print 'dt =', timestep print 'Skin =', skin print 'nvt =', nvt # writes the tabulated file
from espressopp.tools import timers # logging.getLogger("Storage").setLevel(logging.INFO) # simulation parameters (nvt = False implies NVE) steps = 10 rc = 2.5 skin = 0.3 nvt = False timestep = 0.005 ###################################################################### ### IT SHOULD BE UNNECESSARY TO MAKE MODIFICATIONS BELOW THIS LINE ### ###################################################################### sys.stdout.write('Setting up simulation ...\n') x, y, z, Lx, Ly, Lz, vx, vy, vz = lammps.read('espressopp_lennard_jones.start') num_particles = len(x) density = num_particles / (Lx * Ly * Lz) size = (Lx, Ly, Lz) system = espressopp.System() system.rng = espressopp.esutil.RNG() system.bc = espressopp.bc.OrthorhombicBC(system.rng, size) system.skin = skin comm = MPI.COMM_WORLD nodeGrid = decomp.nodeGrid(comm.size, size, rc, skin) cellGrid = decomp.cellGrid(size, nodeGrid, rc, skin) system.storage = espressopp.storage.DomainDecomposition( system, nodeGrid, cellGrid) # add particles to the system and then decompose props = ['id', 'type', 'mass', 'pos', 'v']
skin = 0.3 nvt = True timestep = 0.01 # run with "tlj tfene tcos" to activate tabulated potentials tabfileLJ = "pot-lj.txt" tabfileFENE = "pot-fene.txt" tabfileCosine = "pot-cosine.txt" spline = 2 # spline interpolation type (1, 2, 3) ###################################################################### ## IT SHOULD BE UNNECESSARY TO MAKE MODIFICATIONS BELOW THIS LINE ## ###################################################################### sys.stdout.write('Setting up simulation ...\n') bonds, angles, x, y, z, Lx, Ly, Lz = lammps.read('espressopp_polymer_melt.start') num_particles = len(x) density = num_particles / (Lx * Ly * Lz) size = (Lx, Ly, Lz) system = espressopp.System() system.rng = espressopp.esutil.RNG(54321) system.bc = espressopp.bc.OrthorhombicBC(system.rng, size) system.skin = skin comm = MPI.COMM_WORLD nodeGrid = decomp.nodeGrid(comm.size,size,rc,skin) cellGrid = decomp.cellGrid(size, nodeGrid, rc, skin) system.storage = espressopp.storage.DomainDecomposition(system, nodeGrid, cellGrid) # add particles to the system and then decompose for pid in range(num_particles): system.storage.addParticle(pid + 1, Real3D(x[pid], y[pid], z[pid]))
# logging.getLogger("Storage").setLevel(logging.INFO) # simulation parameters (nvt = False implies NVE) steps = 10 rc = 2.5 skin = 0.3 nvt = False timestep = 0.005 ###################################################################### ### IT SHOULD BE UNNECESSARY TO MAKE MODIFICATIONS BELOW THIS LINE ### ###################################################################### sys.stdout.write('Setting up simulation ...\n') x, y, z, Lx, Ly, Lz, vx, vy, vz = lammps.read('espressopp_lennard_jones.start') num_particles = len(x) density = num_particles / (Lx * Ly * Lz) size = (Lx, Ly, Lz) system = espressopp.System() system.rng = espressopp.esutil.RNG() system.bc = espressopp.bc.OrthorhombicBC(system.rng, size) system.skin = skin comm = MPI.COMM_WORLD nodeGrid = decomp.nodeGrid(comm.size,size,rc,skin) cellGrid = decomp.cellGrid(size, nodeGrid, rc, skin) system.storage = espressopp.storage.DomainDecomposition(system, nodeGrid, cellGrid) # add particles to the system and then decompose props = ['id', 'type', 'mass', 'pos', 'v'] new_particles = []
equi_nloops = 200 equi_isteps = 50 # number of prod loops prod_nloops = 50 #200 # number of integration steps performed in each production loop prod_isteps = 10 Nx=1 # number of duplication Ny=1 # number of duplication Nz=1 # number of duplication ###################################################################### ### IT SHOULD BE UNNECESSARY TO MAKE MODIFICATIONS BELOW THIS LINE ### ###################################################################### sys.stdout.write('Setting up simulation ...\n') bonds, angles, x, y, z, Lx, Ly, Lz = lammps.read('polymer_melt.lammps') bonds, angles, x, y, z, Lx, Ly, Lz = replicate(bonds, angles, x, y, z, Lx, Ly, Lz, xdim=Nx, ydim=Ny, zdim=Nz) num_particles = len(x) density = num_particles / (Lx * Ly * Lz) size = (Lx, Ly, Lz) system = espressopp.System() system.rng = espressopp.esutil.RNG() system.bc = espressopp.bc.OrthorhombicBC(system.rng, size) system.skin = skin comm = MPI.COMM_WORLD nodeGrid = espressopp.tools.decomp.nodeGrid(comm.size,size,rc,skin) cellGrid = espressopp.tools.decomp.cellGrid(size,nodeGrid,rc,skin) system.storage = espressopp.storage.DomainDecomposition(system, nodeGrid, cellGrid) print("NCPUs = ", comm.size)