← Back to team overview

yade-users team mailing list archive

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

 

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.


Follow ups

References