Hi Jerome,
On 10 February 2010 15:21, Jerome Duriez <[email protected]>wrote: > chiara modenese a écrit : > > // Apply gravity gradually >> Vector3r gmax=Vector3r(0,-9810,0); >> Vector3r deltag=Vector3r(0,0,0); >> deltag=gmax/100; // apply the gravity in 100 steps >> if (fabs(g[1])<fabs(gmax[1])) >> { >> g=g+deltag; >> } else { Omega::instance().stopSimulationLoop(); >> } >> >> Where are these lines ? In TriaxialCompressionEngine.cpp ? > YES > And those : > > >> gravityCondition->gravity = triaxialcompressionEngine->g; // set gravity >> to the value in triaxialcompressionEngine >> rootBody->engines.push_back(gravityCondition); >> >> In TriaxialTest.cpp (function generate) ? > YES > > If yes it's normal that it does not work at all... Because here you define > (see what's going on with "generate" of the TriaxialTest) a simulation > taking into account gravity, but with a value of g equals to (vector) > zero... > > What you wrote in TriaxialCompressionEngine (=first lines I quoted) can not > modify the value of gravity applied by the GravityEngine (it even does not > access to this Engine), which remains thus equal to 0... > > Oh sorry, you are entirely right! I was just confused by the idea that engines are called at each iteration... So, can I access the gravity engine directly in the TraixialCompressionEngine.cpp so I modify the value of the gravity only once I need to? cheers, Chiara > Jerome >
_______________________________________________ Mailing list: https://launchpad.net/~yade-users Post to : [email protected] Unsubscribe : https://launchpad.net/~yade-users More help : https://help.launchpad.net/ListHelp

