Beispiel #1
0
# load CG interaction from table
fe="table_CG_CG.tab"
gromacs.convertTable("table_CG_CG.xvg", fe, 1, 1, 1, 1)
potCG = espressopp.interaction.Tabulated(itype=3, filename=fe, cutoff=rca) # CG


# set the CG potential. There are two non-bonded interactions, we pick only the first one 
for n in range(system.getNumberOfInteractions()):
    interaction=system.getInteraction(n)
    if interaction.bondType() == espressopp.interaction.Nonbonded:
	print "Setting CG interaction", typeCG
	interaction.setPotentialCG(type1=typeCG, type2=typeCG, potential=potCG)
	break

#fpl = espressopp.FixedPairListAdress(system.storage, ftpl)
bondedinteractions=gromacs.setBondedInteractionsAdress(system, bondtypes, bondtypeparams, ftpl)



# 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)

# add VelocityVerlet Integrator
integrator = espressopp.integrator.VelocityVerlet(system)
integrator.dt = timestep

# add Langevin Thermostat
langevin = espressopp.integrator.LangevinThermostat(system)
langevin.gamma = 2.0
langevin.temperature = 2.4942 # kT in gromacs units
langevin.adress = True
Beispiel #2
0
# set up coarse-grained potential (an iterative Boltzmann Inversion potential)
potCG = espressopp.interaction.Tabulated(itype=3,
                                         filename="table_ibi.dat",
                                         cutoff=interaction_cutoff_cg)
interNBcg = espressopp.interaction.VerletListAdressCGTabulated(
    verletlist, ftpl)
interNBcg.setPotential(type1=typeCG, type2=typeCG, potential=potCG)
system.addInteraction(interNBcg)

# set up angle interactions
angleinteractions = gromacs.setAngleInteractionsAdress(system, angletypes,
                                                       angletypeparams, ftpl)

# set up bonded interactions
bondedinteractions = gromacs.setBondedInteractionsAdress(
    system, bondtypes, bondtypeparams, ftpl)

# verletlist exlusions, i.e. pairs of atoms not considered for the non-bonded force calculation
verletlist.exclude(exclusions)

#########################################
#  6. set up integration scheme and corrections  #
#########################################

print('Setting up integration scheme (RESPA velocity verlet integrator)...')
# set up the RESPA VelocityVerlet Integrator
integrator = espressopp.integrator.VelocityVerletRESPA(system)
integrator.dt = timestep
integrator.multistep = multistep

# add AdResS