[Yade-dev] [Branch ~yade-dev/yade/trunk] Rev 2589: - PeriTriax : remove the constant-distance approximation in stress definition, using wrapped coor...

2010-12-06 Thread noreply

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 

Re: [Yade-dev] [Branch ~yade-dev/yade/trunk] Rev 2589: - PeriTriax : remove the constant-distance approximation in stress definition, using wrapped coor...

2010-12-06 Thread Václav Šmilauer



   - Get back standalone energy tracing in ECL.

Out of interest: what was the reason for that?


___
Mailing list: https://launchpad.net/~yade-dev
Post to : yade-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-dev
More help   : https://help.launchpad.net/ListHelp


Re: [Yade-dev] [Branch ~yade-dev/yade/trunk] Rev 2589: - PeriTriax : remove the constant-distance approximation in stress definition, using wrapped coor...

2010-12-06 Thread Chiara Modenese
 The less rational reason is I knew my scripts conserve energy, while
 everything else I see
 on yade lists seem to eat energy somehow. I was a bit afraid to change my
 usual
 practice...

Bruno, what is this usual practice? Sorry but I am interested in since I
spent so much time on it and could not find a way to conserve energy.
Cheers, Chia



 ___
 Mailing list: 
 https://launchpad.net/~yade-devhttps://launchpad.net/%7Eyade-dev
 Post to : yade-dev@lists.launchpad.net
 Unsubscribe : 
 https://launchpad.net/~yade-devhttps://launchpad.net/%7Eyade-dev
 More help   : https://help.launchpad.net/ListHelp

___
Mailing list: https://launchpad.net/~yade-dev
Post to : yade-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-dev
More help   : https://help.launchpad.net/ListHelp


Re: [Yade-dev] [Branch ~yade-dev/yade/trunk] Rev 2589: - PeriTriax : remove the constant-distance approximation in stress definition, using wrapped coor...

2010-12-06 Thread Bruno Chareyre
It is probably easy to create a proxy function, but I don't know how honestly 
+ checking
that equations are the same, yes I could have... But when the initial objective 
is to fix
one line in PeriTriax, it means work time is multiplied by 10 at least.
As for cpu time being no big deal... it is for me, since I compute energy by 
default in
all triaxial simulations.

 It works in parallel (of course). The string comparison is there only
 the first time, then it is stored in the index variable 

Nice.

 I would think that you just don't know that the energy is
 not conserved, because you don't look at all the contributions, that's
 perhaps how your scripts conserve energy? I mean, come on, the plastic
 dissipation it clearly not computed correctly, you don't agree?

Mmmmh... No.
I sent a mail today reporting energy conservation with an error 2e-4 after 60k 
iterations.
There is no contribution ignored (well, ok, I ignore Cundall damping. Does it 
matter when
damping=0?), and plastic dissipation is about 80% of the total input from 
boundaries, not
under the carpet.
I reported a similar result about one year ago, with an error about 0.5% (due 
to the
approximation in PeriTriax stress). Did you consider this result?
This is in quasistatic conditions. A soft test maybe, but still, it would be 
nice to see
all laws in yade validated at least in this specific situation. Only 
ScGeom_CundallStrack
passed this test IIRC. The other laws/configurations we tested actually failed 
before
comparing energy (https://bugs.launchpad.net/yade/+bug/399963,
https://bugs.launchpad.net/yade/+bug/675955, 
https://bugs.launchpad.net/yade/+bug/585771).

Bruno



___
Mailing list: https://launchpad.net/~yade-dev
Post to : yade-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-dev
More help   : https://help.launchpad.net/ListHelp


Re: [Yade-dev] [Branch ~yade-dev/yade/trunk] Rev 2589: - PeriTriax : remove the constant-distance approximation in stress definition, using wrapped coor...

2010-12-06 Thread Bruno Chareyre

 
 The less rational reason is I knew my scripts conserve energy, while
 everything else I see
 on yade lists seem to eat energy somehow. I was a bit afraid to
 change my usual
 practice...
 
 Bruno, what is this usual practice? Sorry but I am interested in since I
 spent so much time on it and could not find a way to conserve energy.
 Cheers, Chia

I'm afraid HM and/or dynamics creates specific problems, unfortunately. For 
simple
Cundall-Strack, peri-triax-velgrad gives good default values.

Bruno


___
Mailing list: https://launchpad.net/~yade-dev
Post to : yade-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-dev
More help   : https://help.launchpad.net/ListHelp