← Back to team overview

yade-dev team mailing list archive

[Branch ~yade-pkg/yade/git-trunk] Rev 3741: - Introducing (uncommenting in fact) tens/shearBreakRel variables in JCFpmState : relative part o...

 

------------------------------------------------------------
revno: 3741
committer: Jerome Duriez <jerome.duriez@xxxxxxxxxxxxxxx>
timestamp: Mon 2013-11-04 15:03:39 +0100
message:
  - Introducing (uncommenting in fact) tens/shearBreakRel variables in JCFpmState : relative part of broken interactions per body (instead of absolute number).
  - Few changes in some doc of JCFpm variables.
modified:
  pkg/dem/JointedCohesiveFrictionalPM.cpp
  pkg/dem/JointedCohesiveFrictionalPM.hpp


--
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
=== modified file 'pkg/dem/JointedCohesiveFrictionalPM.cpp'
--- pkg/dem/JointedCohesiveFrictionalPM.cpp	2013-10-04 12:35:58 +0000
+++ pkg/dem/JointedCohesiveFrictionalPM.cpp	2013-11-04 14:03:39 +0000
@@ -23,6 +23,7 @@
 
 	Real Dtensile=phys->FnMax/phys->kn;
 	
+	string fileCracks = "cracks_"+Key+".txt";
 	/// Defines the interparticular distance used for computation
 	Real D = 0;
 
@@ -60,12 +61,12 @@
 	    JCFpmState* st2=dynamic_cast<JCFpmState*>(b2->state.get());
 	    st1->tensBreak+=1;
 	    st2->tensBreak+=1;
-	    //st1->tensBreakRel+=1.0/st1->noIniLinks;
-	    //st2->tensBreakRel+=1.0/st2->noIniLinks;
+	    st1->tensBreakRel+=1.0/st1->noIniLinks;
+	    st2->tensBreakRel+=1.0/st2->noIniLinks;
 	    
     	    // create a text file to record properties of the broken bond (iteration, position, type (tensile), cross section and contact normal orientation)
 	    if (recordCracks){
-	      std::ofstream file ("cracks.txt", !cracksFileExist ? std::ios::trunc : std::ios::app);
+	      std::ofstream file (fileCracks.c_str(), !cracksFileExist ? std::ios::trunc : std::ios::app);
 	      if(file.tellp()==0){ file <<"i p0 p1 p2 t s norm0 norm1 norm2"<<endl; }
 	      Vector3r crackNormal=Vector3r::Zero();
 	      if ((smoothJoint) && (phys->isOnJoint)) { crackNormal=phys->jointNormal; } else {crackNormal=geom->normal;}
@@ -120,12 +121,12 @@
 	    JCFpmState* st2=dynamic_cast<JCFpmState*>(b2->state.get());
 	    st1->shearBreak+=1;
 	    st2->shearBreak+=1;
-	    //st1->shearBreakRel+=1.0/st1->noIniLinks;
-	    //st2->shearBreakRel+=1.0/st2->noIniLinks;
+	    st1->shearBreakRel+=1.0/st1->noIniLinks;
+	    st2->shearBreakRel+=1.0/st2->noIniLinks;
 
 	    // create a text file to record properties of the broken bond (iteration, position, type (shear), cross section and contact normal orientation)
 	    if (recordCracks){
-	      std::ofstream file ("cracks.txt", !cracksFileExist ? std::ios::trunc : std::ios::app);
+	      std::ofstream file (fileCracks.c_str(), !cracksFileExist ? std::ios::trunc : std::ios::app);
 	      if(file.tellp()==0){ file <<"i p0 p1 p2 t s norm0 norm1 norm2"<<endl; }
 	      Vector3r crackNormal=Vector3r::Zero();
 	      if ((smoothJoint) && (phys->isOnJoint)) { crackNormal=phys->jointNormal; } else {crackNormal=geom->normal;}
@@ -201,10 +202,10 @@
 	///to set if the contact is cohesive or not
 	if ((scene->iter < cohesiveTresholdIteration) && (tensileStrength>0 || cohesion>0) && (yade1->type == yade2->type)){ 
 	  contactPhysics->isCohesive=true;
-// 	  JCFpmState* st1=dynamic_cast<JCFpmState*>(Body::byId(interaction->getId1(),scene)->state.get());
-// 	  st1->noIniLinks++;
-// 	  JCFpmState* st2=dynamic_cast<JCFpmState*>(Body::byId(interaction->getId2(),scene)->state.get());
-// 	  st2->noIniLinks++;
+	  JCFpmState* st1=dynamic_cast<JCFpmState*>(Body::byId(interaction->getId1(),scene)->state.get());
+	  st1->noIniLinks++;
+	  JCFpmState* st2=dynamic_cast<JCFpmState*>(Body::byId(interaction->getId2(),scene)->state.get());
+	  st2->noIniLinks++;
 	}
 	
 	if ( contactPhysics->isCohesive ) {
@@ -233,10 +234,10 @@
 			///to set if the contact is cohesive or not
 			if ((scene->iter < cohesiveTresholdIteration) && (jointCohesion>0 || jointTensileStrength>0)) {
 			  contactPhysics->isCohesive=true;
-// 			  JCFpmState* st1=dynamic_cast<JCFpmState*>(Body::byId(interaction->getId1(),scene)->state.get());
-// 			  st1->noIniLinks++;
-// 			  JCFpmState* st2=dynamic_cast<JCFpmState*>(Body::byId(interaction->getId2(),scene)->state.get());
-// 			  st2->noIniLinks++;
+			  JCFpmState* st1=dynamic_cast<JCFpmState*>(Body::byId(interaction->getId1(),scene)->state.get());
+			  st1->noIniLinks++;
+			  JCFpmState* st2=dynamic_cast<JCFpmState*>(Body::byId(interaction->getId2(),scene)->state.get());
+			  st2->noIniLinks++;
 			} 
 			else { contactPhysics->isCohesive=false; contactPhysics->FnMax=0; contactPhysics->FsMax=0; }
 		  
@@ -248,4 +249,4 @@
 	interaction->phys = contactPhysics;
 }
 
-JCFpmPhys::~JCFpmPhys(){}
\ No newline at end of file
+JCFpmPhys::~JCFpmPhys(){}

=== modified file 'pkg/dem/JointedCohesiveFrictionalPM.hpp'
--- pkg/dem/JointedCohesiveFrictionalPM.hpp	2013-10-04 12:35:58 +0000
+++ pkg/dem/JointedCohesiveFrictionalPM.hpp	2013-11-04 14:03:39 +0000
@@ -12,9 +12,9 @@
 	YADE_CLASS_BASE_DOC_ATTRS_CTOR(JCFpmState,State,"JCFpm state information about each body.\n\nNone of that is used for computation (at least not now), only for post-processing.",
 		((int,tensBreak,0,,"number of tensile breakages. [-]"))
                 ((int,shearBreak,0,,"number of shear breakages. [-]"))
-		// ((int,noIniLinks,0,,"number of initial cohesive interactions. [-]"))
-		// ((Real,tensBreakRel,0,,"relative number of tensile breakages (compared with noIniLinks). [-]"))
-		// ((Real,shearBreakRel,0,,"relative number of shear breakages (compared with noIniLinks). [-]"))
+		((int,noIniLinks,0,,"number of initial cohesive interactions. [-]"))
+		((Real,tensBreakRel,0,,"relative number of tensile breakages (compared with noIniLinks). [-]"))
+		((Real,shearBreakRel,0,,"relative number of shear breakages (compared with noIniLinks). [-]"))
                 ,
 		createIndex();
 	);
@@ -55,9 +55,9 @@
 			((Real,tanFrictionAngle,0,,"tangent of frictionAngle. [-]"))
 			((Real,crossSection,0,,"crossSection=pi*Rmin^2. [m2]"))
 			((Real,FnMax,0,,"defines the maximum admissible normal force in traction FnMax=tensileStrength*crossSection. [N]"))
-			((Real,FsMax,0,,"defines the maximum admissible tangential force in shear FsMax=cohesion*FnMax. [N]"))
+			((Real,FsMax,0,,"defines the maximum admissible tangential force in shear FsMax=cohesion*crossSection. [N]"))
 			((Vector3r,jointNormal,Vector3r::Zero(),,"Normal direction to the joint."))
-			((Real,jointCumulativeSliding,0,,"sliding distance for particles interacting on a joint. Used when soothJoint is true in Law2_ScGeom_JCFpmPhys_JointedCohesiveFrictionalPM to take into account dilatancy due to shearing. [-]"))
+			((Real,jointCumulativeSliding,0,,"sliding distance for particles interacting on a joint. Used, when :yref:`<Law2_ScGeom_JCFpmPhys_JointedCohesiveFrictionalPM.smoothJoint>` is true, to take into account dilatancy due to shearing. [-]"))
 			((Real,dilationAngle,0,,"defines the dilatancy of the joint surface. [rad]"))
 			((Real,tanDilationAngle,0,,"tangent of dilationAngle. [-]"))
 			((Real,dilation,0,,"defines the normal displacement in the joint after sliding treshold. [m]"))
@@ -102,7 +102,8 @@
 
 		YADE_CLASS_BASE_DOC_ATTRS(Law2_ScGeom_JCFpmPhys_JointedCohesiveFrictionalPM,LawFunctor,"Interaction law for cohesive frictional material, e.g. rock, possibly presenting joint surfaces. Joint surfaces can be defined in a preprocessing phase through .stl meshes (see ref for details of the procedure), and can be mechanically described with a smooth contact logic [Ivars2011]_ (implemented in Yade in [Scholtes2012]_).",
 			((bool,smoothJoint,false,,"if true, particles belonging to joint surface have a smooth contact logic [Ivars2011]_, [Scholtes2012]_."))
-			((bool,recordCracks,false,,"if true a text file cracks.txt will be created (iteration, position, type (tensile or shear), cross section and contact normal)."))
+			((bool,recordCracks,false,,"if true a text file cracksKey.txt (see below) will be created (iteration, position, type (tensile or shear), cross section and contact normal)."))
+			((string,Key,"",,"string specifying the name of saved file 'cracks.....txt'"))
 			((bool,cracksFileExist,false,,"If true, text file already exists and its content won't be reset."))
 		);
 		DECLARE_LOGGER;