> I want to calculate the total number of cohesive contacts in my
> model. 
> How can I declare the global variable for that? 

No globals, sorry. You can make a variable static in some of your
classes, but it is discouraged in general (e.g. you would not be able to
use O.switchWorld() consistently). You have to update that number
somehow, anyways.
 
If you need that number just once in a while, count the interactions
like this:

long n=0;
FOREACH(const shared_ptr<Interaction>& I, *rootBody->interaction){ 
if(I->isReal()) n++; }

In python, you can use O.interactions.countReal().

HTH, Vaclav


_______________________________________________
Mailing list: https://launchpad.net/~yade-users
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~yade-users
More help   : https://help.launchpad.net/ListHelp
_______________________________________________
yade-users mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/yade-users

Reply via email to