yade-dev team mailing list archive
-
yade-dev team
-
Mailing list archive
-
Message #04552
[Branch ~yade-dev/yade/trunk] Rev 2247: - Implement scaleDisplacementT(multiplier) for all functors derived from Dem3DOF. This function i...
------------------------------------------------------------
revno: 2247
committer: Bruno Chareyre <bchareyre@r1arduina>
branch nick: trunk
timestamp: Mon 2010-05-24 17:42:48 +0200
message:
- Implement scaleDisplacementT(multiplier) for all functors derived from Dem3DOF. This function is only used in
Law2_Dem3DOFGeom_FrictPhys_basic at the moment.
- Fix the undefined scene pointer in ElasticContactLaw.
modified:
pkg/dem/DataClass/InteractionGeometry/Dem3DofGeom_FacetSphere.cpp
pkg/dem/DataClass/InteractionGeometry/Dem3DofGeom_FacetSphere.hpp
pkg/dem/DataClass/InteractionGeometry/Dem3DofGeom_SphereSphere.hpp
pkg/dem/DataClass/InteractionGeometry/Dem3DofGeom_WallSphere.cpp
pkg/dem/DataClass/InteractionGeometry/Dem3DofGeom_WallSphere.hpp
pkg/dem/Engine/GlobalEngine/ElasticContactLaw.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/dem/DataClass/InteractionGeometry/Dem3DofGeom_FacetSphere.cpp'
--- pkg/dem/DataClass/InteractionGeometry/Dem3DofGeom_FacetSphere.cpp 2010-05-03 12:17:44 +0000
+++ pkg/dem/DataClass/InteractionGeometry/Dem3DofGeom_FacetSphere.cpp 2010-05-24 15:42:48 +0000
@@ -38,6 +38,15 @@
return (displacementTMax/scale)*(1-scale);
}
+Vector3r Dem3DofGeom_FacetSphere::scaleDisplacementT(Real multiplier){
+ assert(multiplier>=0 && multiplier<=1);
+ Vector3r p1=contPtInTgPlane1(), p2=contPtInTgPlane2();
+ Vector3r diff=.5*(multiplier-1)*(p2-p1);
+ setTgPlanePts(p1-diff,p2+diff);
+ return 2*diff;
+}
+
+
CREATE_LOGGER(Ig2_Facet_Sphere_Dem3DofGeom);
bool Ig2_Facet_Sphere_Dem3DofGeom::go(const shared_ptr<Shape>& cm1, const shared_ptr<Shape>& cm2, const State& state1, const State& state2, const Vector3r& shift2, const bool& force, const shared_ptr<Interaction>& c){
Facet* facet=static_cast<Facet*>(cm1.get());
=== modified file 'pkg/dem/DataClass/InteractionGeometry/Dem3DofGeom_FacetSphere.hpp'
--- pkg/dem/DataClass/InteractionGeometry/Dem3DofGeom_FacetSphere.hpp 2010-04-25 15:46:26 +0000
+++ pkg/dem/DataClass/InteractionGeometry/Dem3DofGeom_FacetSphere.hpp 2010-05-24 15:42:48 +0000
@@ -16,6 +16,7 @@
virtual Real displacementN(){ return (se32.position-contactPoint).norm()-refLength;}
virtual Vector3r displacementT(){ relocateContactPoints(); return contPtInTgPlane2()-contPtInTgPlane1(); }
virtual Real slipToDisplacementTMax(Real displacementTMax);
+ virtual Vector3r scaleDisplacementT(Real multiplier);
/***** end API ******/
void setTgPlanePts(const Vector3r&, const Vector3r&);
=== modified file 'pkg/dem/DataClass/InteractionGeometry/Dem3DofGeom_SphereSphere.hpp'
--- pkg/dem/DataClass/InteractionGeometry/Dem3DofGeom_SphereSphere.hpp 2010-05-20 18:39:42 +0000
+++ pkg/dem/DataClass/InteractionGeometry/Dem3DofGeom_SphereSphere.hpp 2010-05-24 15:42:48 +0000
@@ -27,8 +27,8 @@
return contPtInTgPlane2()-contPtInTgPlane1();
#endif
}
- Real slipToDisplacementTMax(Real displacementTMax);
- Vector3r scaleDisplacementT(Real multiplier);
+ virtual Real slipToDisplacementTMax(Real displacementTMax);
+ virtual Vector3r scaleDisplacementT(Real multiplier);
/********* end API ***********/
YADE_CLASS_BASE_DOC_ATTRS_INIT_CTOR_PY(Dem3DofGeom_SphereSphere,Dem3DofGeom,"Class representing 2 spheres in contact which computes 3 degrees of freedom (normal and shear deformation).",
=== modified file 'pkg/dem/DataClass/InteractionGeometry/Dem3DofGeom_WallSphere.cpp'
--- pkg/dem/DataClass/InteractionGeometry/Dem3DofGeom_WallSphere.cpp 2010-05-03 12:17:44 +0000
+++ pkg/dem/DataClass/InteractionGeometry/Dem3DofGeom_WallSphere.cpp 2010-05-24 15:42:48 +0000
@@ -38,6 +38,14 @@
return (displacementTMax/scale)*(1-scale);
}
+Vector3r Dem3DofGeom_WallSphere::scaleDisplacementT(Real multiplier){
+ assert(multiplier>=0 && multiplier<=1);
+ Vector3r p1=contPtInTgPlane1(), p2=contPtInTgPlane2();
+ Vector3r diff=.5*(multiplier-1)*(p2-p1);
+ setTgPlanePts(p1-diff,p2+diff);
+ return 2*diff;
+}
+
CREATE_LOGGER(Ig2_Wall_Sphere_Dem3DofGeom);
bool Ig2_Wall_Sphere_Dem3DofGeom::go(const shared_ptr<Shape>& cm1, const shared_ptr<Shape>& cm2, const State& state1, const State& state2, const Vector3r& shift2, const bool& force, const shared_ptr<Interaction>& c){
Wall* wall=static_cast<Wall*>(cm1.get());
=== modified file 'pkg/dem/DataClass/InteractionGeometry/Dem3DofGeom_WallSphere.hpp'
--- pkg/dem/DataClass/InteractionGeometry/Dem3DofGeom_WallSphere.hpp 2010-05-03 12:17:44 +0000
+++ pkg/dem/DataClass/InteractionGeometry/Dem3DofGeom_WallSphere.hpp 2010-05-24 15:42:48 +0000
@@ -14,6 +14,7 @@
virtual Real displacementN(){ return (se32.position-contactPoint).norm()-refLength;}
virtual Vector3r displacementT(){ relocateContactPoints(); return contPtInTgPlane2()-contPtInTgPlane1(); }
virtual Real slipToDisplacementTMax(Real displacementTMax);
+ virtual Vector3r scaleDisplacementT(Real multiplier);
/***** end API ******/
void setTgPlanePts(const Vector3r&, const Vector3r&);
=== modified file 'pkg/dem/Engine/GlobalEngine/ElasticContactLaw.cpp'
--- pkg/dem/Engine/GlobalEngine/ElasticContactLaw.cpp 2010-05-20 18:39:42 +0000
+++ pkg/dem/Engine/GlobalEngine/ElasticContactLaw.cpp 2010-05-24 15:42:48 +0000
@@ -25,6 +25,7 @@
if(!functor) functor=shared_ptr<Law2_ScGeom_FrictPhys_Basic>(new Law2_ScGeom_FrictPhys_Basic);
functor->useShear=useShear;
functor->neverErase=neverErase;
+ functor->scene=scene;
FOREACH(const shared_ptr<Interaction>& I, *scene->interactions){
if(!I->isReal()) continue;
#ifdef YADE_DEBUG