yade-dev team mailing list archive
-
yade-dev team
-
Mailing list archive
-
Message #11055
[Branch ~yade-pkg/yade/git-trunk] Rev 4079: Join all KinemC*Engine.* into KinemC__Engine.*
------------------------------------------------------------
revno: 4079
committer: Anton Gladky <gladky.anton@xxxxxxxxx>
timestamp: Mon 2014-07-14 22:08:34 +0200
message:
Join all KinemC*Engine.* into KinemC__Engine.*
removed:
pkg/dem/KinemCNDEngine.cpp
pkg/dem/KinemCNDEngine.hpp
pkg/dem/KinemCNLEngine.cpp
pkg/dem/KinemCNLEngine.hpp
pkg/dem/KinemCNSEngine.cpp
pkg/dem/KinemCNSEngine.hpp
pkg/dem/KinemCTDEngine.cpp
pkg/dem/KinemCTDEngine.hpp
added:
pkg/dem/KinemC__Engine.cpp
pkg/dem/KinemC__Engine.hpp
modified:
pkg/dem/SimpleShear.cpp
--
lp:yade
https://code.launchpad.net/~yade-pkg/yade/git-trunk
Your team Yade developers is subscribed to branch lp:yade.
To unsubscribe from this branch go to https://code.launchpad.net/~yade-pkg/yade/git-trunk/+edit-subscription
=== removed file 'pkg/dem/KinemCNDEngine.cpp'
--- pkg/dem/KinemCNDEngine.cpp 2014-05-23 13:05:19 +0000
+++ pkg/dem/KinemCNDEngine.cpp 1970-01-01 00:00:00 +0000
@@ -1,53 +0,0 @@
-/*************************************************************************
-* Copyright (C) 2008 by Jerome Duriez *
-* jerome.duriez@xxxxxxxxxxx *
-* *
-* This program is free software; it is licensed under the terms of the *
-* GNU General Public License v2 or later. See file LICENSE for details. *
-*************************************************************************/
-
-
-#include<yade/pkg/dem/KinemCNDEngine.hpp>
-
-
-YADE_PLUGIN((KinemCNDEngine));
-
-void KinemCNDEngine::action()
-{
- KinemSimpleShearBox::getBoxes_Dt();
-
- if( ((shearSpeed > 0) && (gamma<=gammalim)) || ((shearSpeed < 0) /*&& (gamma>=gammalim)*/ ) )
- {
- if(temoinfin!=0)
- temoinfin=0;
- letMove(shearSpeed * dt,0);
- gamma+=shearSpeed * dt;
- }
- else
- {
- stopMovement();
- if(temoinfin==0)
- {
- Omega::instance().saveSimulation(Key + "endShear.xml");
- temoinfin=1;
- }
- }
-
- for(unsigned int j=0;j<gamma_save.size();j++)
- {
- if ( ( ( (shearSpeed>0)&&(gamma > gamma_save[j]) ) || ((shearSpeed<0)&&(gamma < gamma_save[j])) ) && (temoin_save[j]==0) )
- {
- stopMovement(); // reset of all the speeds before the save
- Omega::instance().saveSimulation(Key+"_"+boost::lexical_cast<string> (floor(gamma*1000)) + "mmsheared.xml");
- temoin_save[j]=1;
- }
- }
-
-}
-
-
-
-
-
-
-
=== removed file 'pkg/dem/KinemCNDEngine.hpp'
--- pkg/dem/KinemCNDEngine.hpp 2011-04-12 22:06:51 +0000
+++ pkg/dem/KinemCNDEngine.hpp 1970-01-01 00:00:00 +0000
@@ -1,38 +0,0 @@
-/*************************************************************************
-* Copyright (C) 2008 by Jerome Duriez *
-* jerome.duriez@xxxxxxxxxxx *
-* *
-* This program is free software; it is licensed under the terms of the *
-* GNU General Public License v2 or later. See file LICENSE for details. *
-*************************************************************************/
-
-#pragma once
-
-#include<yade/pkg/dem/KinemSimpleShearBox.hpp>
-
-
-class KinemCNDEngine : public KinemSimpleShearBox
-{
- private :
- int temoinfin;
-
-
-
- public :
- void action();
-
- protected :
-
- YADE_CLASS_BASE_DOC_ATTRS_CTOR(KinemCNDEngine,KinemSimpleShearBox,
- "To apply a Constant Normal Displacement (CND) shear for a parallelogram box\n\n \tThis engine, designed for simulations implying a simple shear box (:yref:`SimpleShear` Preprocessor or scripts/simpleShear.py), allows one to perform a constant normal displacement shear, by translating horizontally the upper plate, while the lateral ones rotate so that they always keep contact with the lower and upper walls.",
- ((Real,shearSpeed,0.0,,"the speed at which the shear is performed : speed of the upper plate [m/s]"))
- ((Real,gammalim,0.0,,"the value of the tangential displacement at wich the displacement is stopped [m]"))
- ((Real,gamma,0.0,,"the current value of the tangential displacement"))
- ((std::vector<Real>,gamma_save,,,"vector with the values of gamma at which a save of the simulation is performed [m]")),
- temoinfin=0;
- );
-};
-
-REGISTER_SERIALIZABLE(KinemCNDEngine);
-
-
=== removed file 'pkg/dem/KinemCNLEngine.cpp'
--- pkg/dem/KinemCNLEngine.cpp 2014-05-23 13:05:19 +0000
+++ pkg/dem/KinemCNLEngine.cpp 1970-01-01 00:00:00 +0000
@@ -1,61 +0,0 @@
-/*************************************************************************
-* Copyright (C) 2008 by Jerome Duriez *
-* jerome.duriez@xxxxxxxxxxx *
-* *
-* This program is free software; it is licensed under the terms of the *
-* GNU General Public License v2 or later. See file LICENSE for details. *
-*************************************************************************/
-
-#include<yade/pkg/dem/KinemCNLEngine.hpp>
-
-
-YADE_PLUGIN((KinemCNLEngine));
-
-void KinemCNLEngine::action()
-{
- if(LOG) cout << "debut applyCondi du CNCEngine !!" << endl;
- KinemSimpleShearBox::getBoxes_Dt();
-
- if(LOG) cout << "gamma = " << boost::lexical_cast<string>(gamma) << " et gammalim = " << boost::lexical_cast<string>(gammalim) << endl;
- if(gamma<=gammalim)
- {
- if(LOG) cout << "Je suis bien dans la partie gamma < gammalim" << endl;
- if(temoin==0)
-
- {
- if(LOG) cout << "Je veux maintenir la Force a f0 = : " << f0 << endl;
- temoin=1;
- }
- computeDY(0.0);
-
- letMove(shearSpeed*dt,deltaH);
- gamma+=shearSpeed * dt;
-
- }
- else if (temoin<2)
- {
- stopMovement(); // INDISPENSABLE !
- it_stop=scene->iter;
- cout << "Shear stopped : gammaLim reached at it "<< it_stop << endl;
- temoin=2;
- }
- else if (temoin==2 && (scene->iter==(it_stop+5000)) )
- {
- Omega::instance().saveSimulation(Key + "endShear" +boost::lexical_cast<string> ( scene->iter ) + ".xml");
- Omega::instance().pause();
- }
-
- for(unsigned int j=0;j<gamma_save.size();j++)
- {
- if ((gamma > gamma_save[j]) && (temoin_save[j]==0))
- {
- stopMovement(); // reset of all the speeds before the save
- Omega::instance().saveSimulation(Key+"_"+boost::lexical_cast<string> (floor(gamma*1000)) +"_" +boost::lexical_cast<string> (floor(gamma*10000)-10*floor(gamma*1000))+ "mmsheared.xml");
- temoin_save[j]=1;
- }
- }
-
-}
-
-
-
=== removed file 'pkg/dem/KinemCNLEngine.hpp'
--- pkg/dem/KinemCNLEngine.hpp 2011-04-12 22:06:51 +0000
+++ pkg/dem/KinemCNLEngine.hpp 1970-01-01 00:00:00 +0000
@@ -1,43 +0,0 @@
-/*************************************************************************
-* Copyright (C) 2008 by Jerome Duriez *
-* jerome.duriez@xxxxxxxxxxx *
-* *
-* This program is free software; it is licensed under the terms of the *
-* GNU General Public License v2 or later. See file LICENSE for details. *
-*************************************************************************/
-
-#pragma once
-
-#include<yade/pkg/dem/KinemSimpleShearBox.hpp>
-
-
-
-
-class KinemCNLEngine : public KinemSimpleShearBox
-{
- private :
-
- int temoin,// utile pour savoir ou on en est
- it_stop
- ;
-
- public :
- void action()
- ;
-
-
- YADE_CLASS_BASE_DOC_ATTRS_CTOR(KinemCNLEngine,KinemSimpleShearBox,
- "To apply a constant normal stress shear (i.e. Constant Normal Load : CNL) for a parallelogram box (simple shear box : :yref:`SimpleShear` Preprocessor or scripts/simpleShear.py)\n\nThis engine allows one to translate horizontally the upper plate while the lateral ones rotate so that they always keep contact with the lower and upper walls.\n\nIn fact the upper plate can move not only horizontally but also vertically, so that the normal stress acting on it remains constant (this constant value is not chosen by the user but is the one that exists at the beginning of the simulation)\n\nThe right vertical displacements which will be allowed are computed from the rigidity Kn of the sample over the wall (so to cancel a deltaSigma, a normal dplt deltaSigma*S/(Kn) is set)\n\nThe movement is moreover controlled by the user via a *shearSpeed* which will be the speed of the upper wall, and by a maximum value of horizontal displacement *gammalim*, after which the shear stops.\n\n.. note::\n\tNot only the positions of walls are updated but also their speeds, which is all but useless considering the fact that in the contact laws these velocities of bodies are used to compute values of tangential relative displacements.\n\n.. warning::\n\tBecause of this last point, if you want to use later saves of simulations executed with this Engine, but without that stopMovement was executed, your boxes will keep their speeds => you will have to cancel them 'by hand' in the .xml.\n",
- ((Real,shearSpeed,0.0,,"the speed at wich the shearing is performed : speed of the upper plate [m/s]"))
- ((Real,gammalim,0.0,,"the value of tangential displacement (of upper plate) at wich the shearing is stopped [m]"))
- ((Real,gamma,0.0,,"current value of tangential displacement [m]"))
- ((std::vector<Real>,gamma_save,,,"vector with the values of gamma at which a save of the simulation is performed [m]")),
-// ((Real,coeff_dech,1.0,,"in the case of the use of 'Law2_ScGeom6D_NormalInelasticityPhys_NormalInelasticity' for ex, where kn(unload)#kn(load). The engine cares to find the value at the first run BROKEN actually")),
- temoin=0;
- it_stop=0;
- );
-};
-
-REGISTER_SERIALIZABLE(KinemCNLEngine);
-
-
=== removed file 'pkg/dem/KinemCNSEngine.cpp'
--- pkg/dem/KinemCNSEngine.cpp 2014-05-23 13:05:19 +0000
+++ pkg/dem/KinemCNSEngine.cpp 1970-01-01 00:00:00 +0000
@@ -1,51 +0,0 @@
-/*************************************************************************
-* Copyright (C) 2008 by Jerome Duriez *
-* jerome.duriez@xxxxxxxxxxx *
-* *
-* This program is free software; it is licensed under the terms of the *
-* GNU General Public License v2 or later. See file LICENSE for details. *
-*************************************************************************/
-
-
-
-#include<yade/pkg/dem/KinemCNSEngine.hpp>
-
-
-YADE_PLUGIN((KinemCNSEngine));
-
-
-void KinemCNSEngine::action()
-{
- if(LOG) cerr << "debut applyCondi !!" << endl;
- KinemSimpleShearBox::getBoxes_Dt();
-
- if(gamma<=gammalim)
- {
- computeDY(KnC);
- letMove(shearSpeed * dt,deltaH);
- gamma+=shearSpeed * dt;
- if(temoin==0)
- {
- temoin=1;
- }
- }
- else if (temoin<2)
- {
- stopMovement(); // INDISPENSABLE !
- it_stop=scene->iter;
- cout << "Cisaillement arrete : gammaLim atteint a l'iteration "<< it_stop << endl;
- temoin=2;
- }
- else if (temoin==2 && (scene->iter==(it_stop+5000)) )
- {
- Omega::instance().saveSimulation(Key + "finCis" +boost::lexical_cast<string> (scene->iter ) + ".xml");
- Omega::instance().pause();
- }
-
-}
-
-
-
-
-
-
=== removed file 'pkg/dem/KinemCNSEngine.hpp'
--- pkg/dem/KinemCNSEngine.hpp 2011-04-12 22:06:51 +0000
+++ pkg/dem/KinemCNSEngine.hpp 1970-01-01 00:00:00 +0000
@@ -1,41 +0,0 @@
-/*************************************************************************
-* Copyright (C) 2008 by Jerome Duriez *
-* jerome.duriez@xxxxxxxxxxx *
-* *
-* This program is free software; it is licensed under the terms of the *
-* GNU General Public License v2 or later. See file LICENSE for details. *
-*************************************************************************/
-
-#pragma once
-
-#include<yade/pkg/dem/KinemSimpleShearBox.hpp>
-
-
-
-class KinemCNSEngine : public KinemSimpleShearBox
-{
- private :
- int temoin,it_stop
- ;
-
- public :
- void action()
- ;
-
-
-
- YADE_CLASS_BASE_DOC_ATTRS_CTOR(KinemCNSEngine,KinemSimpleShearBox,
- "To apply a Constant Normal Stifness (CNS) shear for a parallelogram box (simple shear)\n\nThis engine, useable in simulations implying one deformable parallelepipedic box, allows one to translate horizontally the upper plate while the lateral ones rotate so that they always keep contact with the lower and upper walls. The upper plate can move not only horizontally but also vertically, so that the normal rigidity defined by DeltaF(upper plate)/DeltaU(upper plate) = constant (= *KnC* defined by the user).\n\nThe movement is moreover controlled by the user via a *shearSpeed* which is the horizontal speed of the upper wall, and by a maximum value of horizontal displacement *gammalim* (of the upper plate), after which the shear stops.\n\n.. note::\n\t not only the positions of walls are updated but also their speeds, which is all but useless considering the fact that in the contact laws these velocities of bodies are used to compute values of tangential relative displacements.\n\n.. warning::\n\tBut, because of this last point, if you want to use later saves of simulations executed with this Engine, but without that stopMovement was executed, your boxes will keep their speeds => you will have to cancel them by hand in the .xml",
- ((Real,shearSpeed,0.0,,"the speed at wich the shearing is performed : speed of the upper plate [m/s]"))
- ((Real,gammalim,0.0,,"the value of tangential displacement (of upper plate) at wich the shearing is stopped [m]"))
- ((Real,gamma,0.0,,"current value of tangential displacement [m]"))
- ((Real,KnC,10.0e6,,"the normal rigidity chosen by the user [MPa/mm] - the conversion in Pa/m will be made")),
- temoin=0;
- it_stop=0;
- );
-
-};
-
-REGISTER_SERIALIZABLE(KinemCNSEngine);
-
-
=== removed file 'pkg/dem/KinemCTDEngine.cpp'
--- pkg/dem/KinemCTDEngine.cpp 2014-05-23 13:05:19 +0000
+++ pkg/dem/KinemCTDEngine.cpp 1970-01-01 00:00:00 +0000
@@ -1,73 +0,0 @@
-/*************************************************************************
-* Copyright (C) 2008 by Jerome Duriez *
-* jerome.duriez@xxxxxxxxxxx *
-* *
-* This program is free software; it is licensed under the terms of the *
-* GNU General Public License v2 or later. See file LICENSE for details. *
-*************************************************************************/
-
-#include<yade/pkg/dem/KinemCTDEngine.hpp>
-
-
-YADE_PLUGIN((KinemCTDEngine));
-
-KinemCTDEngine::~KinemCTDEngine()
-{
-}
-
-void KinemCTDEngine::action()
-{
- KinemSimpleShearBox::getBoxes_Dt();
-
-
- scene->forces.sync();
- Real current_NormalForce=(scene->forces.getForce(id_topbox)).y();
- KinemSimpleShearBox::computeScontact();
- current_sigma=current_NormalForce/(1000.0*Scontact); // so we have the current value of sigma, in kPa
-
- if( ((compSpeed > 0) && (current_sigma < targetSigma)) || ((compSpeed < 0) && (current_sigma > targetSigma)) )
- {
- if(temoin!=0)
- {
-// cout << "j'ai ici un temoin #0 visiblement. En effet temoin =" <<boost::lexical_cast<string>(temoin) << endl;
- temoin=0;
-// cout << "Maintenant (toujours dans le if temoin!=0), temoin =" <<boost::lexical_cast<string>(temoin) << endl;
- }
-
- letMove(0.0,-compSpeed*dt);
- }
- else if (temoin==0)
- {
- stopMovement();
-// cout << "Mouvement stoppe, temoin = " << boost::lexical_cast<string>(temoin) << endl;
-// cout << " Dans le if, temoin =" << boost::lexical_cast<string>(temoin) << endl;
- string f;
- if (compSpeed > 0)
- f="Sigmax_";
- else
- f="Sigmin_";
-
- Omega::instance().saveSimulation(Key + f +boost::lexical_cast<string> (floor(targetSigma)) + "kPaReached.xml");
- temoin=1;
-// cout << " Fin du if, temoin =" << boost::lexical_cast<string>(temoin) << endl << endl;
- }
-
-
- for(unsigned int j=0;j<sigma_save.size();j++)
- {
- if( ( ( (compSpeed>0)&&(current_sigma > sigma_save[j]) ) || ((compSpeed<0)&&(current_sigma < sigma_save[j])) ) && (temoin_save[j]==0))
- {
- stopMovement();
- Omega::instance().saveSimulation(Key + "SigInt_" +boost::lexical_cast<string> (floor(current_sigma)) + "kPareached.xml");
- temoin_save[j]=1;
- }
- }
-// cout << "Fin de ApplyCondi, temoin = " << boost::lexical_cast<string>(temoin) << endl;
-
-}
-
-
-
-
-
-
=== removed file 'pkg/dem/KinemCTDEngine.hpp'
--- pkg/dem/KinemCTDEngine.hpp 2013-05-29 09:48:51 +0000
+++ pkg/dem/KinemCTDEngine.hpp 1970-01-01 00:00:00 +0000
@@ -1,41 +0,0 @@
-/*************************************************************************
-* Copyright (C) 2008 by Jerome Duriez *
-* jerome.duriez@xxxxxxxxxxx *
-* *
-* This program is free software; it is licensed under the terms of the *
-* GNU General Public License v2 or later. See file LICENSE for details. *
-*************************************************************************/
-
-#pragma once
-
-#include<yade/pkg/dem/KinemSimpleShearBox.hpp>
-
-
-class KinemCTDEngine : public KinemSimpleShearBox
-{
- private :
- Real current_sigma // Computed in kPa
- ;
-
- int temoin;
-
- public :
- virtual ~KinemCTDEngine();
-
- void action();
-// ;
-
- YADE_CLASS_BASE_DOC_ATTRS_CTOR(KinemCTDEngine,KinemSimpleShearBox,
- "To compress a simple shear sample by moving the upper box in a vertical way only, so that the tangential displacement (defined by the horizontal gap between the upper and lower boxes) remains constant (thus, the CTD = Constant Tangential Displacement).\n \t The lateral boxes move also to keep always contact. All that until this box is submitted to a given stress (=*targetSigma*). Moreover saves are executed at each value of stresses stored in the vector *sigma_save*, and at *targetSigma*",
- ((Real,compSpeed,0.0,,"(vertical) speed of the upper box : >0 for real compression, <0 for unloading [$m/s$]"))
- ((std::vector<Real>,sigma_save,,,"vector with the values of sigma at which a save of the simulation should be performed [$kPa$]"))
- ((Real,targetSigma,0.0,,"the value of sigma at which the compression should stop [$kPa$]")),
- temoin=0;
- )
-
-
-};
-
-REGISTER_SERIALIZABLE(KinemCTDEngine);
-
-
=== added file 'pkg/dem/KinemC__Engine.cpp'
--- pkg/dem/KinemC__Engine.cpp 1970-01-01 00:00:00 +0000
+++ pkg/dem/KinemC__Engine.cpp 2014-07-14 20:08:34 +0000
@@ -0,0 +1,169 @@
+/*************************************************************************
+* Copyright (C) 2008 by Jerome Duriez *
+* jerome.duriez@xxxxxxxxxxx *
+* *
+* This program is free software; it is licensed under the terms of the *
+* GNU General Public License v2 or later. See file LICENSE for details. *
+*************************************************************************/
+
+#include<yade/pkg/dem/KinemC__Engine.hpp>
+
+YADE_PLUGIN((KinemCTDEngine)(KinemCNDEngine)(KinemCNLEngine)(KinemCNSEngine));
+
+void KinemCTDEngine::action()
+{
+ KinemSimpleShearBox::getBoxes_Dt();
+
+
+ scene->forces.sync();
+ Real current_NormalForce=(scene->forces.getForce(id_topbox)).y();
+ KinemSimpleShearBox::computeScontact();
+ current_sigma=current_NormalForce/(1000.0*Scontact); // so we have the current value of sigma, in kPa
+
+ if( ((compSpeed > 0) && (current_sigma < targetSigma)) || ((compSpeed < 0) && (current_sigma > targetSigma)) )
+ {
+ if(temoin!=0)
+ {
+// cout << "j'ai ici un temoin #0 visiblement. En effet temoin =" <<boost::lexical_cast<string>(temoin) << endl;
+ temoin=0;
+// cout << "Maintenant (toujours dans le if temoin!=0), temoin =" <<boost::lexical_cast<string>(temoin) << endl;
+ }
+
+ letMove(0.0,-compSpeed*dt);
+ }
+ else if (temoin==0)
+ {
+ stopMovement();
+// cout << "Mouvement stoppe, temoin = " << boost::lexical_cast<string>(temoin) << endl;
+// cout << " Dans le if, temoin =" << boost::lexical_cast<string>(temoin) << endl;
+ string f;
+ if (compSpeed > 0)
+ f="Sigmax_";
+ else
+ f="Sigmin_";
+
+ Omega::instance().saveSimulation(Key + f +boost::lexical_cast<string> (floor(targetSigma)) + "kPaReached.xml");
+ temoin=1;
+// cout << " Fin du if, temoin =" << boost::lexical_cast<string>(temoin) << endl << endl;
+ }
+
+
+ for(unsigned int j=0;j<sigma_save.size();j++)
+ {
+ if( ( ( (compSpeed>0)&&(current_sigma > sigma_save[j]) ) || ((compSpeed<0)&&(current_sigma < sigma_save[j])) ) && (temoin_save[j]==0))
+ {
+ stopMovement();
+ Omega::instance().saveSimulation(Key + "SigInt_" +boost::lexical_cast<string> (floor(current_sigma)) + "kPareached.xml");
+ temoin_save[j]=1;
+ }
+ }
+// cout << "Fin de ApplyCondi, temoin = " << boost::lexical_cast<string>(temoin) << endl;
+
+}
+
+void KinemCNDEngine::action()
+{
+ KinemSimpleShearBox::getBoxes_Dt();
+
+ if( ((shearSpeed > 0) && (gamma<=gammalim)) || ((shearSpeed < 0) /*&& (gamma>=gammalim)*/ ) )
+ {
+ if(temoinfin!=0)
+ temoinfin=0;
+ letMove(shearSpeed * dt,0);
+ gamma+=shearSpeed * dt;
+ }
+ else
+ {
+ stopMovement();
+ if(temoinfin==0)
+ {
+ Omega::instance().saveSimulation(Key + "endShear.xml");
+ temoinfin=1;
+ }
+ }
+
+ for(unsigned int j=0;j<gamma_save.size();j++)
+ {
+ if ( ( ( (shearSpeed>0)&&(gamma > gamma_save[j]) ) || ((shearSpeed<0)&&(gamma < gamma_save[j])) ) && (temoin_save[j]==0) )
+ {
+ stopMovement(); // reset of all the speeds before the save
+ Omega::instance().saveSimulation(Key+"_"+boost::lexical_cast<string> (floor(gamma*1000)) + "mmsheared.xml");
+ temoin_save[j]=1;
+ }
+ }
+
+}
+
+void KinemCNLEngine::action()
+{
+ if(LOG) cout << "debut applyCondi du CNCEngine !!" << endl;
+ KinemSimpleShearBox::getBoxes_Dt();
+
+ if(LOG) cout << "gamma = " << boost::lexical_cast<string>(gamma) << " et gammalim = " << boost::lexical_cast<string>(gammalim) << endl;
+ if(gamma<=gammalim)
+ {
+ if(LOG) cout << "Je suis bien dans la partie gamma < gammalim" << endl;
+ if(temoin==0)
+
+ {
+ if(LOG) cout << "Je veux maintenir la Force a f0 = : " << f0 << endl;
+ temoin=1;
+ }
+ computeDY(0.0);
+
+ letMove(shearSpeed*dt,deltaH);
+ gamma+=shearSpeed * dt;
+
+ }
+ else if (temoin<2)
+ {
+ stopMovement(); // INDISPENSABLE !
+ it_stop=scene->iter;
+ cout << "Shear stopped : gammaLim reached at it "<< it_stop << endl;
+ temoin=2;
+ }
+ else if (temoin==2 && (scene->iter==(it_stop+5000)) )
+ {
+ Omega::instance().saveSimulation(Key + "endShear" +boost::lexical_cast<string> ( scene->iter ) + ".xml");
+ Omega::instance().pause();
+ }
+
+ for(unsigned int j=0;j<gamma_save.size();j++)
+ {
+ if ((gamma > gamma_save[j]) && (temoin_save[j]==0))
+ {
+ stopMovement(); // reset of all the speeds before the save
+ Omega::instance().saveSimulation(Key+"_"+boost::lexical_cast<string> (floor(gamma*1000)) +"_" +boost::lexical_cast<string> (floor(gamma*10000)-10*floor(gamma*1000))+ "mmsheared.xml");
+ temoin_save[j]=1;
+ }
+ }
+}
+
+void KinemCNSEngine::action()
+{
+ if(LOG) cerr << "debut applyCondi !!" << endl;
+ KinemSimpleShearBox::getBoxes_Dt();
+
+ if(gamma<=gammalim)
+ {
+ computeDY(KnC);
+ letMove(shearSpeed * dt,deltaH);
+ gamma+=shearSpeed * dt;
+ if(temoin==0)
+ {
+ temoin=1;
+ }
+ }
+ else if (temoin<2)
+ {
+ stopMovement(); // INDISPENSABLE !
+ it_stop=scene->iter;
+ cout << "Cisaillement arrete : gammaLim atteint a l'iteration "<< it_stop << endl;
+ temoin=2;
+ }
+ else if (temoin==2 && (scene->iter==(it_stop+5000)) )
+ {
+ Omega::instance().saveSimulation(Key + "finCis" +boost::lexical_cast<string> (scene->iter ) + ".xml");
+ Omega::instance().pause();
+ }
+}
=== added file 'pkg/dem/KinemC__Engine.hpp'
--- pkg/dem/KinemC__Engine.hpp 1970-01-01 00:00:00 +0000
+++ pkg/dem/KinemC__Engine.hpp 2014-07-14 20:08:34 +0000
@@ -0,0 +1,108 @@
+/*************************************************************************
+* Copyright (C) 2008 by Jerome Duriez *
+* jerome.duriez@xxxxxxxxxxx *
+* *
+* This program is free software; it is licensed under the terms of the *
+* GNU General Public License v2 or later. See file LICENSE for details. *
+*************************************************************************/
+
+#pragma once
+
+#include<yade/pkg/dem/KinemSimpleShearBox.hpp>
+
+class KinemCTDEngine : public KinemSimpleShearBox
+{
+ private :
+ Real current_sigma // Computed in kPa
+ ;
+
+ int temoin;
+
+ public :
+ virtual ~KinemCTDEngine() {};
+
+ void action();
+// ;
+
+ YADE_CLASS_BASE_DOC_ATTRS_CTOR(KinemCTDEngine,KinemSimpleShearBox,
+ "To compress a simple shear sample by moving the upper box in a vertical way only, so that the tangential displacement (defined by the horizontal gap between the upper and lower boxes) remains constant (thus, the CTD = Constant Tangential Displacement).\n \t The lateral boxes move also to keep always contact. All that until this box is submitted to a given stress (=*targetSigma*). Moreover saves are executed at each value of stresses stored in the vector *sigma_save*, and at *targetSigma*",
+ ((Real,compSpeed,0.0,,"(vertical) speed of the upper box : >0 for real compression, <0 for unloading [$m/s$]"))
+ ((std::vector<Real>,sigma_save,,,"vector with the values of sigma at which a save of the simulation should be performed [$kPa$]"))
+ ((Real,targetSigma,0.0,,"the value of sigma at which the compression should stop [$kPa$]")),
+ temoin=0;
+ )
+
+
+};
+
+REGISTER_SERIALIZABLE(KinemCTDEngine);
+
+class KinemCNDEngine : public KinemSimpleShearBox
+{
+ private :
+ int temoinfin;
+ public :
+ void action();
+
+ protected :
+
+ YADE_CLASS_BASE_DOC_ATTRS_CTOR(KinemCNDEngine,KinemSimpleShearBox,
+ "To apply a Constant Normal Displacement (CND) shear for a parallelogram box\n\n \tThis engine, designed for simulations implying a simple shear box (:yref:`SimpleShear` Preprocessor or scripts/simpleShear.py), allows one to perform a constant normal displacement shear, by translating horizontally the upper plate, while the lateral ones rotate so that they always keep contact with the lower and upper walls.",
+ ((Real,shearSpeed,0.0,,"the speed at which the shear is performed : speed of the upper plate [m/s]"))
+ ((Real,gammalim,0.0,,"the value of the tangential displacement at wich the displacement is stopped [m]"))
+ ((Real,gamma,0.0,,"the current value of the tangential displacement"))
+ ((std::vector<Real>,gamma_save,,,"vector with the values of gamma at which a save of the simulation is performed [m]")),
+ temoinfin=0;
+ );
+};
+
+REGISTER_SERIALIZABLE(KinemCNDEngine);
+
+class KinemCNLEngine : public KinemSimpleShearBox
+{
+ private :
+
+ int temoin,// utile pour savoir ou on en est
+ it_stop
+ ;
+
+ public :
+ void action()
+ ;
+
+
+ YADE_CLASS_BASE_DOC_ATTRS_CTOR(KinemCNLEngine,KinemSimpleShearBox,
+ "To apply a constant normal stress shear (i.e. Constant Normal Load : CNL) for a parallelogram box (simple shear box : :yref:`SimpleShear` Preprocessor or scripts/simpleShear.py)\n\nThis engine allows one to translate horizontally the upper plate while the lateral ones rotate so that they always keep contact with the lower and upper walls.\n\nIn fact the upper plate can move not only horizontally but also vertically, so that the normal stress acting on it remains constant (this constant value is not chosen by the user but is the one that exists at the beginning of the simulation)\n\nThe right vertical displacements which will be allowed are computed from the rigidity Kn of the sample over the wall (so to cancel a deltaSigma, a normal dplt deltaSigma*S/(Kn) is set)\n\nThe movement is moreover controlled by the user via a *shearSpeed* which will be the speed of the upper wall, and by a maximum value of horizontal displacement *gammalim*, after which the shear stops.\n\n.. note::\n\tNot only the positions of walls are updated but also their speeds, which is all but useless considering the fact that in the contact laws these velocities of bodies are used to compute values of tangential relative displacements.\n\n.. warning::\n\tBecause of this last point, if you want to use later saves of simulations executed with this Engine, but without that stopMovement was executed, your boxes will keep their speeds => you will have to cancel them 'by hand' in the .xml.\n",
+ ((Real,shearSpeed,0.0,,"the speed at wich the shearing is performed : speed of the upper plate [m/s]"))
+ ((Real,gammalim,0.0,,"the value of tangential displacement (of upper plate) at wich the shearing is stopped [m]"))
+ ((Real,gamma,0.0,,"current value of tangential displacement [m]"))
+ ((std::vector<Real>,gamma_save,,,"vector with the values of gamma at which a save of the simulation is performed [m]")),
+// ((Real,coeff_dech,1.0,,"in the case of the use of 'Law2_ScGeom6D_NormalInelasticityPhys_NormalInelasticity' for ex, where kn(unload)#kn(load). The engine cares to find the value at the first run BROKEN actually")),
+ temoin=0;
+ it_stop=0;
+ );
+};
+
+REGISTER_SERIALIZABLE(KinemCNLEngine);
+
+class KinemCNSEngine : public KinemSimpleShearBox
+{
+ private :
+ int temoin,it_stop
+ ;
+ public :
+ void action()
+ ;
+ YADE_CLASS_BASE_DOC_ATTRS_CTOR(KinemCNSEngine,KinemSimpleShearBox,
+ "To apply a Constant Normal Stifness (CNS) shear for a parallelogram box (simple shear)\n\nThis engine, useable in simulations implying one deformable parallelepipedic box, allows one to translate horizontally the upper plate while the lateral ones rotate so that they always keep contact with the lower and upper walls. The upper plate can move not only horizontally but also vertically, so that the normal rigidity defined by DeltaF(upper plate)/DeltaU(upper plate) = constant (= *KnC* defined by the user).\n\nThe movement is moreover controlled by the user via a *shearSpeed* which is the horizontal speed of the upper wall, and by a maximum value of horizontal displacement *gammalim* (of the upper plate), after which the shear stops.\n\n.. note::\n\t not only the positions of walls are updated but also their speeds, which is all but useless considering the fact that in the contact laws these velocities of bodies are used to compute values of tangential relative displacements.\n\n.. warning::\n\tBut, because of this last point, if you want to use later saves of simulations executed with this Engine, but without that stopMovement was executed, your boxes will keep their speeds => you will have to cancel them by hand in the .xml",
+ ((Real,shearSpeed,0.0,,"the speed at wich the shearing is performed : speed of the upper plate [m/s]"))
+ ((Real,gammalim,0.0,,"the value of tangential displacement (of upper plate) at wich the shearing is stopped [m]"))
+ ((Real,gamma,0.0,,"current value of tangential displacement [m]"))
+ ((Real,KnC,10.0e6,,"the normal rigidity chosen by the user [MPa/mm] - the conversion in Pa/m will be made")),
+ temoin=0;
+ it_stop=0;
+ );
+
+};
+
+REGISTER_SERIALIZABLE(KinemCNSEngine);
=== modified file 'pkg/dem/SimpleShear.cpp'
--- pkg/dem/SimpleShear.cpp 2014-07-14 20:08:34 +0000
+++ pkg/dem/SimpleShear.cpp 2014-07-14 20:08:34 +0000
@@ -25,7 +25,7 @@
#include<yade/pkg/dem/NewtonIntegrator.hpp>
#include<yade/pkg/common/GravityEngines.hpp>
-#include<yade/pkg/dem/KinemCTDEngine.hpp>
+#include<yade/pkg/dem/KinemC__Engine.hpp>
#include<yade/pkg/dem/Ig2_Sphere_Sphere_ScGeom.hpp>
#include<yade/pkg/dem/Ig2_Box_Sphere_ScGeom.hpp>