Re: [Yade-dev] : Add damping coefficient to material
Hi guys, thanks a lot for your suggestions. I just committed the code and I think it looks very good now. Klaus On Mon, 23 Jan 2012 11:08:59 PM Bruno Chareyre wrote: > Ok, I understand. > I like your diff more than the previous one. :) > Still one suggestion: this additional parameter in the damping functions > is useless: > > + > cundallDamp2nd(dt,m,state->angVel,angAccel,dampcoeff); > > In your code, dampCoeff will be either Newton::damping or zero. > So, it would be better to just write this, avoiding the function call > and additional parameter: > > if (state->isDamped) cundallDamp2nd(dt,m,state->angVel,angAccel) > > Then I agree to commit. > > Bruno > > On 23/01/12 11:48, Klaus Thoeni wrote: > > Hi Chiara, > > > > thanks for your comment. I am not after viscous damping either. But I > > think the current implementation does exactly what I want, it's the same > > as the PFC option b_damp(). So I can deactivate the damping coefficient > > for individual bodies. > > > > I can commit the code if anyone is interested , after the diff has been > > approved ;-) > > > > Klaus > > > > On Mon, 23 Jan 2012 08:44:02 PM Chiara wrote: > >> On 23/01/12 00:12, Klaus Thoeni wrote: > >>> Hi Bruno, hi Anton, > >>> > >>> I think density scaling is not what I am looking for since I am > >>> interested in real dynamic simulations. I need different damping > >>> parameters in NewtonIntegrator for the block and the mesh. I have to > >>> consider free flight under gravity so damping=0 (and I am interested in > >>> the real flight time). For the mesh I have to consider additional > >>> energy absorption which is not considered in my model via damping. > >> > >> If you are not after any density scaling, why damping in > >> NewtonIntegrator should be acceptable in a realistic dynamic situation? > >> Would not be easier/more meaningful for you to implement damping inside > >> your contact model? Sorry, just curious. > >> Chiara > >> > >>> It is similar to b_damp() in PFC which is used to remove damping for > >>> certain particle. I implemented it the same way now. The state has a > >>> member which is true by default which means that damping is used. It > >>> can be set to false and damping=0 will be used for this particle. So > >>> basically damping in NewtonIntegrator can be activated and deactivated > >>> for individual particles. > >>> > >>> @Anton: It has to be checked for all particles. > >>> > >>> Here is the diff of my latest implementation, tell me what you think: > >>> > >>> === modified file core/State.hpp > >>> --- core/State.hpp2011-02-14 08:05:09 + > >>> +++ core/State.hpp2012-01-22 23:56:31 + > >>> @@ -59,7 +59,8 @@ > >>> > >>> ((Vector3r,inertia,Vector3r::Zero(),,"Inertia of > >>> associated body, > > > > in > > > >>> local coordinate system.")) > >>> > >>> ((Vector3r,refPos,Vector3r::Zero(),,"Reference > >>> position")) > >>> ((Quaternionr,refOri,Quaternionr::Identity(),,"Reference > >>> orientation")) > >>> > >>> - ((unsigned,blockedDOFs,,,"[Will be overridden]")), > >>> + ((unsigned,blockedDOFs,,,"[Will be overridden]")) > >>> + ((bool,isDamped,true,,"Damping in :yref:`Newtonintegrator` can > >>> be > >>> deactivated for individual particles by setting this variable to FALSE. > >>> E.g. damping is inappropriate for particles in free flight under > >>> gravity but it might still be applicable to other particles in the > >>> same simulation.")), > >>> > >>> /* additional initializers */ > >>> > >>> ((pos,se3.position)) > >>> ((ori,se3.orientation)), > >>> > >>> === modified file pkg/dem/NewtonIntegrator.cpp > >>> --- pkg/dem/NewtonIntegrator.cpp 2011-11-30 17:39:33 + > >>> +++ pkg/dem/NewtonIntegrator.cpp 2012-01-22 23:56:31 + > >>> @@ -11,17 +11,18 @@ > >>> > >>> #include > >>> #include > >>> #include > >>> > >>> YADE_PLUGIN((NewtonIntegrator)); > >>> CREATE_LOGGER(NewtonIntegrator); > >>> > >>> // 1st order numerical damping > >>> > >>> -void NewtonIntegrator::cundallDamp1st(Vector3r& force, const > >>> Vector3r& vel){ - for(int i=0; i<3; i++) > >>> force[i]*=1-damping*Mathr::Sign(force[i]*vel[i]); +void > >>> NewtonIntegrator::cundallDamp1st(Vector3r& force, const Vector3r& > >>> vel, const Real& dampcoeff){ > >>> + for(int i=0; i<3; i++) > >>> force[i]*=1-dampcoeff*Mathr::Sign(force[i]*vel[i]); > >>> > >>> } > >>> // 2nd order numerical damping > >>> > >>> -void NewtonIntegrator::cundallDamp2nd(const Real& dt, const Vector3r& > >>> force, const Vector3r& vel, Vector3r& accel){ > >>> - for(int i=0; i<3; i++) accel[i]*= 1 - damping*Mathr::Sign ( > >>> force[i]*(vel[i] + 0.5*dt*accel[i]) ); > >>> +void NewtonIntegrator::cundallDamp2nd(const Real& dt, const Vector3r& > >>> force, const Vector3r& ve
[Yade-dev] [Branch ~yade-dev/yade/trunk] Rev 3002: - add capability to deactivate the damping in NewtonIntegrator for individual particle via O.bodi...
revno: 3002 committer: Klaus Thoeni branch nick: yade timestamp: Tue 2012-01-24 14:29:29 +1100 message: - add capability to deactivate the damping in NewtonIntegrator for individual particle via O.bodies[id].state.isDamped=False - use this new property in examples/WireMatPM/wirecontacttest.py modified: core/State.hpp examples/WireMatPM/wirecontacttest.py pkg/dem/NewtonIntegrator.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 'core/State.hpp' --- core/State.hpp 2011-02-14 08:05:09 + +++ core/State.hpp 2012-01-24 03:29:29 + @@ -59,7 +59,8 @@ ((Vector3r,inertia,Vector3r::Zero(),,"Inertia of associated body, in local coordinate system.")) ((Vector3r,refPos,Vector3r::Zero(),,"Reference position")) ((Quaternionr,refOri,Quaternionr::Identity(),,"Reference orientation")) - ((unsigned,blockedDOFs,,,"[Will be overridden]")), + ((unsigned,blockedDOFs,,,"[Will be overridden]")) + ((bool,isDamped,true,,"Damping in :yref:`Newtonintegrator` can be deactivated for individual particles by setting this variable to FALSE. E.g. damping is inappropriate for particles in free flight under gravity but it might still be applicable to other particles in the same simulation.")), /* additional initializers */ ((pos,se3.position)) ((ori,se3.orientation)), === modified file 'examples/WireMatPM/wirecontacttest.py' --- examples/WireMatPM/wirecontacttest.py 2011-10-06 03:29:16 + +++ examples/WireMatPM/wirecontacttest.py 2012-01-24 03:29:29 + @@ -117,6 +117,7 @@ import block as a sphere after net has been created bloc=O.bodies.append(sphere([1.0,1.0,0.65],radius=0.15,wire=False,highlight=False,color=[1,1,0],material=blocMat)) +O.bodies[bloc].state.isDamped=False # switch damping off since free fall under gravity plot some results === modified file 'pkg/dem/NewtonIntegrator.cpp' --- pkg/dem/NewtonIntegrator.cpp 2012-01-23 14:43:54 + +++ pkg/dem/NewtonIntegrator.cpp 2012-01-24 03:29:29 + @@ -39,7 +39,7 @@ void NewtonIntegrator::updateEnergy(const shared_ptr& b, const State* state, const Vector3r& fluctVel, const Vector3r& f, const Vector3r& m){ assert(b->isStandalone() || b->isClump()); // always positive dissipation, by-component: |F_i|*|v_i|*damping*dt (|T_i|*|ω_i|*damping*dt for rotations) - if(damping!=0.){ + if(damping!=0. && state->isDamped){ scene->energy->add(fluctVel.cwise().abs().dot(f.cwise().abs())*damping*scene->dt,"nonviscDamp",nonviscDampIx,/*non-incremental*/false); // when the aspherical integrator is used, torque is damped instead of ang acceleration; this code is only approximate scene->energy->add(state->angVel.cwise().abs().dot(m.cwise().abs())*damping*scene->dt,"nonviscDamp",nonviscDampIx,false); @@ -157,7 +157,7 @@ if (state->blockedDOFs!=State::DOF_ALL) { // linear acceleration Vector3r linAccel=computeAccel(f,state->mass,state->blockedDOFs); -cundallDamp2nd(dt,f,fluctVel,linAccel); +if(state->isDamped) cundallDamp2nd(dt,f,fluctVel,linAccel); //This is the convective term, appearing in the time derivation of Cundall/Thornton expression (dx/dt=velGrad*pos -> d²x/dt²=dvelGrad/dt*pos+velGrad*vel), negligible in many cases but not for high speed large deformations (gaz or turbulent flow). linAccel+=prevVelGrad*state->vel; //finally update velocity @@ -165,11 +165,11 @@ // angular acceleration if(!useAspherical){ // uses angular velocity Vector3r angAccel=computeAngAccel(m,state->inertia,state->blockedDOFs); - cundallDamp2nd(dt,m,state->angVel,angAccel); + if(state->isDamped) cundallDamp2nd(dt,m,state->angVel,angAccel); state->angVel+=dt*angAccel; } else { // uses torque for(int i=0; i<3; i++) if(state->blockedDOFs & State::axisDOF(i,true)) m[i]=0; // block DOFs here - cundallDamp1st(m,state->angVel); + if(state->isDamped) cundallDamp1st(m,state->angVel); } } ___ 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] Fwd: [Branch ~yade-dev/yade/trunk] Rev 2999: Update some publication references
Ok, thank you Bruno and Franck. It works. I believed that the committer was identified from his launchpad login. Cheers, Luc Le 23/01/2012 09:43, Franck Lominé a écrit : Hi, Luc, sorry for this. You can edit ~/.bazaar/bazaar.conf directly or try the command given by Bruno. You have to do this on pc-cal1, pc-cal2 and pc-cal3. Cheers Franck ___ 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 -- Luc Sibille Université de Nantes - Laboratoire GeM UMR CNRS IUT de Saint Nazaire 58, rue Michel-Ange - BP 420 44606 Saint-Nazaire Cedex, France Tel: +33 (0)2 40 17 81 78 ___ 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
[Yade-dev] [Branch ~yade-dev/yade/trunk] Rev 3001: - missing reference update
revno: 3001 committer: Bruno Chareyre branch nick: yade timestamp: Mon 2012-01-23 15:44:45 +0100 message: - missing reference update - remove the velocityBins lines in tests since velocityBins are removed from trunk modified: doc/references.bib scripts/test/collider-stride-triax.py -- 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 'doc/references.bib' --- doc/references.bib 2011-09-08 07:39:58 + +++ doc/references.bib 2012-01-23 14:44:45 + @@ -103,7 +103,7 @@ @InProceedings{ Alonso2004, title = "Micro-mechanical investigation of the granular ratcheting", - author = "F. Alonso-Marroqu{\'i}n and R. Garc{\'i}a-Rojo and H. J. Herrmann", + author = "F. Alonso-Marroquin and R. Garcia-Rojo and H.J. Herrmann", booktitle = "Cyclic Behaviour of Soils and Liquefaction Phenomena", publisher = "Taylor \& Francis", year = "2004", @@ -302,13 +302,13 @@ } @InProceedings{ Addetta2001, - author = "G.~A. {D'Addetta} and F. {Kun} and E. {Ramm} and H.~J. {Herrmann}", + author = "G.A. {D'Addetta} and F. {Kun} and E. {Ramm} and H.J. {Herrmann}", title = "{From solids to granulates - Discrete element simulations of fracture and fragmentation processes in geomaterials.}", booktitle = "Continuous and Discontinuous Modelling of Cohesive-Frictional Materials", year = 2001, series = "Lecture Notes in Physics, Berlin Springer Verlag", volume = 568, - editor = "{P.~A.~Vermeer, S.~Diebels, W.~Ehlers, H.~J.~Herrmann, S.~Luding, \& E.~Ramm}", + editor = "{P.A. Vermeer, S. Diebels, W. Ehlers, H.J. Herrmann, S. Luding, E. Ramm}", pages = "231--+", url = "http://www.comphys.ethz.ch/hans/p/267.pdf"; } @@ -490,3 +490,24 @@ number = {B}, year = {2004} } + +@InProceedings{Kettner2011, + AUTHOR = {Lutz Kettner and Andreas Meyer and Afra Zomorodian}, + BOOKTITLE= {{CGAL} User and Reference Manual}, + PUBLISHER= {{CGAL Editorial Board}}, + TITLE= {Intersecting Sequences of {dD} Iso-oriented Boxes}, + YEAR = {2011}, + EDITION = {{3.9}}, + url = {http://www.cgal.org/Manual/3.9/doc_html/cgal_manual/packages.html#Pkg:BoxIntersectionD} +} + +@InProceedings{Pion2011, + AUTHOR = {Sylvain Pion and Monique Teillaud}, + BOOKTITLE= {{CGAL} User and Reference Manual}, + PUBLISHER= {{CGAL Editorial Board}}, + TITLE= {{3D} Triangulations}, + YEAR = {2011}, + EDITION = {{3.9}}, + url = {http://www.cgal.org/Manual/3.9/doc_html/cgal_manual/packages.html#Pkg:Triangulation3} +} + === modified file 'scripts/test/collider-stride-triax.py' --- scripts/test/collider-stride-triax.py 2010-05-30 13:41:00 + +++ scripts/test/collider-stride-triax.py 2012-01-23 14:44:45 + @@ -16,11 +16,6 @@ if 1: # length by which bboxes will be made larger collider.sweepLength=.2*O.bodies[100].shape.radius - # if this is enabled, bboxes will be enlarged based on velocity bin for each body - if 1: - collider.nBins=3 - collider.binCoeff=10 - log.setLevel('VelocityBins',log.DEBUG) O.step() # filter out initialization O.timingEnabled=True ___ 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
[Yade-dev] [Branch ~yade-dev/yade/trunk] Rev 3000: Merge the "collide" branch to trunk (branch history at https://code.launchpad.net/~bruno-chareyre...
revno: 3000 committer: Bruno Chareyre branch nick: yade timestamp: Mon 2012-01-23 15:43:54 +0100 message: Merge the "collide" branch to trunk (branch history at https://code.launchpad.net/~bruno-chareyre/yade/collide2) Summary: - the stride logic is improved by using displacements instead of velocities. Reference position and sweepLength are added to bounds. - the sweepLength of each body is updated in collider::action() according to collider's targetInterv, so that ideally all bodies leave their bounds at the same iteration (more or less the same idea as in the old velocityBin but with per-body logic) - a number of optimizations in the collider and interaction dispatcher. Namely, the handling of virtual interactions is a lot faster, allowing a larger number of them for the optimal verletDist. - timings reported at https://yade-dem.org/wiki/Colliders_performace (please add your reports there), roughly x3 speedup vs. bzr2999 in triaxial simulations - A new ZECollider is introduced, using CGAL's dD intersection algorithm. It is relatively slow and therefore not recommended, but the code is very short and it may be worth a try when parallel CGAL is released. - Added references to some CGAL packages and a few fixes in references. removed: pkg/common/VelocityBins.cpp pkg/common/VelocityBins.hpp added: pkg/common/ZECollider.cpp pkg/common/ZECollider.hpp modified: core/Bound.hpp core/InteractionContainer.cpp core/InteractionContainer.hpp pkg/common/Collider.hpp pkg/common/Cylinder.cpp pkg/common/Dispatching.cpp pkg/common/Dispatching.hpp pkg/common/InsertionSortCollider.cpp pkg/common/InsertionSortCollider.hpp pkg/common/InteractionLoop.cpp pkg/common/InteractionLoop.hpp pkg/dem/CohesionlessMomentRotation.cpp pkg/dem/CohesiveFrictionalContactLaw.cpp pkg/dem/CohesiveFrictionalPM.cpp pkg/dem/ConcretePM.cpp pkg/dem/CundallStrack.cpp pkg/dem/ElasticContactLaw.cpp pkg/dem/HertzMindlin.cpp pkg/dem/L3Geom.cpp pkg/dem/Law2_ScGeom_CapillaryPhys_Capillarity.cpp pkg/dem/NewtonIntegrator.cpp pkg/dem/NewtonIntegrator.hpp pkg/dem/NormalInelasticityLaw.cpp pkg/dem/RockPM.cpp pkg/dem/TesselationWrapper.cpp pkg/dem/TriaxialTest.cpp pkg/dem/ViscoelasticPM.cpp pkg/dem/WirePM.cpp The size of the diff (1608 lines) is larger than your specified limit of 1000 lines -- 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 ___ 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] : Add damping coefficient to material
On Mon, Jan 23, 2012 at 10:44 AM, Chiara wrote: ... > > If you are not after any density scaling, why damping in NewtonIntegrator > should be acceptable in a realistic dynamic situation? Would not be > easier/more meaningful for you to implement damping inside your contact > model? > ... The bodies, which are not interact at the moment, will be skipped in this case, I think. Agree with Bruno, This diff looks better. Anton. ___ 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] : Add damping coefficient to material
Ok, I understand. I like your diff more than the previous one. :) Still one suggestion: this additional parameter in the damping functions is useless: + cundallDamp2nd(dt,m,state->angVel,angAccel,dampcoeff); In your code, dampCoeff will be either Newton::damping or zero. So, it would be better to just write this, avoiding the function call and additional parameter: if (state->isDamped) cundallDamp2nd(dt,m,state->angVel,angAccel) Then I agree to commit. Bruno On 23/01/12 11:48, Klaus Thoeni wrote: > Hi Chiara, > > thanks for your comment. I am not after viscous damping either. But I think > the current implementation does exactly what I want, it's the same as the PFC > option b_damp(). So I can deactivate the damping coefficient for individual > bodies. > > I can commit the code if anyone is interested , after the diff has been > approved ;-) > > Klaus > > On Mon, 23 Jan 2012 08:44:02 PM Chiara wrote: >> On 23/01/12 00:12, Klaus Thoeni wrote: >>> Hi Bruno, hi Anton, >>> >>> I think density scaling is not what I am looking for since I am >>> interested in real dynamic simulations. I need different damping >>> parameters in NewtonIntegrator for the block and the mesh. I have to >>> consider free flight under gravity so damping=0 (and I am interested in >>> the real flight time). For the mesh I have to consider additional energy >>> absorption which is not considered in my model via damping. >> If you are not after any density scaling, why damping in >> NewtonIntegrator should be acceptable in a realistic dynamic situation? >> Would not be easier/more meaningful for you to implement damping inside >> your contact model? Sorry, just curious. >> Chiara >> >>> It is similar to b_damp() in PFC which is used to remove damping for >>> certain particle. I implemented it the same way now. The state has a >>> member which is true by default which means that damping is used. It can >>> be set to false and damping=0 will be used for this particle. So >>> basically damping in NewtonIntegrator can be activated and deactivated >>> for individual particles. >>> >>> @Anton: It has to be checked for all particles. >>> >>> Here is the diff of my latest implementation, tell me what you think: >>> >>> === modified file core/State.hpp >>> --- core/State.hpp 2011-02-14 08:05:09 + >>> +++ core/State.hpp 2012-01-22 23:56:31 + >>> @@ -59,7 +59,8 @@ >>> >>> ((Vector3r,inertia,Vector3r::Zero(),,"Inertia of associated >>> body, > in >>> local coordinate system.")) >>> >>> ((Vector3r,refPos,Vector3r::Zero(),,"Reference position")) >>> ((Quaternionr,refOri,Quaternionr::Identity(),,"Reference >>> orientation")) >>> >>> - ((unsigned,blockedDOFs,,,"[Will be overridden]")), >>> + ((unsigned,blockedDOFs,,,"[Will be overridden]")) >>> + ((bool,isDamped,true,,"Damping in :yref:`Newtonintegrator` can >>> be >>> deactivated for individual particles by setting this variable to FALSE. >>> E.g. damping is inappropriate for particles in free flight under gravity >>> but it might still be applicable to other particles in the same >>> simulation.")), >>> >>> /* additional initializers */ >>> >>> ((pos,se3.position)) >>> ((ori,se3.orientation)), >>> >>> === modified file pkg/dem/NewtonIntegrator.cpp >>> --- pkg/dem/NewtonIntegrator.cpp2011-11-30 17:39:33 + >>> +++ pkg/dem/NewtonIntegrator.cpp2012-01-22 23:56:31 + >>> @@ -11,17 +11,18 @@ >>> >>> #include >>> #include >>> #include >>> >>> YADE_PLUGIN((NewtonIntegrator)); >>> CREATE_LOGGER(NewtonIntegrator); >>> >>> // 1st order numerical damping >>> >>> -void NewtonIntegrator::cundallDamp1st(Vector3r& force, const Vector3r& >>> vel){ - for(int i=0; i<3; i++) >>> force[i]*=1-damping*Mathr::Sign(force[i]*vel[i]); +void >>> NewtonIntegrator::cundallDamp1st(Vector3r& force, const Vector3r& vel, >>> const Real& dampcoeff){ >>> + for(int i=0; i<3; i++) >>> force[i]*=1-dampcoeff*Mathr::Sign(force[i]*vel[i]); >>> >>> } >>> // 2nd order numerical damping >>> >>> -void NewtonIntegrator::cundallDamp2nd(const Real& dt, const Vector3r& >>> force, const Vector3r& vel, Vector3r& accel){ >>> - for(int i=0; i<3; i++) accel[i]*= 1 - damping*Mathr::Sign ( >>> force[i]*(vel[i] + 0.5*dt*accel[i]) ); >>> +void NewtonIntegrator::cundallDamp2nd(const Real& dt, const Vector3r& >>> force, const Vector3r& vel, Vector3r& accel, const Real& dampcoeff){ >>> + for(int i=0; i<3; i++) accel[i]*= 1 - dampcoeff*Mathr::Sign ( >>> force[i]*(vel[i] + 0.5*dt*accel[i]) ); >>> >>> } >>> >>> Vector3r NewtonIntegrator::computeAccel(const Vector3r& force, const >>> Real& >>> >>> mass, int blockedDOFs){ >>> @@ -39,11 +40,13 @@ >>> >>> void NewtonIntegrator::updateEnergy(const shared_ptr& b, const >>> State* >>> >>> state, const Vector3r& fluctVel, const Vector3r& f, con
Re: [Yade-dev] : Add damping coefficient to material
Hi Chiara, thanks for your comment. I am not after viscous damping either. But I think the current implementation does exactly what I want, it's the same as the PFC option b_damp(). So I can deactivate the damping coefficient for individual bodies. I can commit the code if anyone is interested , after the diff has been approved ;-) Klaus On Mon, 23 Jan 2012 08:44:02 PM Chiara wrote: > On 23/01/12 00:12, Klaus Thoeni wrote: > > Hi Bruno, hi Anton, > > > > I think density scaling is not what I am looking for since I am > > interested in real dynamic simulations. I need different damping > > parameters in NewtonIntegrator for the block and the mesh. I have to > > consider free flight under gravity so damping=0 (and I am interested in > > the real flight time). For the mesh I have to consider additional energy > > absorption which is not considered in my model via damping. > > If you are not after any density scaling, why damping in > NewtonIntegrator should be acceptable in a realistic dynamic situation? > Would not be easier/more meaningful for you to implement damping inside > your contact model? Sorry, just curious. > Chiara > > > It is similar to b_damp() in PFC which is used to remove damping for > > certain particle. I implemented it the same way now. The state has a > > member which is true by default which means that damping is used. It can > > be set to false and damping=0 will be used for this particle. So > > basically damping in NewtonIntegrator can be activated and deactivated > > for individual particles. > > > > @Anton: It has to be checked for all particles. > > > > Here is the diff of my latest implementation, tell me what you think: > > > > === modified file core/State.hpp > > --- core/State.hpp 2011-02-14 08:05:09 + > > +++ core/State.hpp 2012-01-22 23:56:31 + > > @@ -59,7 +59,8 @@ > > > > ((Vector3r,inertia,Vector3r::Zero(),,"Inertia of associated > > body, in > > > > local coordinate system.")) > > > > ((Vector3r,refPos,Vector3r::Zero(),,"Reference position")) > > ((Quaternionr,refOri,Quaternionr::Identity(),,"Reference > > orientation")) > > > > - ((unsigned,blockedDOFs,,,"[Will be overridden]")), > > + ((unsigned,blockedDOFs,,,"[Will be overridden]")) > > + ((bool,isDamped,true,,"Damping in :yref:`Newtonintegrator` can > > be > > deactivated for individual particles by setting this variable to FALSE. > > E.g. damping is inappropriate for particles in free flight under gravity > > but it might still be applicable to other particles in the same > > simulation.")), > > > > /* additional initializers */ > > > > ((pos,se3.position)) > > ((ori,se3.orientation)), > > > > === modified file pkg/dem/NewtonIntegrator.cpp > > --- pkg/dem/NewtonIntegrator.cpp2011-11-30 17:39:33 + > > +++ pkg/dem/NewtonIntegrator.cpp2012-01-22 23:56:31 + > > @@ -11,17 +11,18 @@ > > > > #include > > #include > > #include > > > > YADE_PLUGIN((NewtonIntegrator)); > > CREATE_LOGGER(NewtonIntegrator); > > > > // 1st order numerical damping > > > > -void NewtonIntegrator::cundallDamp1st(Vector3r& force, const Vector3r& > > vel){ - for(int i=0; i<3; i++) > > force[i]*=1-damping*Mathr::Sign(force[i]*vel[i]); +void > > NewtonIntegrator::cundallDamp1st(Vector3r& force, const Vector3r& vel, > > const Real& dampcoeff){ > > + for(int i=0; i<3; i++) > > force[i]*=1-dampcoeff*Mathr::Sign(force[i]*vel[i]); > > > > } > > // 2nd order numerical damping > > > > -void NewtonIntegrator::cundallDamp2nd(const Real& dt, const Vector3r& > > force, const Vector3r& vel, Vector3r& accel){ > > - for(int i=0; i<3; i++) accel[i]*= 1 - damping*Mathr::Sign ( > > force[i]*(vel[i] + 0.5*dt*accel[i]) ); > > +void NewtonIntegrator::cundallDamp2nd(const Real& dt, const Vector3r& > > force, const Vector3r& vel, Vector3r& accel, const Real& dampcoeff){ > > + for(int i=0; i<3; i++) accel[i]*= 1 - dampcoeff*Mathr::Sign ( > > force[i]*(vel[i] + 0.5*dt*accel[i]) ); > > > > } > > > > Vector3r NewtonIntegrator::computeAccel(const Vector3r& force, const > > Real& > > > > mass, int blockedDOFs){ > > @@ -39,11 +40,13 @@ > > > > void NewtonIntegrator::updateEnergy(const shared_ptr& b, const > > State* > > > > state, const Vector3r& fluctVel, const Vector3r& f, const Vector3r& > > m){ > > > > assert(b->isStandalone() || b->isClump()); > > > > - // always positive dissipation, by-component: |F_i|*|v_i|*damping*dt (| > > T_i|*|ω_i|*damping*dt for rotations) > > - if(damping!=0.){ > > - scene->energy- > > > >> add(fluctVel.cwise().abs().dot(f.cwise().abs())*damping*scene- > >> dt,"nonviscDamp",nonviscDampIx,/*non-incremental*/false); > > > > + // check if damping for this body is activated > > + Real dampcoeff=(state->isDamped ? damping : 0); > > + // always positive dissipation, by
Re: [Yade-dev] : Add damping coefficient to material
On 23/01/12 00:12, Klaus Thoeni wrote: Hi Bruno, hi Anton, I think density scaling is not what I am looking for since I am interested in real dynamic simulations. I need different damping parameters in NewtonIntegrator for the block and the mesh. I have to consider free flight under gravity so damping=0 (and I am interested in the real flight time). For the mesh I have to consider additional energy absorption which is not considered in my model via damping. If you are not after any density scaling, why damping in NewtonIntegrator should be acceptable in a realistic dynamic situation? Would not be easier/more meaningful for you to implement damping inside your contact model? Sorry, just curious. Chiara It is similar to b_damp() in PFC which is used to remove damping for certain particle. I implemented it the same way now. The state has a member which is true by default which means that damping is used. It can be set to false and damping=0 will be used for this particle. So basically damping in NewtonIntegrator can be activated and deactivated for individual particles. @Anton: It has to be checked for all particles. Here is the diff of my latest implementation, tell me what you think: === modified file core/State.hpp --- core/State.hpp 2011-02-14 08:05:09 + +++ core/State.hpp 2012-01-22 23:56:31 + @@ -59,7 +59,8 @@ ((Vector3r,inertia,Vector3r::Zero(),,"Inertia of associated body, in local coordinate system.")) ((Vector3r,refPos,Vector3r::Zero(),,"Reference position")) ((Quaternionr,refOri,Quaternionr::Identity(),,"Reference orientation")) - ((unsigned,blockedDOFs,,,"[Will be overridden]")), + ((unsigned,blockedDOFs,,,"[Will be overridden]")) + ((bool,isDamped,true,,"Damping in :yref:`Newtonintegrator` can be deactivated for individual particles by setting this variable to FALSE. E.g. damping is inappropriate for particles in free flight under gravity but it might still be applicable to other particles in the same simulation.")), /* additional initializers */ ((pos,se3.position)) ((ori,se3.orientation)), === modified file pkg/dem/NewtonIntegrator.cpp --- pkg/dem/NewtonIntegrator.cpp2011-11-30 17:39:33 + +++ pkg/dem/NewtonIntegrator.cpp2012-01-22 23:56:31 + @@ -11,17 +11,18 @@ #include #include #include YADE_PLUGIN((NewtonIntegrator)); CREATE_LOGGER(NewtonIntegrator); // 1st order numerical damping -void NewtonIntegrator::cundallDamp1st(Vector3r& force, const Vector3r& vel){ - for(int i=0; i<3; i++) force[i]*=1-damping*Mathr::Sign(force[i]*vel[i]); +void NewtonIntegrator::cundallDamp1st(Vector3r& force, const Vector3r& vel, const Real& dampcoeff){ + for(int i=0; i<3; i++) force[i]*=1-dampcoeff*Mathr::Sign(force[i]*vel[i]); } // 2nd order numerical damping -void NewtonIntegrator::cundallDamp2nd(const Real& dt, const Vector3r& force, const Vector3r& vel, Vector3r& accel){ - for(int i=0; i<3; i++) accel[i]*= 1 - damping*Mathr::Sign ( force[i]*(vel[i] + 0.5*dt*accel[i]) ); +void NewtonIntegrator::cundallDamp2nd(const Real& dt, const Vector3r& force, const Vector3r& vel, Vector3r& accel, const Real& dampcoeff){ + for(int i=0; i<3; i++) accel[i]*= 1 - dampcoeff*Mathr::Sign ( force[i]*(vel[i] + 0.5*dt*accel[i]) ); } Vector3r NewtonIntegrator::computeAccel(const Vector3r& force, const Real& mass, int blockedDOFs){ @@ -39,11 +40,13 @@ void NewtonIntegrator::updateEnergy(const shared_ptr& b, const State* state, const Vector3r& fluctVel, const Vector3r& f, const Vector3r& m){ assert(b->isStandalone() || b->isClump()); - // always positive dissipation, by-component: |F_i|*|v_i|*damping*dt (| T_i|*|ω_i|*damping*dt for rotations) - if(damping!=0.){ - scene->energy- add(fluctVel.cwise().abs().dot(f.cwise().abs())*damping*scene- dt,"nonviscDamp",nonviscDampIx,/*non-incremental*/false); + // check if damping for this body is activated + Real dampcoeff=(state->isDamped ? damping : 0); + // always positive dissipation, by-component: |F_i|*|v_i|*dampcoeff*dt (| T_i|*|ω_i|*dampcoeff*dt for rotations) + if(dampcoeff!=0.){ + scene->energy- add(fluctVel.cwise().abs().dot(f.cwise().abs())*dampcoeff*scene- dt,"nonviscDamp",nonviscDampIx,/*non-incremental*/false); // when the aspherical integrator is used, torque is damped instead of ang acceleration; this code is only approximate - scene->energy->add(state- angVel.cwise().abs().dot(m.cwise().abs())*damping*scene- dt,"nonviscDamp",nonviscDampIx,false); + scene->energy->add(state- angVel.cwise().abs().dot(m.cwise().abs())*dampcoeff*scene- dt,"nonviscDamp",nonviscDampIx,false); } // kinetic energy Real Etrans=.5*state->mass*fluctVel.squaredNorm(); @@ -106,9 +109,13
Re: [Yade-dev] Fwd: [Branch ~yade-dev/yade/trunk] Rev 2999: Update some publication references
Hi, Luc, sorry for this. You can edit ~/.bazaar/bazaar.conf directly or try the command given by Bruno. You have to do this on pc-cal1, pc-cal2 and pc-cal3. Cheers Franck ___ 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