# create a force capped Lennard-Jones interaction that uses a verlet list verletlist = espresso.VerletList(system, rc) interaction = espresso.interaction.VerletListLennardJonesGromacs(verletlist) # add particles to the system and then decompose props = ['id', 'pos', 'v', 'type', 'mass', 'q'] allParticles = [] for pid in range(num_particles): part = [pid + 1, Real3D(x[pid], y[pid], z[pid]), Real3D(vx[pid], vy[pid], vz[pid]), types[pid], masses[pid], charges[pid]] allParticles.append(part) system.storage.addParticles(allParticles, *props) system.storage.decompose() # set up LJ interaction according to the parameters read from the .top file ljinteraction=gromacs.setLennardJonesInteractions(system, defaults, atomtypeparameters, verletlist,rc) # set up angle interactions according to the parameters read from the .top file angleinteractions=gromacs.setAngleInteractions(system, angletypes, angletypeparams) # set up coulomb interactions according to the parameters read from the .top file # !! Warning: this only works for reaction-field now! qq_interactions=gromacs.setCoulombInteractions(system, verletlist, rc, types, epsilon1=1, epsilon2=80, kappa=0) # set up bonded interactions according to the parameters read from the .top file bondedinteractions=gromacs.setBondedInteractions(system, bondtypes, bondtypeparams) # exlusions, i.e. pairs of atoms not considered for the non-bonded part. Those are defined either by bonds which automatically generate an exclusion. Or by the nregxcl variable verletlist.exclude(exclusions) # langevin thermostat
# append tuple to tuplelist tuples.append(tmptuple) system.storage.addParticles(allParticles, *props) # create FixedTupleList object ftpl = espresso.FixedTupleListAdress(system.storage) # and add the tuples ftpl.addTuples(tuples) system.storage.setFixedTuplesAdress(ftpl) system.storage.decompose() # set up LJ interaction according to the parameters read from the .top file ljinteraction=gromacs.setLennardJonesInteractions(system, defaults, atomtypeparameters, verletlist,rca, hadress=True, ftpl=ftpl) # set up angle interactions according to the parameters read from the .top file fpl = espresso.FixedTripleListAdress(system.storage, ftpl) angleinteractions=gromacs.setAngleInteractions(system, angletypes, angletypeparams, fpl) # set up coulomb interactions according to the parameters read from the .top file # !! Warning: this only works for reaction-field now! qq_interactions=gromacs.setCoulombInteractions(system, verletlist, rca, types, epsilon1=1, epsilon2=80, kappa=0, hadress=True, ftpl=ftpl) # load CG interaction from table fe="table_CG_CG.tab" gromacs.convertTable("table_CG_CG.xvg", fe, 1, 1, 1, 1) potCG = espresso.interaction.Tabulated(itype=3, filename=fe, cutoff=rca) # CG