openmm / openmm

OpenMM is a toolkit for molecular simulation using high performance GPU code.
1.48k stars 515 forks source link

Questions about the CustomNonBondedForce created by the CharmmPSFFile #4648

Open zhenyuwei99 opened 2 weeks ago

zhenyuwei99 commented 2 weeks ago

Hi,

I am running a simulation of the KCSA ion channel using the Charmm forcefield. I noticed that two nonbonded force classes exist in the system created by the CharmmPSFFile.createSystem Method. The document states that the NonbondedForce calculates the LJ and electrostatic interaction. However, when I get the parameter from nonbondedForce.getParticleParameters(index), the epsilon is 0 for all particles, as shown here:

[Quantity(value=0.09, unit=elementary charge), Quantity(value=1.0, unit=nanometer), Quantity(value=0.0, unit=kilojoule/mole)]

And the CustomNonbondedForce.getEnergyFunction() returns:

(a/r6)^2-b/r6; r6=r^6;a=acoef(type1, type2);b=bcoef(type1, type2)

I am wondering why to separate the LJ and electrostatic into two parts.

Best,

peastman commented 2 weeks ago

That happens when the force field involves NBFIX terms: particular pairs of atom types whose LJ interaction is computed with different parameters than what the standard combining rules would give. NonbondedForce doesn't support that, so it implements the LJ interaction with a CustomNonbondedForce instead.