~ubuntu-branches/ubuntu/trusty/yade/trusty

« back to all changes in this revision

Viewing changes to pkg/dem/CohesiveStateRPMRecorder.cpp

  • Committer: Package Import Robot
  • Author(s): Anton Gladky, cf3f8d9
  • Date: 2013-10-30 20:56:33 UTC
  • mfrom: (20.1.9 sid)
  • Revision ID: package-import@ubuntu.com-20131030205633-1f01r7hjce17d723
Tags: 1.05.0-2
[cf3f8d9] Pass -ftrack-macro-expansion=0 only if gcc>=4.8. (Closes: #726009)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#include"CohesiveStateRPMRecorder.hpp"
2
 
 
3
 
YADE_PLUGIN((CohesiveStateRPMRecorder));
4
 
CREATE_LOGGER(CohesiveStateRPMRecorder);
5
 
 
6
 
void CohesiveStateRPMRecorder::action() {
7
 
        numberCohesiveContacts=0;
8
 
        //Check all interactions
9
 
        FOREACH(const shared_ptr<Interaction>& i, *scene->interactions){
10
 
                if(!i->isReal()) continue;                              //Check whether they are real
11
 
                const shared_ptr<RpmPhys>& contPhys = YADE_PTR_CAST<RpmPhys>(i->phys);
12
 
                if (contPhys->isCohesive==true) {       //Check whether they are cohesive
13
 
                        numberCohesiveContacts++;                               //If yes - calculate them
14
 
                }
15
 
        }
16
 
        //Save data to a file
17
 
        out<<scene->iter<<" "<<numberCohesiveContacts<<"\n";
18
 
        out.close();
19
 
}