[EXTERNAL] Re: Hooke/Herz force and the problem of negative (attractive) forces

Dear Axel,

Thanks for your reply.

I cloned the lammps with

  git clone https://github.com/lammps/lammps.git

Then I just looked at the

src/GRANULAR/pair_gran_hertz_history.cpp

src/GRANULAR/pair_gran_hooke.cpp

src/GRANULAR/pair_gran_hooke_history.cpp

They all ALREADY have a line which prevents attractive forces:

i.e.:

  if (ccel < 0.0) ccel = 0.0;

So it seems this scheme is ALREADY include in the latest version.

this is not there, when i do it:

[[email protected] Downloads] git clone [email protected]\.\.\.7012\.\.\.:lammps/lammps\.git lammps Cloning into &#39;lammps&#39;\.\.\. remote: Counting objects: 176504, done\. remote: Total 176504 \(delta 1\), reused 1 \(delta 1\), pack\-reused 176502 Receiving objects: 100% \(176504/176504\), 405\.52 MiB | 3\.53 MiB/s, done\. Resolving deltas: 100% \(148881/148881\), done\. Checking connectivity\.\.\. done\. \[[email protected]\.\.\.7011\.\.\. Downloads\] cd lammps/
[[email protected] lammps]$ grep ccel src/GRANULAR/pair_gran_h*.cpp
src/GRANULAR/pair_gran_hertz_history.cpp: double
mi,mj,meff,damp,ccel,tor1,tor2,tor3;
src/GRANULAR/pair_gran_hertz_history.cpp: ccel =
kn*(radsum-r)*rinv - damp;
src/GRANULAR/pair_gran_hertz_history.cpp: ccel *= polyhertz;
src/GRANULAR/pair_gran_hertz_history.cpp: fn = xmu * fabs(ccel*r);
src/GRANULAR/pair_gran_hertz_history.cpp: fx = delx*ccel + fs1;
src/GRANULAR/pair_gran_hertz_history.cpp: fy = dely*ccel + fs2;
src/GRANULAR/pair_gran_hertz_history.cpp: fz = delz*ccel + fs3;
src/GRANULAR/pair_gran_hertz_history.cpp: double
mi,mj,meff,damp,ccel,polyhertz;
src/GRANULAR/pair_gran_hertz_history.cpp: ccel = kn*(radsum-r)*rinv - damp;
src/GRANULAR/pair_gran_hertz_history.cpp: ccel *= polyhertz;
src/GRANULAR/pair_gran_hertz_history.cpp: fn = xmu * fabs(ccel*r);
src/GRANULAR/pair_gran_hertz_history.cpp: fforce = ccel;
src/GRANULAR/pair_gran_hooke.cpp: double mi,mj,meff,damp,ccel,tor1,tor2,tor3;
src/GRANULAR/pair_gran_hooke.cpp: ccel = kn*(radsum-r)*rinv - damp;
src/GRANULAR/pair_gran_hooke.cpp: fn = xmu * fabs(ccel*r);
src/GRANULAR/pair_gran_hooke.cpp: fx = delx*ccel + fs1;
src/GRANULAR/pair_gran_hooke.cpp: fy = dely*ccel + fs2;
src/GRANULAR/pair_gran_hooke.cpp: fz = delz*ccel + fs3;
src/GRANULAR/pair_gran_hooke.cpp: double mi,mj,meff,damp,ccel;
src/GRANULAR/pair_gran_hooke.cpp: ccel = kn*(radsum-r)*rinv - damp;
src/GRANULAR/pair_gran_hooke.cpp: fn = xmu * fabs(ccel*r);
src/GRANULAR/pair_gran_hooke.cpp: fforce = ccel;
src/GRANULAR/pair_gran_hooke_history.cpp: double
mi,mj,meff,damp,ccel,tor1,tor2,tor3;
src/GRANULAR/pair_gran_hooke_history.cpp: ccel =
kn*(radsum-r)*rinv - damp;
src/GRANULAR/pair_gran_hooke_history.cpp: fn = xmu * fabs(ccel*r);
src/GRANULAR/pair_gran_hooke_history.cpp: fx = delx*ccel + fs1;
src/GRANULAR/pair_gran_hooke_history.cpp: fy = dely*ccel + fs2;
src/GRANULAR/pair_gran_hooke_history.cpp: fz = delz*ccel + fs3;
src/GRANULAR/pair_gran_hooke_history.cpp: double mi,mj,meff,damp,ccel;
src/GRANULAR/pair_gran_hooke_history.cpp: ccel = kn*(radsum-r)*rinv - damp;
src/GRANULAR/pair_gran_hooke_history.cpp: fn = xmu * fabs(ccel*r);
src/GRANULAR/pair_gran_hooke_history.cpp: fforce = ccel;

Now if I install this version Do I have the thing?

we have to figure out which version exactly it is that you have.
i.e. when did you do the clone? what do you get when you do: git branch -v
here is what i get with a fresh clone.

[[email protected] lammps]$ git branch -v
* master 5c13b08 Merge pull request #592 from akohlmey/reaxc-bugfix

Or should I do the rest of the commands as you explained:

i cannot reproduce what you are claiming. and i am *very* confident,
that this change never made it into the master branch, but was
committed and later reverted on a feature branch of mine before that
was merged. because of how we handle merges, the hash of the reverted
commit is still contained in the history and thus my suggestion to
reapply it can work (this is exactly why we do such "messy" merges).

axel.

I am sorry for inconvenience

I realized that I adapted more commands before so it changed the code.

I went into website and cancelled my email but apparently it went through.

I apologize again.

Yours
Habib.

I am sorry for inconvenience

I realized that I adapted more commands before so it changed the code.

I went into website and cancelled my email but apparently it went through.

the message held in moderation was indeed canceled. however, the
copies to dan, steve, and me were already delivered at the time.

I apologize again.

no big deal. just don't make it a habit. in fact, there is a useful
lesson here: if you are about to send a message contradicting what was
said before, be hesitant. double, triple, and quadruple check *before*
even sending. everybody makes mistakes, even the most experienced
people, but the odds for them to be right (and you to be wrong) are
usually massively in their favor. :wink:

axel.