revno: 2589
committer: Bruno Chareyre bruno.chare...@hmg.inpg.fr
branch nick: yade
timestamp: Mon 2010-12-06 12:54:38 +0100
message:
- PeriTriax : remove the constant-distance approximation in stress
definition, using wrapped coordinates instead of radii.
- Get back standalone energy tracing in ECL.
modified:
pkg/dem/ElasticContactLaw.cpp
pkg/dem/ElasticContactLaw.hpp
pkg/dem/PeriIsoCompressor.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/ElasticContactLaw.cpp'
--- pkg/dem/ElasticContactLaw.cpp 2010-11-22 17:58:56 +
+++ pkg/dem/ElasticContactLaw.cpp 2010-12-06 11:54:38 +
@@ -14,7 +14,7 @@
YADE_PLUGIN((Law2_ScGeom_FrictPhys_CundallStrack)(Law2_Dem3DofGeom_FrictPhys_CundallStrack)(ElasticContactLaw));
-#if 0
+#if 1
Real Law2_ScGeom_FrictPhys_CundallStrack::getPlasticDissipation() {return (Real) plasticDissipation;}
void Law2_ScGeom_FrictPhys_CundallStrack::initPlasticDissipation(Real initVal) {plasticDissipation.reset(); plasticDissipation+=initVal;}
Real Law2_ScGeom_FrictPhys_CundallStrack::elasticEnergy()
@@ -39,7 +39,7 @@
if(!I-isReal()) continue;
#ifdef YADE_DEBUG
// these checks would be redundant in the functor (LawDispatcher does that already)
- if(!dynamic_castScGeom*(I-geom.get()) || !dynamic_castFrictPhys*(I-phys.get())) continue;
+ if(!dynamic_castScGeom*(I-geom.get()) || !dynamic_castFrictPhys*(I-phys.get())) continue;
#endif
functor-go(I-geom, I-phys, I.get());
}
@@ -68,7 +68,7 @@
shearForce -= phys-ks*shearDisp;
Real maxFs = phys-normalForce.squaredNorm()*std::pow(phys-tangensOfFrictionAngle,2);
- if (likely(!scene-trackEnergy)){//Update force but don't compute energy terms (see below))
+ if (likely(!scene-trackEnergy !traceEnergy)){//Update force but don't compute energy terms (see below))
// PFC3d SlipModel, is using friction angle. CoulombCriterion
if( shearForce.squaredNorm() maxFs ){
Real ratio = sqrt(maxFs) / shearForce.norm();
@@ -81,7 +81,8 @@
//define the plastic work input and increment the total plastic energy dissipated
shearForce *= ratio;
Real dissip=((1/phys-ks)*(trialForce-shearForce))/*plastic disp*/ .dot(shearForce)/*active force*/;
- if(dissip0) scene-energy-add(dissip,plastDissip,plastDissipIx,/*reset*/false);
+ if (traceEnergy) plasticDissipation += dissip;
+ else if(dissip0) scene-energy-add(dissip,plastDissip,plastDissipIx,/*reset*/false);
}
// compute elastic energy as well
scene-energy-add(0.5*(phys-normalForce.squaredNorm()/phys-kn+phys-shearForce.squaredNorm()/phys-ks),elastPotential,elastPotentialIx,/*reset at every timestep*/true);
=== modified file 'pkg/dem/ElasticContactLaw.hpp'
--- pkg/dem/ElasticContactLaw.hpp 2010-11-12 18:44:15 +
+++ pkg/dem/ElasticContactLaw.hpp 2010-12-06 11:54:38 +
@@ -16,20 +16,20 @@
class Law2_ScGeom_FrictPhys_CundallStrack: public LawFunctor{
public:
- //OpenMPAccumulatorReal plasticDissipation;
+ OpenMPAccumulatorReal plasticDissipation;
virtual void go(shared_ptrIGeom _geom, shared_ptrIPhys _phys, Interaction* I);
- //Real elasticEnergy ();
- //Real getPlasticDissipation();
- //void initPlasticDissipation(Real initVal=0);
+ Real elasticEnergy ();
+ Real getPlasticDissipation();
+ void initPlasticDissipation(Real initVal=0);
YADE_CLASS_BASE_DOC_ATTRS_CTOR_PY(Law2_ScGeom_FrictPhys_CundallStrack,LawFunctor,Law for linear compression, and Mohr-Coulomb plasticity surface without cohesion.\nThis law implements the classical linear elastic-plastic law from [CundallStrack1979]_ (see also [Pfc3dManual30]_). The normal force is (with the convention of positive tensile forces) $F_n=\\min(k_n u_n, 0)$. The shear force is $F_s=k_s u_s$, the plasticity condition defines the maximum value of the shear force : $F_s^{\\max}=F_n\\tan(\\phi)$, with $\\phi$ the friction angle.\n\n.. note::\n This law uses :yref:`ScGeom`; there is also functionally equivalent :yref:`Law2_Dem3DofGeom_FrictPhys_CundallStrack`, which uses :yref:`Dem3DofGeom` (sphere-box interactions are not implemented for the latest).\n\n.. note::\n This law is well tested in the context of triaxial simulation, and has been used for a number of published results (see e.g. [Scholtes2009b]_ and other papers from the same authors). It is generalised by :yref:`Law2_ScGeom6D_CohFrictPhys_CohesionMoment`, which adds cohesion and moments at contact.,
((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,traceEnergy,false,Attr::hidden,Define the total energy dissipated in plastic slips at all contacts.))
+ ((bool,traceEnergy,false,,Define the total energy