piecewise contact details

Submitted by mkt1363 on Thu, 02/26/2015 - 07:42

Hi,

I have to define a global variable in Pair_gran_hooke to be used in a compute source file. I have tried many ways but I did not succeed. How is that possible?

Thanks
Mohammad

JoshuaP | Thu, 02/26/2015 - 10:01

hey,

it sounds similar to my problem. Maybe it helps look at the last comment

one possibility is to write a get function in pair_gran_hooke src or a set function in compute src. There is no need of a global variable then.

regards

mkt1363 | Tue, 03/17/2015 - 11:35

Dear Joshua,

I tried to add a function in pair_gran_hook but I can't succeed to get it as an output. all I need is available in pair_gran_hook , I just need to output the value in some way.
would you kindly give me more tips and suggestions in this regard.

Thank you in advance
Mohammad

mkt1363 | Tue, 03/17/2015 - 13:06

I need binary contact details in order to decide how many of the neighbors are in enduring contact and how many are in instantanuous contact. this could be done using a criteria on tangential and normal components of each contacts before it is integrated.
I can access this information in Pair_gran_hook_history , I can use a counter that whenever the criteria fulfilled a counter would be added up. it can be simply done. The question is how to extract this number and take it as an output.

Thanks
Mohammad

mkt1363 | Tue, 03/17/2015 - 13:17

Dear Joshua,

Here is the part I added to the source code:
I have defined the parameter endure as a "double" variable and it is calculated at pair_gran_hook_history.cpp as below:

.
.
.
if (fs > fn) {
if (shrmag != 0.0) {
fs1 *= fn/fs;
fs2 *= fn/fs;
fs3 *= fn/fs;
shear[0] = -fs1/kt;
shear[1] = -fs2/kt;
shear[2] = -fs3/kt;
}
else fs1 = fs2 = fs3 = 0.0;
}
else
{
fs1 -= (gammat*vtr1);
fs2 -= (gammat*vtr2);
fs3 -= (gammat*vtr3);

endure +=1.0;

for each of the contacts which fulfil the criteria fs