← Back to team overview

yade-dev team mailing list archive

[Branch ~yade-dev/yade/trunk] Rev 2963: - add/use the "neverErase" flag in Hertz laws.

 

------------------------------------------------------------
revno: 2963
committer: Bruno Chareyre <bruno.chareyre@xxxxxxxxxxx>
branch nick: trunk
timestamp: Wed 2011-11-23 13:09:58 +0100
message:
  - add/use the "neverErase" flag in Hertz laws.
modified:
  pkg/dem/HertzMindlin.cpp
  pkg/dem/HertzMindlin.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/HertzMindlin.cpp'
--- pkg/dem/HertzMindlin.cpp	2011-04-28 11:13:29 +0000
+++ pkg/dem/HertzMindlin.cpp	2011-11-23 12:09:58 +0000
@@ -160,7 +160,10 @@
 	ScGeom* geom = static_cast<ScGeom*>(ig.get());
 	MindlinPhys* phys=static_cast<MindlinPhys*>(ip.get());	
 	const Real uN=geom->penetrationDepth;
-	if (uN<0) {scene->interactions->requestErase(id1,id2); return;}
+	if (uN<0) {
+		if (neverErase) phys->shearForce = phys->normalForce = Vector3r::Zero();
+		else {scene->interactions->requestErase(id1,id2); return;}
+	}
 	// normal force
 	Real Fn=phys->kno*pow(uN,3/2.);
 	phys->normalForce=Fn*geom->normal;
@@ -199,7 +202,11 @@
 	ScGeom* geom = static_cast<ScGeom*>(ig.get());
 	MindlinPhys* phys=static_cast<MindlinPhys*>(ip.get());	
 	const Real uN=geom->penetrationDepth;
-	if (uN<0) {scene->interactions->requestErase(id1,id2); return;}
+	if (uN<0) {
+		if (neverErase) phys->shearForce = phys->normalForce = Vector3r::Zero();
+		else {scene->interactions->requestErase(id1,id2); return;}
+	}
+	
 	// normal force
 	Real Fn=phys->kno*pow(uN,3/2.);
 	phys->normalForce=Fn*geom->normal;
@@ -263,8 +270,11 @@
 	/* NORMAL FORCE */
 	/****************/
 	
-	Real uN = scg->penetrationDepth; // get overlapping  
-	if (uN<0) {scene->interactions->requestErase(contact->getId1(),contact->getId2()); return;}
+	Real uN = scg->penetrationDepth; // get overlapping 
+	if (uN<0) {
+		if (neverErase) phys->shearForce = phys->normalForce = Vector3r::Zero();
+		else {scene->interactions->requestErase(id1,id2); return;}
+	}
 	/* Hertz-Mindlin's formulation (PFC) 
 	Note that the normal stiffness here is a secant value (so as it is cannot be used in the GSTS)
 	In the first place we get the normal force and then we store kn to be passed to the GSTS */

=== modified file 'pkg/dem/HertzMindlin.hpp'
--- pkg/dem/HertzMindlin.hpp	2011-02-08 16:37:12 +0000
+++ pkg/dem/HertzMindlin.hpp	2011-11-23 12:09:58 +0000
@@ -98,6 +98,7 @@
 		FUNCTOR2D(ScGeom,MindlinPhys);
 		YADE_CLASS_BASE_DOC_ATTRS(Law2_ScGeom_MindlinPhys_MindlinDeresiewitz,LawFunctor,
 			"Hertz-Mindlin contact law with partial slip solution, as described in [Thornton1991]_.",
+			((bool,neverErase,false,,"Keep interactions even if particles go away from each other (only in case another constitutive law is in the scene, e.g. :yref:`Law2_ScGeom_CapillaryPhys_Capillarity`)"))
 		);
 };
 REGISTER_SERIALIZABLE(Law2_ScGeom_MindlinPhys_MindlinDeresiewitz);
@@ -108,6 +109,7 @@
 		FUNCTOR2D(ScGeom,MindlinPhys);
 		YADE_CLASS_BASE_DOC_ATTRS(Law2_ScGeom_MindlinPhys_HertzWithLinearShear,LawFunctor,
 			"Constitutive law for the Hertz formulation (using :yref:`MindlinPhys.kno`) and linear beahvior in shear (using :yref:`MindlinPhys.kso` for stiffness and :yref:`FrictPhys.tangensOfFrictionAngle`). \n\n.. note:: No viscosity or damping. If you need those, look at  :yref:`Law2_ScGeom_MindlinPhys_Mindlin`, which also includes non-linear Mindlin shear.",
+				((bool,neverErase,false,,"Keep interactions even if particles go away from each other (only in case another constitutive law is in the scene, e.g. :yref:`Law2_ScGeom_CapillaryPhys_Capillarity`)"))
 				((int,nonLin,0,,"Shear force nonlinearity (the value determines how many features of the non-linearity are taken in account). 1: ks as in HM 2: shearElastic increment computed as in HM 3. granular ratcheting disabled."))
 		);
 };
@@ -138,6 +140,7 @@
 			((bool,includeAdhesion,false,,"bool to include the adhesion force following the DMT formulation. If true, also the normal elastic energy takes into account the adhesion effect."))
 			((bool,calcEnergy,false,,"bool to calculate energy terms (shear potential energy, dissipation of energy due to friction and dissipation of energy due to normal and tangential damping)"))
 			((bool,includeMoment,false,,"bool to consider rolling resistance (if :yref:`Ip2_FrictMat_FrictMat_MindlinPhys::eta` is 0.0, no plastic condition is applied.)"))
+			((bool,neverErase,false,,"Keep interactions even if particles go away from each other (only in case another constitutive law is in the scene, e.g. :yref:`Law2_ScGeom_CapillaryPhys_Capillarity`)"))
 			//((bool,LinDamp,true,,"bool to activate linear viscous damping (if false, en and es have to be defined in place of betan and betas)"))
 
 			((OpenMPAccumulator<Real>,frictionDissipation,,Attr::noSave,"Energy dissipation due to sliding"))