← Back to team overview

yade-dev team mailing list archive

[Branch ~yade-dev/yade/trunk] Rev 2861: - maintaining of SimpleShear FileGenerator

 

------------------------------------------------------------
revno: 2861
committer: jduriez <jduriez@c1solimara-l>
branch nick: yade
timestamp: Thu 2011-05-12 17:13:50 +0200
message:
  - maintaining of SimpleShear FileGenerator
  - checkTestNormalInelasticity.py again among check tests. I launched it more than 20 times without crash here
renamed:
  scripts/test/checkTestNormalInelasticity.py => scripts/test/checks/checkTestNormalInelasticity.py
modified:
  pkg/dem/KinemCNDEngine.cpp
  pkg/dem/KinemCNLEngine.cpp
  pkg/dem/KinemCNSEngine.cpp
  pkg/dem/KinemCTDEngine.cpp
  pkg/dem/KinemSimpleShearBox.cpp
  pkg/dem/KinemSimpleShearBox.hpp
  pkg/dem/SimpleShear.cpp
  pkg/dem/SimpleShear.hpp


--
lp:yade
https://code.launchpad.net/~yade-dev/yade/trunk

Your team Yade developers is subscribed to branch lp:yade.
To unsubscribe from this branch go to https://code.launchpad.net/~yade-dev/yade/trunk/+edit-subscription
=== modified file 'pkg/dem/KinemCNDEngine.cpp'
--- pkg/dem/KinemCNDEngine.cpp	2010-11-07 11:46:20 +0000
+++ pkg/dem/KinemCNDEngine.cpp	2011-05-12 15:13:50 +0000
@@ -14,7 +14,7 @@
 
 void KinemCNDEngine::action()
 {
-	KinemSimpleShearBox::setBoxes_Dt();
+	KinemSimpleShearBox::getBoxes_Dt();
 
 	if( ((shearSpeed > 0) && (gamma<=gammalim)) || ((shearSpeed < 0) /*&& (gamma>=gammalim)*/ ) )
 	{

=== modified file 'pkg/dem/KinemCNLEngine.cpp'
--- pkg/dem/KinemCNLEngine.cpp	2010-11-07 11:46:20 +0000
+++ pkg/dem/KinemCNLEngine.cpp	2011-05-12 15:13:50 +0000
@@ -14,7 +14,7 @@
 void KinemCNLEngine::action()
 {
 	if(LOG)	cout << "debut applyCondi du CNCEngine !!" << endl;
-	KinemSimpleShearBox::setBoxes_Dt();
+	KinemSimpleShearBox::getBoxes_Dt();
 	
 	if(LOG)	cout << "gamma = " << lexical_cast<string>(gamma) << "  et gammalim = " << lexical_cast<string>(gammalim) << endl;
 	if(gamma<=gammalim)

=== modified file 'pkg/dem/KinemCNSEngine.cpp'
--- pkg/dem/KinemCNSEngine.cpp	2011-01-24 14:45:35 +0000
+++ pkg/dem/KinemCNSEngine.cpp	2011-05-12 15:13:50 +0000
@@ -17,7 +17,7 @@
 void KinemCNSEngine::action()
 {
 	if(LOG) cerr << "debut applyCondi !!" << endl;
-	KinemSimpleShearBox::setBoxes_Dt();
+	KinemSimpleShearBox::getBoxes_Dt();
 	
 	if(gamma<=gammalim)
 	{

=== modified file 'pkg/dem/KinemCTDEngine.cpp'
--- pkg/dem/KinemCTDEngine.cpp	2010-11-07 11:46:20 +0000
+++ pkg/dem/KinemCTDEngine.cpp	2011-05-12 15:13:50 +0000
@@ -17,7 +17,7 @@
 
 void KinemCTDEngine::action()
 {
-	KinemSimpleShearBox::setBoxes_Dt();
+	KinemSimpleShearBox::getBoxes_Dt();
 
 
 	scene->forces.sync();

=== modified file 'pkg/dem/KinemSimpleShearBox.cpp'
--- pkg/dem/KinemSimpleShearBox.cpp	2011-04-28 14:20:15 +0000
+++ pkg/dem/KinemSimpleShearBox.cpp	2011-05-12 15:13:50 +0000
@@ -50,7 +50,7 @@
 	if(LOG)	cout << "It : " << scene->iter << endl;
 // 	computeDu();
 
-// 	const Real& dt = scene->dt; // dt defini par setBoxes_Dt
+// 	const Real& dt = scene->dt; // dt value obtained by getBoxes_Dt
 
 	Real Ysup = topbox->state->pos.y();
 	Real Ylat = leftbox->state->pos.y();
@@ -143,7 +143,7 @@
 
 }
 
-void KinemSimpleShearBox::setBoxes_Dt()
+void KinemSimpleShearBox::getBoxes_Dt()
 {
 	leftbox = Body::byId(id_boxleft);
 	rightbox = Body::byId(id_boxright);

=== modified file 'pkg/dem/KinemSimpleShearBox.hpp'
--- pkg/dem/KinemSimpleShearBox.hpp	2011-04-28 14:20:15 +0000
+++ pkg/dem/KinemSimpleShearBox.hpp	2011-05-12 15:13:50 +0000
@@ -21,7 +21,7 @@
 
 	protected :
 		Real Scontact // computed by computeScontact()
-		     ,dt // value of the time step, set in setBoxes_Dt
+		     ,dt // value of the time step, obtained in getBoxes_Dt
 		     ,stiffness	// the normal stifness on the sample acting below the upper plate. Computed by computeStiffness
 		     ,dalpha	// the increment over alpha, due to vertical displacement of upper box
 		      ,deltaH	// the vertical increment of displacement to allow on the upper plate on this time step to verify either the constant normal stress or the constant normal stifness. Computed here by computeDY(..)
@@ -40,7 +40,7 @@
 			,letMove(Real dgamma,Real dH) //dgamma and dH being computed by different ways in the different Kinem... Engines
 			,computeStiffness() // computes the stiffness of the contact sample - upper side. Useful for CNL and CNS loads
 			,computeDY(Real KnC) // computes vertical displacement to perform to obey to the stiffness of the shear wanted : KnC. Useful for CNL (for which KnC = 0) and CNS loads
-			,setBoxes_Dt()
+			,getBoxes_Dt()
 			;
 	
 	YADE_CLASS_BASE_DOC_ATTRS_CTOR(KinemSimpleShearBox,BoundaryController,

=== modified file 'pkg/dem/SimpleShear.cpp'
--- pkg/dem/SimpleShear.cpp	2011-05-03 15:04:37 +0000
+++ pkg/dem/SimpleShear.cpp	2011-05-12 15:13:50 +0000
@@ -95,8 +95,8 @@
 	vector<BasicSphere> sphere_list;
 
 // to use the TriaxialTest method :
-	string out=GenerateCloud(sphere_list,Vector3r(0,0,-width/2.0),Vector3r(length,height,width/2.0),1000,0.3,0.7);// generates a sample of 1000 spheres, with a required porosity of 0.7
-	LOG_INFO(out);
+	string out=GenerateCloud(sphere_list,Vector3r(0,0,-width/2.0),Vector3r(length,height,width/2.0),1000,0.3,0.7);// tries to generate a sample of 1000 spheres, with a required porosity of 0.7
+	cout << out << endl;
 
 // to use a text file :
 // 	std::pair<string,bool> res=ImportCloud(sphere_list,filename);
@@ -195,8 +195,8 @@
 void SimpleShear::createActors(shared_ptr<Scene>& scene)
 {
 	shared_ptr<IGeomDispatcher> interactionGeometryDispatcher(new IGeomDispatcher);
-	interactionGeometryDispatcher->add(new Ig2_Sphere_Sphere_ScGeom);
-	interactionGeometryDispatcher->add(new Ig2_Box_Sphere_ScGeom);
+	interactionGeometryDispatcher->add(new Ig2_Sphere_Sphere_ScGeom6D);
+	interactionGeometryDispatcher->add(new Ig2_Box_Sphere_ScGeom6D);
 
 	shared_ptr<IPhysDispatcher> interactionPhysicsDispatcher(new IPhysDispatcher);
 	shared_ptr<IPhysFunctor> CL1Rel(new Ip2_2xNormalInelasticMat_NormalInelasticityPhys);
@@ -270,12 +270,16 @@
 			}
 		}
 		if (t==tries) 
-		{cerr << "on a atteint le t=tries" << endl;
-		return "More than " + lexical_cast<string>(tries) +	" tries while generating sphere number " +
+		{
+		string str1="Generated a sample with " + lexical_cast<string>(i) + " spheres inside box of dimensions: (" 
+			+ lexical_cast<string>(dimensions[0]) + "," 
+			+ lexical_cast<string>(dimensions[1]) + "," 
+			+ lexical_cast<string>(dimensions[2]) + ").\n";
+		return str1 + "More than " + lexical_cast<string>(tries) +	" tries while generating sphere number " +
 					lexical_cast<string>(i+1) + "/" + lexical_cast<string>(number) + ".";
 		}
 	}
-	return "Generated a sample with " + lexical_cast<string>(number) + "spheres inside box of dimensions: (" 
+	return "Generated a sample with " + lexical_cast<string>(number) + " spheres inside box of dimensions: (" 
 			+ lexical_cast<string>(dimensions[0]) + "," 
 			+ lexical_cast<string>(dimensions[1]) + "," 
 			+ lexical_cast<string>(dimensions[2]) + ").";

=== modified file 'pkg/dem/SimpleShear.hpp'
--- pkg/dem/SimpleShear.hpp	2011-05-03 15:04:37 +0000
+++ pkg/dem/SimpleShear.hpp	2011-05-12 15:13:50 +0000
@@ -33,9 +33,8 @@
 		bool generate(std::string& message);
 
 
-	YADE_CLASS_BASE_DOC_ATTRS(SimpleShear,FileGenerator,"Preprocessor for creating a numerical model of a simple shear box.\n\n\t- Boxes (6) constitute the different sides of the box itself\n \t- Spheres are contained in the box. The sample could be generated via the same method used in TriaxialTest Preprocesor (=> see GenerateCloud) or by reading a text file containing positions and radii of a sample (=> see ImportCloud). This last one is the one by default used by this PreProcessor as it is written here => you need to have such a file.\n \n \t Thanks to the Engines (in pkg/del) :yref:`KinemCNDEngine`, :yref:`KinemCNSEngine` and :yref:`KinemCNLEngine`, respectively constant normal displacement, constant normal rigidity and constant normal stress are possible to execute over such samples.\n \n \tNB about micro-parameters : their values correspond to those used in [Duriez2009a]_ and [Duriez2011]_.",
-				  ((string,filename,"../porosite0_44.txt",,"file with the list of spheres centers and radii"))
-				  ((Vector3r,gravity,Vector3r(0,-9.81,0),,"vector corresponding to used gravity [$m/s^2$]"))
+	YADE_CLASS_BASE_DOC_ATTRS(SimpleShear,FileGenerator,"Preprocessor for creating a numerical model of a simple shear box.\n\n\t- Boxes (6) constitute the different sides of the box itself\n \t- Spheres are contained in the box. The sample is generated by default via the same method used in TriaxialTest Preprocesor (=> see in source function GenerateCloud). But import of a list of spheres from a text file can be also performed after few changes in the source code.\n \n \t Launching this preprocessor will carry out an oedometric compression, until a value of normal stress equal to 1 MPa (and stable). But with others Engines :yref:`KinemCNDEngine`, :yref:`KinemCNSEngine` and :yref:`KinemCNLEngine`, respectively constant normal displacement, constant normal rigidity and constant normal stress paths can be carried out for such simple shear boxes.\n \n \tNB about micro-parameters : their default values correspond to those used in [Duriez2009a]_ and [Duriez2011]_ to simulate infilled rock joints.",
+/*				  ((string,filename,"../porosite0_44.txt",,"file with the list of spheres centers and radii"))*/
 				  ((Real,thickness,0.001,,"thickness of the boxes constituting the shear box [$m$]"))
 				  ((Real,length,0.1,,"initial length (along x-axis) of the shear box [$m$]"))
 				  ((Real,height,0.02,,"initial height (along y-axis) of the shear box [$m$]"))
@@ -47,6 +46,7 @@
 				  ((Real,boxYoungModulus,4.0e9,,"value of :yref:`ElastMat::young` for the boxes [$Pa$]"))
 				  ((Real,boxPoissonRatio,0.04,,"value of :yref:`ElastMat::poisson` for the spheres [-]"))
 				  ((bool,gravApplied,false,,"depending on this, :yref:`GravityEngine` is added or not to the scene to take into account the weight of particles"))
+				  ((Vector3r,gravity,Vector3r(0,-9.81,0),,"vector corresponding to used gravity (if :yref:gravApplied<SimpleShear::gravApplied>`) [$m/s^2$]"))
 				  ((int,timeStepUpdateInterval,50,,"value of :yref:`TimeStepper::timeStepUpdateInterval` for the :yref:`TimeStepper` used here"))
 				  );
 	DECLARE_LOGGER;

=== renamed file 'scripts/test/checkTestNormalInelasticity.py' => 'scripts/test/checks/checkTestNormalInelasticity.py'

Follow ups