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
A project by DCS Computing and CFDEMresearch
This website uses cookies to ensure you get the best experience on our website. By continuing to browse the site you are agreeing to our use of cookies. This website uses cookies. By continuing to browse the site you are agreeing to our use of cookies. More info
JoshuaP | Thu, 02/26/2015 - 10:01
hey,
hey,
it sounds similar to my problem. Maybe it helps look at the last comment
http://www.cfdem.com/forums/spring-dashpot-boundary
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
get function
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
JoshuaP | Tue, 03/17/2015 - 11:51
pls tell me in which compute
pls tell me in which compute file you want to use a variable from pair_gran_hook?
mkt1363 | Tue, 03/17/2015 - 13:06
function
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
The code
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