Multisphere/break bug when using variable trigger type

Submitted by mschramm on Sat, 01/25/2020 - 17:47

Hello,
I believe there is a bug when using the variable trigger in multisphere break at the following location:
https://github.com/CFDEMproject/LIGGGHTS-PUBLIC/blob/master/src/fix_mult...

I think the line always assumes that you are using a fix. However when using a variable, the code
update->ntimestep % (modify->fix[triggerIdx_]->peratom_freq
becomes undefined because "(modify->fix[triggerIdx_]->peratom_freq = 0" giving us k%0 division errors.
Below is a proposed fix to the bug that simply checks that we are using a fix.
if (triggerType_ == FIX)
if (triggerName_ && update->ntimestep % (modify->fix[triggerIdx_]->peratom_freq))
error->all(FLERR,"Fix used in fix multisphere/break not computed at compatible time");

Attached is a modified multisphere_stone_restitution input file using the height of the atoms in a variable as the trigger.

AttachmentSize
Plain text icon in.multisphere.txt2.08 KB