← Back to team overview

yade-dev team mailing list archive

[Branch ~yade-pkg/yade/git-trunk] Rev 4073: Join [CohFrict]Mat, Phys and Ip2_.

 

------------------------------------------------------------
revno: 4073
committer: Anton Gladky <gladky.anton@xxxxxxxxx>
timestamp: Mon 2014-07-14 22:08:33 +0200
message:
  Join [CohFrict]Mat, Phys and Ip2_.
  
  Move them all into CohesiveFrictionalContactLaw.
removed:
  pkg/dem/CohFrictMat.cpp
  pkg/dem/CohFrictMat.hpp
  pkg/dem/CohFrictPhys.cpp
  pkg/dem/CohFrictPhys.hpp
  pkg/dem/Ip2_CohFrictMat_CohFrictMat_CohFrictPhys.cpp
  pkg/dem/Ip2_CohFrictMat_CohFrictMat_CohFrictPhys.hpp
modified:
  pkg/common/Cylinder.hpp
  pkg/common/Grid.hpp
  pkg/dem/CohesiveFrictionalContactLaw.cpp
  pkg/dem/CohesiveFrictionalContactLaw.hpp
  pkg/dem/CohesiveTriaxialTest.cpp
  pkg/dem/Ip2_2xInelastCohFrictMat_InelastCohFrictPhys.hpp
  pkg/lbm/HydrodynamicsLawLBM.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
=== modified file 'pkg/common/Cylinder.hpp'
--- pkg/common/Cylinder.hpp	2014-05-23 13:05:19 +0000
+++ pkg/common/Cylinder.hpp	2014-07-14 20:08:33 +0000
@@ -10,9 +10,7 @@
 #ifdef YADE_OPENGL
 	#include<yade/pkg/common/GLDrawFunctors.hpp>
 #endif
-#include<yade/pkg/dem/CohFrictPhys.hpp>
-#include<yade/pkg/dem/CohFrictMat.hpp>
-#include<yade/pkg/dem/Ip2_CohFrictMat_CohFrictMat_CohFrictPhys.hpp>
+#include<yade/pkg/dem/CohesiveFrictionalContactLaw.hpp>
 #include<yade/pkg/common/CylScGeom6D.hpp>
 
 class Cylinder: public Sphere{

=== modified file 'pkg/common/Grid.hpp'
--- pkg/common/Grid.hpp	2014-05-23 13:05:19 +0000
+++ pkg/common/Grid.hpp	2014-07-14 20:08:33 +0000
@@ -23,7 +23,7 @@
 #pragma once
 #include "Sphere.hpp"
 #include <yade/pkg/dem/FrictPhys.hpp>
-#include <yade/pkg/dem/CohFrictPhys.hpp>
+#include <yade/pkg/dem/CohesiveFrictionalContactLaw.hpp>
 #include <yade/pkg/dem/ScGeom.hpp>
 #include <yade/core/Body.hpp>
 #include <yade/pkg/common/Dispatching.hpp>

=== removed file 'pkg/dem/CohFrictMat.cpp'
--- pkg/dem/CohFrictMat.cpp	2010-10-13 16:23:08 +0000
+++ pkg/dem/CohFrictMat.cpp	1970-01-01 00:00:00 +0000
@@ -1,19 +0,0 @@
-/*************************************************************************
-*  Copyright (C) 2007 by Bruno Chareyre <bruno.chareyre@xxxxxxxxxxx>     *
-*  Copyright (C) 2008 by Janek Kozicki <cosurgi@xxxxxxxxxx>              *
-*                                                                        *
-*  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 "CohFrictMat.hpp"
-
-
-CohFrictMat::~CohFrictMat()
-{
-}
-
-YADE_PLUGIN((CohFrictMat));
-
-
-

=== removed file 'pkg/dem/CohFrictMat.hpp'
--- pkg/dem/CohFrictMat.hpp	2014-06-02 09:07:27 +0000
+++ pkg/dem/CohFrictMat.hpp	1970-01-01 00:00:00 +0000
@@ -1,40 +0,0 @@
-/*************************************************************************
-*  Copyright (C) 2007 by Bruno Chareyre <bruno.chareyre@xxxxxxxxxxx>     *
-*  Copyright (C) 2008 by Janek Kozicki <cosurgi@xxxxxxxxxx>              *
-*                                                                        *
-*  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/common/ElastMat.hpp>
-
-
-class CohFrictMat : public FrictMat
-{
-	public :
-		virtual ~CohFrictMat ();
-
-/// Serialization
-	YADE_CLASS_BASE_DOC_ATTRS_CTOR(CohFrictMat,FrictMat,"",
-		((bool,isCohesive,true,,""))
-		((Real,alphaKr,2.0,,"Dimensionless rolling stiffness."))
-		((Real,alphaKtw,2.0,,"Dimensionless twist stiffness."))
-		((Real,etaRoll,-1.,,"Dimensionless rolling (aka 'bending') strength. If negative, rolling moment will be elastic."))
-		((Real,etaTwist,-1.,,"Dimensionless twisting strength. If negative, twist moment will be elastic."))
-		((Real,normalCohesion,-1,,"Tensile strength, homogeneous to a pressure. If negative the normal force is purely elastic."))
-		((Real,shearCohesion,-1,,"Shear strength, homogeneous to a pressure. If negative the shear force is purely elastic."))
-		((bool,momentRotationLaw,false,,"Use bending/twisting moment at contact. The contact will have moments only if both bodies have this flag true. See :yref:`CohFrictPhys::cohesionDisablesFriction` for details."))
-		,
-		createIndex();
-		);
-/// Indexable
-	REGISTER_CLASS_INDEX(CohFrictMat,FrictMat);
-};
-
-REGISTER_SERIALIZABLE(CohFrictMat);
-
-

=== removed file 'pkg/dem/CohFrictPhys.cpp'
--- pkg/dem/CohFrictPhys.cpp	2010-10-13 16:23:08 +0000
+++ pkg/dem/CohFrictPhys.cpp	1970-01-01 00:00:00 +0000
@@ -1,23 +0,0 @@
-/*************************************************************************
-*  Copyright (C) 2007 by Bruno Chareyre <bruno.chareyre@xxxxxxxxxxx>     *
-*  Copyright (C) 2008 by Janek Kozicki <cosurgi@xxxxxxxxxx>              *
-*                                                                        *
-*  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 "CohFrictPhys.hpp"
-
-void CohFrictPhys::SetBreakingState()
-{	
-	cohesionBroken = true;
-	normalAdhesion = 0;
-	shearAdhesion = 0;
-}
-
-CohFrictPhys::~CohFrictPhys()
-{
-}
-YADE_PLUGIN((CohFrictPhys));
-
-

=== removed file 'pkg/dem/CohFrictPhys.hpp'
--- pkg/dem/CohFrictPhys.hpp	2014-05-26 16:49:23 +0000
+++ pkg/dem/CohFrictPhys.hpp	1970-01-01 00:00:00 +0000
@@ -1,47 +0,0 @@
-/*************************************************************************
-*  Copyright (C) 2007 by Bruno Chareyre <bruno.chareyre@xxxxxxxxxxx>     *
-*  Copyright (C) 2008 by Janek Kozicki <cosurgi@xxxxxxxxxx>              *
-*                                                                        *
-*  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/common/NormShearPhys.hpp>
-#include<yade/pkg/dem/FrictPhys.hpp>
-
-class CohFrictPhys : public FrictPhys
-{
-	public :
-		virtual ~CohFrictPhys();
-		void SetBreakingState();
-
-	YADE_CLASS_BASE_DOC_ATTRS_CTOR(CohFrictPhys,FrictPhys,"",
-		((bool,cohesionDisablesFriction,false,,"is shear strength the sum of friction and adhesion or only adhesion?"))
-		((bool,cohesionBroken,true,,"is cohesion active? Set to false at the creation of a cohesive contact, and set to true when a fragile contact is broken"))
-		((bool,fragile,true,,"do cohesion disapear when contact strength is exceeded?"))
-		((Real,kr,0,,"rotational stiffness [N.m/rad]"))
-		((Real,ktw,0,,"twist stiffness [N.m/rad]"))
-		((Real,maxRollPl,0.0,,"Coefficient of rolling friction (negative means elastic)."))
-		((Real,maxTwistPl,0.0,,"Coefficient of twisting friction (negative means elastic)."))
-		((Real,normalAdhesion,0,,"tensile strength"))
-		((Real,shearAdhesion,0,,"cohesive part of the shear strength (a frictional term might be added depending on :yref:`CohFrictPhys::cohesionDisablesFriction`)"))
-		((Real,unp,0,,"plastic normal displacement, only used for tensile behaviour and if :yref:`CohFrictPhys::fragile` =false."))
-		((Real,unpMax,0,,"maximum value of plastic normal displacement, after that the interaction breaks even if :yref:`CohFrictPhys::fragile` =false. The default value (0) means no maximum."))
-		((bool,momentRotationLaw,false,,"use bending/twisting moment at contacts. See :yref:`Law2_ScGeom6D_CohFrictPhys_CohesionMoment::always_use_moment_law` for details."))
-		((bool,initCohesion,false,,"Initialize the cohesive behaviour with current state as equilibrium state (same as :yref:`Ip2_CohFrictMat_CohFrictMat_CohFrictPhys::setCohesionNow` but acting on only one interaction)"))
-		((Real,creep_viscosity,-1,,"creep viscosity [Pa.s/m]."))
-		// internal attributes
-		((Vector3r,moment_twist,Vector3r(0,0,0),(Attr::noSave | Attr::readonly),"Twist moment"))
-		((Vector3r,moment_bending,Vector3r(0,0,0),(Attr::noSave | Attr::readonly),"Bending moment"))
-		,
-		createIndex();
-	);
-/// Indexable
-	REGISTER_CLASS_INDEX(CohFrictPhys,FrictPhys);
-
-};
-
-REGISTER_SERIALIZABLE(CohFrictPhys);
-

=== modified file 'pkg/dem/CohesiveFrictionalContactLaw.cpp'
--- pkg/dem/CohesiveFrictionalContactLaw.cpp	2014-06-02 09:07:27 +0000
+++ pkg/dem/CohesiveFrictionalContactLaw.cpp	2014-07-14 20:08:33 +0000
@@ -7,13 +7,11 @@
 *************************************************************************/
 
 #include "CohesiveFrictionalContactLaw.hpp"
-#include<yade/pkg/dem/CohFrictMat.hpp>
 #include<yade/pkg/dem/ScGeom.hpp>
-#include<yade/pkg/dem/CohFrictPhys.hpp>
 #include<yade/core/Omega.hpp>
 #include<yade/core/Scene.hpp>
 
-YADE_PLUGIN((CohesiveFrictionalContactLaw)(Law2_ScGeom6D_CohFrictPhys_CohesionMoment));
+YADE_PLUGIN((CohesiveFrictionalContactLaw)(Law2_ScGeom6D_CohFrictPhys_CohesionMoment)(CohFrictMat)(CohFrictPhys)(Ip2_CohFrictMat_CohFrictMat_CohFrictPhys));
 CREATE_LOGGER(Law2_ScGeom6D_CohFrictPhys_CohesionMoment);
 
 Real Law2_ScGeom6D_CohFrictPhys_CohesionMoment::getPlasticDissipation() {return (Real) plasticDissipation;}
@@ -226,3 +224,76 @@
 		/// Moment law END       ///
 	}
 }
+
+
+void Ip2_CohFrictMat_CohFrictMat_CohFrictPhys::go(const shared_ptr<Material>& b1    // CohFrictMat
+                                        , const shared_ptr<Material>& b2 // CohFrictMat
+                                        , const shared_ptr<Interaction>& interaction)
+{
+	CohFrictMat* sdec1 = static_cast<CohFrictMat*>(b1.get());
+	CohFrictMat* sdec2 = static_cast<CohFrictMat*>(b2.get());
+	ScGeom6D* geom = YADE_CAST<ScGeom6D*>(interaction->geom.get());
+
+	//Create cohesive interractions only once
+	if (setCohesionNow && cohesionDefinitionIteration==-1) cohesionDefinitionIteration=scene->iter;
+	if (setCohesionNow && cohesionDefinitionIteration!=-1 && cohesionDefinitionIteration!=scene->iter) {
+		cohesionDefinitionIteration = -1;
+		setCohesionNow = 0;}
+
+	if (geom) {
+		if (!interaction->phys) {
+			interaction->phys = shared_ptr<CohFrictPhys>(new CohFrictPhys());
+			CohFrictPhys* contactPhysics = YADE_CAST<CohFrictPhys*>(interaction->phys.get());
+			Real Ea 	= sdec1->young;
+			Real Eb 	= sdec2->young;
+			Real Va 	= sdec1->poisson;
+			Real Vb 	= sdec2->poisson;
+			Real Da 	= geom->radius1;
+			Real Db 	= geom->radius2;
+			Real fa 	= sdec1->frictionAngle;
+			Real fb 	= sdec2->frictionAngle;
+			Real Kn = 2.0*Ea*Da*Eb*Db/(Ea*Da+Eb*Db);//harmonic average of two stiffnesses
+
+			// harmonic average of alphas parameters
+			Real AlphaKr = 2.0*sdec1->alphaKr*sdec2->alphaKr/(sdec1->alphaKr+sdec2->alphaKr);
+			Real AlphaKtw;
+			if (sdec1->alphaKtw && sdec2->alphaKtw) AlphaKtw = 2.0*sdec1->alphaKtw*sdec2->alphaKtw/(sdec1->alphaKtw+sdec2->alphaKtw);
+			else AlphaKtw=0;
+
+			Real Ks;
+			if (Va && Vb) Ks = 2.0*Ea*Da*Va*Eb*Db*Vb/(Ea*Da*Va+Eb*Db*Vb);//harmonic average of two stiffnesses with ks=V*kn for each sphere
+			else Ks=0;
+
+			contactPhysics->kr = Da*Db*Ks*AlphaKr;
+			contactPhysics->ktw = Da*Db*Ks*AlphaKtw;
+			contactPhysics->tangensOfFrictionAngle		= std::tan(std::min(fa,fb));
+
+			if ((setCohesionOnNewContacts || setCohesionNow) && sdec1->isCohesive && sdec2->isCohesive)
+			{
+				contactPhysics->cohesionBroken = false;
+				contactPhysics->normalAdhesion = std::min(sdec1->normalCohesion,sdec2->normalCohesion)*pow(std::min(Db, Da),2);
+				contactPhysics->shearAdhesion = std::min(sdec1->shearCohesion,sdec2->shearCohesion)*pow(std::min(Db, Da),2);
+				geom->initRotations(*(Body::byId(interaction->getId1(),scene)->state),*(Body::byId(interaction->getId2(),scene)->state));
+			}
+			contactPhysics->kn = Kn;
+			contactPhysics->ks = Ks;
+
+			contactPhysics->maxRollPl = min(sdec1->etaRoll*Da,sdec2->etaRoll*Db);
+			contactPhysics->maxTwistPl = min(sdec1->etaTwist*Da,sdec2->etaTwist*Db);
+			contactPhysics->momentRotationLaw=(sdec1->momentRotationLaw && sdec2->momentRotationLaw);
+		}
+		else {// !isNew, but if setCohesionNow, all contacts are initialized like if they were newly created
+			CohFrictPhys* contactPhysics = YADE_CAST<CohFrictPhys*>(interaction->phys.get());
+			if ((setCohesionNow && sdec1->isCohesive && sdec2->isCohesive) || contactPhysics->initCohesion)
+			{
+				contactPhysics->cohesionBroken = false;
+				contactPhysics->normalAdhesion = std::min(sdec1->normalCohesion,sdec2->normalCohesion)*pow(std::min(geom->radius2, geom->radius1),2);
+				contactPhysics->shearAdhesion = std::min(sdec1->shearCohesion,sdec2->shearCohesion)*pow(std::min(geom->radius2, geom->radius1),2);
+
+				geom->initRotations(*(Body::byId(interaction->getId1(),scene)->state),*(Body::byId(interaction->getId2(),scene)->state));
+				contactPhysics->initCohesion=false;
+			}
+		}
+	}
+};
+

=== modified file 'pkg/dem/CohesiveFrictionalContactLaw.hpp'
--- pkg/dem/CohesiveFrictionalContactLaw.hpp	2014-07-03 17:20:40 +0000
+++ pkg/dem/CohesiveFrictionalContactLaw.hpp	2014-07-14 20:08:33 +0000
@@ -9,10 +9,72 @@
 #pragma once
 
 #include<yade/core/GlobalEngine.hpp>
+#include<yade/pkg/common/Dispatching.hpp>
+#include<yade/pkg/common/ElastMat.hpp>
 #include<yade/pkg/dem/ScGeom.hpp>
-#include<yade/pkg/dem/CohFrictPhys.hpp>
-#include<yade/pkg/common/Dispatching.hpp>
 #include<boost/tuple/tuple.hpp>
+#include<yade/pkg/common/NormShearPhys.hpp>
+#include<yade/pkg/dem/FrictPhys.hpp>
+
+
+// The following code was moved from CohFrictMat.hpp
+class CohFrictMat : public FrictMat
+{
+	public :
+		virtual ~CohFrictMat () {};
+
+/// Serialization
+	YADE_CLASS_BASE_DOC_ATTRS_CTOR(CohFrictMat,FrictMat,"",
+		((bool,isCohesive,true,,""))
+		((Real,alphaKr,2.0,,"Dimensionless rolling stiffness."))
+		((Real,alphaKtw,2.0,,"Dimensionless twist stiffness."))
+		((Real,etaRoll,-1.,,"Dimensionless rolling (aka 'bending') strength. If negative, rolling moment will be elastic."))
+		((Real,etaTwist,-1.,,"Dimensionless twisting strength. If negative, twist moment will be elastic."))
+		((Real,normalCohesion,-1,,"Tensile strength, homogeneous to a pressure. If negative the normal force is purely elastic."))
+		((Real,shearCohesion,-1,,"Shear strength, homogeneous to a pressure. If negative the shear force is purely elastic."))
+		((bool,momentRotationLaw,false,,"Use bending/twisting moment at contact. The contact will have moments only if both bodies have this flag true. See :yref:`CohFrictPhys::cohesionDisablesFriction` for details."))
+		,
+		createIndex();
+		);
+/// Indexable
+	REGISTER_CLASS_INDEX(CohFrictMat,FrictMat);
+};
+
+REGISTER_SERIALIZABLE(CohFrictMat);
+
+// The following code was moved from CohFrictPhys.hpp
+class CohFrictPhys : public FrictPhys
+{
+	public :
+		virtual ~CohFrictPhys() {};
+		void SetBreakingState() {cohesionBroken = true; normalAdhesion = 0; shearAdhesion = 0;};
+
+	YADE_CLASS_BASE_DOC_ATTRS_CTOR(CohFrictPhys,FrictPhys,"",
+		((bool,cohesionDisablesFriction,false,,"is shear strength the sum of friction and adhesion or only adhesion?"))
+		((bool,cohesionBroken,true,,"is cohesion active? Set to false at the creation of a cohesive contact, and set to true when a fragile contact is broken"))
+		((bool,fragile,true,,"do cohesion disapear when contact strength is exceeded?"))
+		((Real,kr,0,,"rotational stiffness [N.m/rad]"))
+		((Real,ktw,0,,"twist stiffness [N.m/rad]"))
+		((Real,maxRollPl,0.0,,"Coefficient of rolling friction (negative means elastic)."))
+		((Real,maxTwistPl,0.0,,"Coefficient of twisting friction (negative means elastic)."))
+		((Real,normalAdhesion,0,,"tensile strength"))
+		((Real,shearAdhesion,0,,"cohesive part of the shear strength (a frictional term might be added depending on :yref:`CohFrictPhys::cohesionDisablesFriction`)"))
+		((Real,unp,0,,"plastic normal displacement, only used for tensile behaviour and if :yref:`CohFrictPhys::fragile` =false."))
+		((Real,unpMax,0,,"maximum value of plastic normal displacement, after that the interaction breaks even if :yref:`CohFrictPhys::fragile` =false. The default value (0) means no maximum."))
+		((bool,momentRotationLaw,false,,"use bending/twisting moment at contacts. See :yref:`Law2_ScGeom6D_CohFrictPhys_CohesionMoment::always_use_moment_law` for details."))
+		((bool,initCohesion,false,,"Initialize the cohesive behaviour with current state as equilibrium state (same as :yref:`Ip2_CohFrictMat_CohFrictMat_CohFrictPhys::setCohesionNow` but acting on only one interaction)"))
+		((Real,creep_viscosity,-1,,"creep viscosity [Pa.s/m]."))
+		// internal attributes
+		((Vector3r,moment_twist,Vector3r(0,0,0),(Attr::noSave | Attr::readonly),"Twist moment"))
+		((Vector3r,moment_bending,Vector3r(0,0,0),(Attr::noSave | Attr::readonly),"Bending moment"))
+		,
+		createIndex();
+	);
+/// Indexable
+	REGISTER_CLASS_INDEX(CohFrictPhys,FrictPhys);
+};
+
+REGISTER_SERIALIZABLE(CohFrictPhys);
 
 class Law2_ScGeom6D_CohFrictPhys_CohesionMoment: public LawFunctor{
 	public:
@@ -68,3 +130,23 @@
 
 REGISTER_SERIALIZABLE(CohesiveFrictionalContactLaw);
 
+// The following code was moved from Ip2_CohFrictMat_CohFrictMat_CohFrictPhys.hpp
+class Ip2_CohFrictMat_CohFrictMat_CohFrictPhys : public IPhysFunctor
+{
+	public :
+		virtual void go(	const shared_ptr<Material>& b1,
+					const shared_ptr<Material>& b2,
+					const shared_ptr<Interaction>& interaction);
+		int cohesionDefinitionIteration;
+
+		YADE_CLASS_BASE_DOC_ATTRS_CTOR(Ip2_CohFrictMat_CohFrictMat_CohFrictPhys,IPhysFunctor,
+		"Generates cohesive-frictional interactions with moments, used in the contact law :yref:`Law2_ScGeom6D_CohFrictPhys_CohesionMoment`. The normal/shear stiffness and friction definitions are the same as in :yref:`Ip2_FrictMat_FrictMat_FrictPhys`, check the documentation there for details.\n\nAdhesions related to the normal and the shear components are calculated form :yref:`CohFrictMat::normalCohesion` ($C_n$) and :yref:`CohFrictMat::shearlCohesion` ($C_s$). For particles of size $R_1$,$R_2$ the adhesion will be $a_i=C_i min(R_1,R_2)^2$, $i=n\\,s$.\n\nTwist and rolling stiffnesses are proportional to the shear stiffness through dimensionless factors alphaKtw and alphaKr, such that the rotational stiffnesses are defined by $k_s \\alpha_i R_1 R_2$, $i=tw\\,r$",
+		((bool,setCohesionNow,false,,"If true, assign cohesion to all existing contacts in current time-step. The flag is turned false automatically, so that assignment is done in the current timestep only."))
+		((bool,setCohesionOnNewContacts,false,,"If true, assign cohesion at all new contacts. If false, only existing contacts can be cohesive (also see :yref:`Ip2_CohFrictMat_CohFrictMat_CohFrictPhys::setCohesionNow`), and new contacts are only frictional."))	
+		,
+		cohesionDefinitionIteration = -1;
+		);
+	FUNCTOR2D(CohFrictMat,CohFrictMat);
+};
+
+REGISTER_SERIALIZABLE(Ip2_CohFrictMat_CohFrictMat_CohFrictPhys);

=== modified file 'pkg/dem/CohesiveTriaxialTest.cpp'
--- pkg/dem/CohesiveTriaxialTest.cpp	2014-07-03 17:20:40 +0000
+++ pkg/dem/CohesiveTriaxialTest.cpp	2014-07-14 20:08:33 +0000
@@ -9,8 +9,6 @@
 #include "CohesiveTriaxialTest.hpp"
 
 #include<yade/pkg/dem/CohesiveFrictionalContactLaw.hpp>
-#include<yade/pkg/dem/Ip2_CohFrictMat_CohFrictMat_CohFrictPhys.hpp>
-#include<yade/pkg/dem/CohFrictMat.hpp>
 #include<yade/pkg/dem/GlobalStiffnessTimeStepper.hpp>
 
 #include<yade/pkg/dem/TriaxialStressController.hpp>

=== modified file 'pkg/dem/Ip2_2xInelastCohFrictMat_InelastCohFrictPhys.hpp'
--- pkg/dem/Ip2_2xInelastCohFrictMat_InelastCohFrictPhys.hpp	2013-06-25 08:02:13 +0000
+++ pkg/dem/Ip2_2xInelastCohFrictMat_InelastCohFrictPhys.hpp	2014-07-14 20:08:33 +0000
@@ -7,7 +7,7 @@
 
 
 #pragma once
-#include "Ip2_CohFrictMat_CohFrictMat_CohFrictPhys.hpp"
+#include "CohesiveFrictionalContactLaw.hpp"
 #include "InelastCohFrictMat.hpp"
 #include "InelastCohFrictPhys.hpp"
 #include<yade/pkg/dem/ScGeom.hpp>
@@ -29,4 +29,4 @@
 	FUNCTOR2D(InelastCohFrictMat,InelastCohFrictMat);
 };
 
-REGISTER_SERIALIZABLE(Ip2_2xInelastCohFrictMat_InelastCohFrictPhys);
\ No newline at end of file
+REGISTER_SERIALIZABLE(Ip2_2xInelastCohFrictMat_InelastCohFrictPhys);

=== removed file 'pkg/dem/Ip2_CohFrictMat_CohFrictMat_CohFrictPhys.cpp'
--- pkg/dem/Ip2_CohFrictMat_CohFrictMat_CohFrictPhys.cpp	2014-05-26 16:49:23 +0000
+++ pkg/dem/Ip2_CohFrictMat_CohFrictMat_CohFrictPhys.cpp	1970-01-01 00:00:00 +0000
@@ -1,89 +0,0 @@
-/*************************************************************************
-*  Copyright (C) 2007 by Bruno Chareyre <bruno.chareyre@xxxxxxxxxxx>     *
-*  Copyright (C) 2008 by Janek Kozicki <cosurgi@xxxxxxxxxx>              *
-*                                                                        *
-*  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"Ip2_CohFrictMat_CohFrictMat_CohFrictPhys.hpp"
-#include<yade/pkg/dem/ScGeom.hpp>
-#include<yade/pkg/dem/CohFrictPhys.hpp>
-#include<yade/pkg/dem/CohFrictMat.hpp>
-#include<yade/core/Omega.hpp>
-#include<yade/core/Scene.hpp>
-
-void Ip2_CohFrictMat_CohFrictMat_CohFrictPhys::go(const shared_ptr<Material>& b1    // CohFrictMat
-                                        , const shared_ptr<Material>& b2 // CohFrictMat
-                                        , const shared_ptr<Interaction>& interaction)
-{
-	CohFrictMat* sdec1 = static_cast<CohFrictMat*>(b1.get());
-	CohFrictMat* sdec2 = static_cast<CohFrictMat*>(b2.get());
-	ScGeom6D* geom = YADE_CAST<ScGeom6D*>(interaction->geom.get());
-
-	//Create cohesive interractions only once
-	if (setCohesionNow && cohesionDefinitionIteration==-1) cohesionDefinitionIteration=scene->iter;
-	if (setCohesionNow && cohesionDefinitionIteration!=-1 && cohesionDefinitionIteration!=scene->iter) {
-		cohesionDefinitionIteration = -1;
-		setCohesionNow = 0;}
-
-	if (geom) {
-		if (!interaction->phys) {
-			interaction->phys = shared_ptr<CohFrictPhys>(new CohFrictPhys());
-			CohFrictPhys* contactPhysics = YADE_CAST<CohFrictPhys*>(interaction->phys.get());
-			Real Ea 	= sdec1->young;
-			Real Eb 	= sdec2->young;
-			Real Va 	= sdec1->poisson;
-			Real Vb 	= sdec2->poisson;
-			Real Da 	= geom->radius1;
-			Real Db 	= geom->radius2;
-			Real fa 	= sdec1->frictionAngle;
-			Real fb 	= sdec2->frictionAngle;
-			Real Kn = 2.0*Ea*Da*Eb*Db/(Ea*Da+Eb*Db);//harmonic average of two stiffnesses
-
-			// harmonic average of alphas parameters
-			Real AlphaKr = 2.0*sdec1->alphaKr*sdec2->alphaKr/(sdec1->alphaKr+sdec2->alphaKr);
-			Real AlphaKtw;
-			if (sdec1->alphaKtw && sdec2->alphaKtw) AlphaKtw = 2.0*sdec1->alphaKtw*sdec2->alphaKtw/(sdec1->alphaKtw+sdec2->alphaKtw);
-			else AlphaKtw=0;
-
-			Real Ks;
-			if (Va && Vb) Ks = 2.0*Ea*Da*Va*Eb*Db*Vb/(Ea*Da*Va+Eb*Db*Vb);//harmonic average of two stiffnesses with ks=V*kn for each sphere
-			else Ks=0;
-
-			contactPhysics->kr = Da*Db*Ks*AlphaKr;
-			contactPhysics->ktw = Da*Db*Ks*AlphaKtw;
-			contactPhysics->tangensOfFrictionAngle		= std::tan(std::min(fa,fb));
-
-			if ((setCohesionOnNewContacts || setCohesionNow) && sdec1->isCohesive && sdec2->isCohesive)
-			{
-				contactPhysics->cohesionBroken = false;
-				contactPhysics->normalAdhesion = std::min(sdec1->normalCohesion,sdec2->normalCohesion)*pow(std::min(Db, Da),2);
-				contactPhysics->shearAdhesion = std::min(sdec1->shearCohesion,sdec2->shearCohesion)*pow(std::min(Db, Da),2);
-				geom->initRotations(*(Body::byId(interaction->getId1(),scene)->state),*(Body::byId(interaction->getId2(),scene)->state));
-			}
-			contactPhysics->kn = Kn;
-			contactPhysics->ks = Ks;
-
-			contactPhysics->maxRollPl = min(sdec1->etaRoll*Da,sdec2->etaRoll*Db);
-			contactPhysics->maxTwistPl = min(sdec1->etaTwist*Da,sdec2->etaTwist*Db);
-			contactPhysics->momentRotationLaw=(sdec1->momentRotationLaw && sdec2->momentRotationLaw);
-		}
-		else {// !isNew, but if setCohesionNow, all contacts are initialized like if they were newly created
-			CohFrictPhys* contactPhysics = YADE_CAST<CohFrictPhys*>(interaction->phys.get());
-			if ((setCohesionNow && sdec1->isCohesive && sdec2->isCohesive) || contactPhysics->initCohesion)
-			{
-				contactPhysics->cohesionBroken = false;
-				contactPhysics->normalAdhesion = std::min(sdec1->normalCohesion,sdec2->normalCohesion)*pow(std::min(geom->radius2, geom->radius1),2);
-				contactPhysics->shearAdhesion = std::min(sdec1->shearCohesion,sdec2->shearCohesion)*pow(std::min(geom->radius2, geom->radius1),2);
-
-				geom->initRotations(*(Body::byId(interaction->getId1(),scene)->state),*(Body::byId(interaction->getId2(),scene)->state));
-				contactPhysics->initCohesion=false;
-			}
-		}
-	}
-};
-YADE_PLUGIN((Ip2_CohFrictMat_CohFrictMat_CohFrictPhys));
-
-
-

=== removed file 'pkg/dem/Ip2_CohFrictMat_CohFrictMat_CohFrictPhys.hpp'
--- pkg/dem/Ip2_CohFrictMat_CohFrictMat_CohFrictPhys.hpp	2014-05-21 16:01:55 +0000
+++ pkg/dem/Ip2_CohFrictMat_CohFrictMat_CohFrictPhys.hpp	1970-01-01 00:00:00 +0000
@@ -1,34 +0,0 @@
-/*************************************************************************
-*  Copyright (C) 2007 by Bruno Chareyre <bruno.chareyre@xxxxxxxxxxx>     *
-*  Copyright (C) 2008 by Janek Kozicki <cosurgi@xxxxxxxxxx>              *
-*                                                                        *
-*  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/common/Dispatching.hpp>
-#include<yade/pkg/dem/CohFrictMat.hpp>
-
-class Ip2_CohFrictMat_CohFrictMat_CohFrictPhys : public IPhysFunctor
-{
-	public :
-		virtual void go(	const shared_ptr<Material>& b1,
-					const shared_ptr<Material>& b2,
-					const shared_ptr<Interaction>& interaction);
-		int cohesionDefinitionIteration;
-
-		YADE_CLASS_BASE_DOC_ATTRS_CTOR(Ip2_CohFrictMat_CohFrictMat_CohFrictPhys,IPhysFunctor,
-		"Generates cohesive-frictional interactions with moments, used in the contact law :yref:`Law2_ScGeom6D_CohFrictPhys_CohesionMoment`. The normal/shear stiffness and friction definitions are the same as in :yref:`Ip2_FrictMat_FrictMat_FrictPhys`, check the documentation there for details.\n\nAdhesions related to the normal and the shear components are calculated form :yref:`CohFrictMat::normalCohesion` ($C_n$) and :yref:`CohFrictMat::shearlCohesion` ($C_s$). For particles of size $R_1$,$R_2$ the adhesion will be $a_i=C_i min(R_1,R_2)^2$, $i=n\\,s$.\n\nTwist and rolling stiffnesses are proportional to the shear stiffness through dimensionless factors alphaKtw and alphaKr, such that the rotational stiffnesses are defined by $k_s \\alpha_i R_1 R_2$, $i=tw\\,r$",
-		((bool,setCohesionNow,false,,"If true, assign cohesion to all existing contacts in current time-step. The flag is turned false automatically, so that assignment is done in the current timestep only."))
-		((bool,setCohesionOnNewContacts,false,,"If true, assign cohesion at all new contacts. If false, only existing contacts can be cohesive (also see :yref:`Ip2_CohFrictMat_CohFrictMat_CohFrictPhys::setCohesionNow`), and new contacts are only frictional."))	
-		,
-		cohesionDefinitionIteration = -1;
-		);
-	FUNCTOR2D(CohFrictMat,CohFrictMat);
-};
-
-REGISTER_SERIALIZABLE(Ip2_CohFrictMat_CohFrictMat_CohFrictPhys);
-
-

=== modified file 'pkg/lbm/HydrodynamicsLawLBM.cpp'
--- pkg/lbm/HydrodynamicsLawLBM.cpp	2014-07-03 07:16:58 +0000
+++ pkg/lbm/HydrodynamicsLawLBM.cpp	2014-07-14 20:08:33 +0000
@@ -29,7 +29,7 @@
 #include<boost/filesystem/operations.hpp>
 #include<yade/pkg/common/Box.hpp>
 #include<yade/pkg/common/Sphere.hpp>
-#include<yade/pkg/dem/CohFrictPhys.hpp>
+#include<yade/pkg/dem/CohesiveFrictionalContactLaw.hpp>
 
 
 namespace bfs=boost::filesystem;