← Back to team overview

yade-dev team mailing list archive

[Branch ~yade-pkg/yade/git-trunk] Rev 3853: added MatchMaker for E in Ip2_CmpMat_CpmMat_CpmPhys

 

------------------------------------------------------------
revno: 3853
committer: Jan Stransky <jan.stransky@xxxxxxxxxxx>
timestamp: Sat 2016-04-23 19:54:37 +0200
message:
  added MatchMaker for E in Ip2_CmpMat_CpmMat_CpmPhys
modified:
  pkg/dem/ConcretePM.cpp
  pkg/dem/ConcretePM.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/ConcretePM.cpp'
--- pkg/dem/ConcretePM.cpp	2016-04-13 08:37:42 +0000
+++ pkg/dem/ConcretePM.cpp	2016-04-23 17:54:37 +0000
@@ -76,8 +76,9 @@
 	} else {
 		// averaging over both materials
 		#define _AVGATTR(a) cpmPhys->a=.5*(mat1->a+mat2->a)
-			cpmPhys->E = .5*(mat1->young + mat2->young);
-			cpmPhys->G = .5*(mat1->poisson + mat2->poisson)*.5*(mat1->young + mat2->young);
+			Real e = (!E) ? .5*(mat1->young + mat2->young) : (*E)(mat1->id,mat2->id,mat1->young,mat2->young);
+			cpmPhys->E = e;
+			cpmPhys->G = .5*(mat1->poisson + mat2->poisson)*cpmPhys->E;
 			cpmPhys->tanFrictionAngle = tan(.5*(mat1->frictionAngle + mat2->frictionAngle));
 			cpmPhys->undamagedCohesion = .5*(mat1->sigmaT + mat2->sigmaT);
 			cpmPhys->isCohesive = (cohesiveThresholdIter < 0 || scene->iter < cohesiveThresholdIter);

=== modified file 'pkg/dem/ConcretePM.hpp'
--- pkg/dem/ConcretePM.hpp	2016-04-13 08:37:42 +0000
+++ pkg/dem/ConcretePM.hpp	2016-04-23 17:54:37 +0000
@@ -229,6 +229,7 @@
 		DECLARE_LOGGER;
 		YADE_CLASS_BASE_DOC_ATTRS(Ip2_CpmMat_CpmMat_CpmPhys,IPhysFunctor,"Convert 2 :yref:`CpmMat` instances to :yref:`CpmPhys` with corresponding parameters. Uses simple (arithmetic) averages if material are different. Simple copy of parameters is performed if the :yref:`material<CpmMat>` is shared between both particles. See :yref:`cpm-model<CpmMat>` for detals.",
 			((long,cohesiveThresholdIter,10,,"Should new contacts be cohesive? They will before this iter#, they will not be afterwards. If 0, they will never be. If negative, they will always be created as cohesive (10 by default)."))
+			((shared_ptr<MatchMaker>,E,,,"Instance of :yref:`MatchMaker` determining how to compute interaction's normal modulus. If ``None``, average value is used."))
 		);
 };
 REGISTER_SERIALIZABLE(Ip2_CpmMat_CpmMat_CpmPhys);