yade-dev team mailing list archive
-
yade-dev team
-
Mailing list archive
-
Message #05303
[Branch ~yade-dev/yade/trunk] Rev 2357: - Cylinder, update contact point consistently with current segment definition.
------------------------------------------------------------
revno: 2357
committer: bchareyre <bchareyre@dt-rv020>
branch nick: trunk
timestamp: Mon 2010-07-12 20:44:19 +0200
message:
- Cylinder, update contact point consistently with current segment definition.
- Fix the poisson=0 case (was returning undefined Ks for division by 0...)
- This commit enables wire-like behaviour without moment when ks=0
modified:
pkg/common/DataClass/Shape/Cylinder.cpp
pkg/common/DataClass/Shape/Cylinder.hpp
pkg/dem/Engine/Functor/Ip2_2xCohFrictMat_CohFrictPhys.cpp
--
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/common/DataClass/Shape/Cylinder.cpp'
--- pkg/common/DataClass/Shape/Cylinder.cpp 2010-07-12 17:49:15 +0000
+++ pkg/common/DataClass/Shape/Cylinder.cpp 2010-07-12 18:44:19 +0000
@@ -135,7 +135,7 @@
//length only used for display
s->length=length;
scm->penetrationDepth=s->initLength-length;
- scm->contactPoint=pChain->pos+pChain->ori*Vector3r::UnitZ()*length;
+ scm->contactPoint=pChain->pos+segment;
#ifdef IGCACHE
if (scene->isPeriodic) {
Vector3r shiftVel = scene->cell->velGrad*scene->cell->Hsize*c->cellDist.cast<Real>();
@@ -209,6 +209,7 @@
//glMaterialv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, Vector3f(cm->color[0],cm->color[1],cm->color[2]));
glColor3v(cm->color);
if(glutNormalize) glPushAttrib(GL_NORMALIZE); // as per http://lists.apple.com/archives/Mac-opengl/2002/Jul/msg00085.html
+ cerr<<"DispatchOK";
// glPushMatrix();
out(shift);
if (wire || wire2) drawCylinder(true, r,length,shift);
=== modified file 'pkg/common/DataClass/Shape/Cylinder.hpp'
--- pkg/common/DataClass/Shape/Cylinder.hpp 2010-07-12 17:49:15 +0000
+++ pkg/common/DataClass/Shape/Cylinder.hpp 2010-07-12 18:44:19 +0000
@@ -15,7 +15,7 @@
public:
Cylinder(Real _radius, Real _length): radius(_radius), length(_length), segment(Vector3r(0,0,1)*_length){ createIndex(); }
virtual ~Cylinder ();
- YADE_CLASS_BASE_DOC_ATTRS_CTOR(Cylinder,Shape,"Geometry of a cylinder, as Minkowsky sum of line and sphere.",
+ YADE_CLASS_BASE_DOC_ATTRS_CTOR(Cylinder,Shape,"Geometry of a cylinder, as Minkowski sum of line and sphere.",
((Real,radius,NaN,"Radius [m]"))
((Real,length,NaN,"Length [m]"))
((Vector3r,segment,Vector3r::Zero(),"Length vector")),
=== modified file 'pkg/dem/Engine/Functor/Ip2_2xCohFrictMat_CohFrictPhys.cpp'
--- pkg/dem/Engine/Functor/Ip2_2xCohFrictMat_CohFrictPhys.cpp 2010-05-20 18:39:42 +0000
+++ pkg/dem/Engine/Functor/Ip2_2xCohFrictMat_CohFrictPhys.cpp 2010-07-12 18:44:19 +0000
@@ -44,8 +44,11 @@
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
- Real Ks = 2.0*Ea*Da*Va*Eb*Db*Vb/(Ea*Da*Va+Eb*Db*Va);//harmonic average of two stiffnesses with ks=V*kn for each sphere
+ 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;
+
// Jean-Patrick Plassiard, Noura Belhaine, Frederic
// Victor Donze, "Calibration procedure for spherical
// discrete elements using a local moemnt law".