~ubuntu-branches/debian/jessie/yade/jessie

« back to all changes in this revision

Viewing changes to pkg/dem/KinemCNDEngine.cpp

  • Committer: Package Import Robot
  • Author(s): Anton Gladky
  • Date: 2014-08-04 19:34:58 UTC
  • mfrom: (1.1.11)
  • Revision ID: package-import@ubuntu.com-20140804193458-cw8qhnujxe9wzi15
Tags: 1.11.0-1
* [a0600ae] Imported Upstream version 1.11.0
* [a3055e0] Do not use parallel build on kfreebsd-amd64 and s390x.
* [f86b405] Remove applied patches.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*************************************************************************
2
 
*  Copyright (C) 2008 by Jerome Duriez                                   *
3
 
*  jerome.duriez@hmg.inpg.fr                                             *
4
 
*                                                                        *
5
 
*  This program is free software; it is licensed under the terms of the  *
6
 
*  GNU General Public License v2 or later. See file LICENSE for details. *
7
 
*************************************************************************/
8
 
 
9
 
 
10
 
#include<yade/pkg/dem/KinemCNDEngine.hpp>
11
 
 
12
 
 
13
 
YADE_PLUGIN((KinemCNDEngine));
14
 
 
15
 
void KinemCNDEngine::action()
16
 
{
17
 
        KinemSimpleShearBox::getBoxes_Dt();
18
 
 
19
 
        if( ((shearSpeed > 0) && (gamma<=gammalim)) || ((shearSpeed < 0) /*&& (gamma>=gammalim)*/ ) )
20
 
        {
21
 
                if(temoinfin!=0)
22
 
                        temoinfin=0;
23
 
                letMove(shearSpeed * dt,0);
24
 
                gamma+=shearSpeed * dt;
25
 
        }
26
 
        else
27
 
        {
28
 
                stopMovement();
29
 
                if(temoinfin==0)
30
 
                {
31
 
                        Omega::instance().saveSimulation(Key + "endShear.xml");
32
 
                        temoinfin=1;
33
 
                }
34
 
        }
35
 
 
36
 
        for(unsigned int j=0;j<gamma_save.size();j++)
37
 
        {
38
 
                if ( ( ( (shearSpeed>0)&&(gamma > gamma_save[j]) ) || ((shearSpeed<0)&&(gamma < gamma_save[j])) ) && (temoin_save[j]==0) )
39
 
                {
40
 
                        stopMovement();         // reset of all the speeds before the save
41
 
                        Omega::instance().saveSimulation(Key+"_"+boost::lexical_cast<string> (floor(gamma*1000)) + "mmsheared.xml");
42
 
                        temoin_save[j]=1;
43
 
                }
44
 
        }
45
 
        
46
 
}
47
 
 
48
 
 
49
 
 
50
 
 
51
 
 
52
 
 
53