← Back to team overview

yade-users team mailing list archive

Re: [Question #268448]: the output of resultant forces and moments of all bodies

 

do you mean something like this, using ForceContainer [1]?

for b in O.bodies:
  f = O.forces.f(b.id)
  t = O.forces.t(b.id)
  doWhatewerWith_f_and_t()

As I understand the documentation (did not use ForceRecorder myself),
totalForce is really the total force, i.e. sum of all forces acting on
engine's ids). So, as I understand your question, I would prefer to use
ForceContainer

cheers
Jan

[1] https://yade-dem.org/doc/yade.wrapper.html#forcecontainer



2015-06-24 11:46 GMT+02:00 Fu zuoguang <question268448@xxxxxxxxxxxxxxxxxxxxx
>:

> Question #268448 on Yade changed:
> https://answers.launchpad.net/yade/+question/268448
>
>     Status: Answered => Open
>
> Fu zuoguang is still having a problem:
> Dear Jan Stránský and all users,
>
> I am sorry for giving you an ambiguous description of my purpose.
>
> ###################################
>
> for b in O.bodies:
>     O.engines.Recorder.ForceRecorder[body_id = b].totalForce
>     O.engines.Recorder.TorqueRecorder[body_id = b].totalTorque
>
> ###################################
>
> The codes that I provided yesterday are not the true python codes but
> the pseudo codes that just helps me express logically my desirability.
> Of course, These sentences should not be validated by python.(exsit errors)
> But they are not very clear for understanding. I improved them as that
>
> ###################################
> for b in len(O.bodies):
>     Engine.GlobalEngine.PeriodicEngine.Recorder.ForceRecorder[body_id =
> b].totalForce
>     Engine.GlobalEngine.PeriodicEngine.Recorder.ForceRecorder[body_id =
> b].totalTorque
> ###################################
>
> These codes mean that
>
> (1) b now presents the id of each body(wall and sphere);
>
> (2) the inheritance relationship from totalForce or totalTorque to Engine
> is expressed
> as classes-like format;
>
> (3) all the bodies results should be output while in each loop, only one
> body
> is treated by inputting its id.
>
> The ture python codes are that
>
> ####################################
>
> O.engines = [
>     ForceResetter (),
>     InsertionSortCollider (),
>     InteractionLoop (),
>     consolidation,    # my own loading mode
>     NewtonIntegrator (),
>     ForceRecorder (
>         file = 'force-recorder.csv',
>         ids = [id_list],    # sphere ids
>         iterPeriod = 50 )]
>
> #####################################
>
> Now these codes can be validated successfully in Yade but
> only for outputting the resultant force composed by all
> members in [id_list].
>
> Are there some methods for outputting the resultant force of
> each one member in that list in each loop just like the pseudo codes
> describtion?  Seeking your help!
>
> Best regards
> Zuoguang Fu
>
> --
> You received this question notification because you are a member of
> yade-users, which is an answer contact for Yade.
>
> _______________________________________________
> Mailing list: https://launchpad.net/~yade-users
> Post to     : yade-users@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~yade-users
> More help   : https://help.launchpad.net/ListHelp
>

Follow ups

References