How to subtract two pair_styles using pair_style hybrid/overlay

Hi all,

I need to use an effective potential which is subtraction of two different potentials already in lammps package. Is it possible to use pair_style hybrid/overlay for this purpose and if so then how can it be done !

phi = phi_A - phi_B

Both the potential forms are like coulomb form so they don’t have any multiplier coefficient which can be changed with sign + or -.

Is there any alternative method to do the same !

Thanks

Hi all,

I need to use an effective potential which is subtraction of two different
potentials already in lammps package. Is it possible to use pair_style
hybrid/overlay for this purpose and if so then how can it be done !

phi = phi_A - phi_B

Both the potential forms are like coulomb form so they don't have any
multiplier coefficient which can be changed with sign + or -.

Is there any alternative method to do the same !

both, the coul/cut and the coul/long pair style have a per atom type
scale factor that can be set with fix adapt. please see the respective
source code.

axel.

Axel,

Thanks for suggestion. I tried the one you suggested " fix adapt " for following:

phi = q1 q2 / eps r for coul cut

I wanted phi_new = A * q1 q2 / eps r

here I have all freedom to change a coeff A. Lets not touch the dielectric part eps. so I used command

variable scale1 A #Here A is constant
fix f1 all adapt 0 pair coul/cut scale * * v_scale1 scale yes reset no

But when I use pair_write to print potential form … it looks no changes made by fix adapt.

Axel,

Thanks for suggestion. I tried the one you suggested " fix adapt " for
following:

phi = q1 q2 / eps r for coul cut

I wanted phi_new = A * q1 q2 / eps r

here I have all freedom to change a coeff A. Lets not touch the dielectric
part eps. so I used command

variable scale1 A #Here A is constant
fix f1 all adapt 0 pair coul/cut scale * * v_scale1 scale yes reset no

But when I use pair_write to print potential form ... it looks no changes
made by fix adapt.

pair_write uses the Pair::single() method, whereas normally,
Pair:compute() is executed. a look in the sources reveals that the
scale factor is only applied in the latter case, but not in the
former.

axel.

Thanks for pointing out Axel,
For now I am trying to add it to Pair::single() for coul/cut in my source code package. But it would be great if this correction
can be included in package.

Hi Axel and others,

I am trying to add Scale to PairCoulCut:single() somewhat like:

phicoul = scale[itype][jtype] * (force->qqrd2e * atom->q[i]*atom->q[j]*rinv);

but it always takes the default values set in PairCoulCut:coeff() than what is should take from inputfile.
I cross checked it by changing default value.

The PairCoulCut:compute() takes correct value as given in input file as I could see by printing values.

I will appreciate pointing out the issue.

Thanks