If else statement for void FixWallGran::post_force_primitive(int vflag)

Submitted by mschramm on Mon, 05/22/2017 - 23:31

Hello,
I am debugging a segmentation fault error and have narrowed it down to when the function post_force_primitive calls the function vectorZeroizeN at line number 1104 in the file fix_wall_gran.cpp

My main question is, "what does this else statement do?".
if(deltan <= 0 || deltan < contactDistanceMultiplier*radius[iPart]){
stuff
}
else{
if(c_history){
vectorZeroizeN(c_history[iPart],dnum_);
}
}

Is there a way to check if c_history[iPart][i] exists?

Thank you!

arnom's picture

arnom | Mon, 06/12/2017 - 10:54

Hi,

to answer your question on what this statement does:

If a particle is in the neighbor list, but not inside of the influence radius of a primitive, its history values are reset.

There should not be a segfault here. Could you maybe post your case, so that I can have a look at the input script.

Cheers,
Arno

DCS team member & LIGGGHTS(R) core developer

mschramm | Mon, 06/12/2017 - 17:11

Hello,
This is happening with an edited version of Richti83's bond model. (I have altered the force calculation to include dampening).
The case is 25 mega-particles (composed of 5 atoms) are dropped at differing heights onto a primitive wall.

Converting the bond model to a multi-sphere problem resulted in the segfault vanishing. So the problem resides in one of the files needed for the bond model.
The segfault happens when running the the code with multiple processors.
Would you know what may be causing this?
If it's a segment of code is deleting the variable when crossing processor domains?

I have added both scripts to the original post.

arnom's picture

arnom | Tue, 06/27/2017 - 15:31

Hi,

I'm afraid I have no direct clue. You should certainly check that the contactDistanceMultiplier is set correctly.

As richie's bond model is not supported by us, I won't be able to investigate this matter in greater detail.

Best,
Arno

DCS team member & LIGGGHTS(R) core developer