← Back to team overview

yade-users team mailing list archive

Re: [Question #404328]: contact position at the end of the simulation

 

Question #404328 on Yade changed:
https://answers.launchpad.net/yade/+question/404328

Jan Stránský proposed the following answer:
Hi Jabrane,​


I don't understand why the condition prohibit the exportation


well, simply because the condition is not fulfilled :-) you can put
print O.iter, iterMax
before the condition to see that O.iter is 1

Pyhon reads the script line by line and executes what is read. So it comes
to your condition and at that moment (after O.step) O.iter is 1. So it does
nothing and continues and never comes back to this part of code..

If you put the loop at the end of your script, it could work as you want.
BUT
- use O.run(iterMax,True) # the True value is very important, otherwise you
will get no improvement
- delete or modify the condition (at that time, O.iter is iterMax+1,
because of the first O.step)

or you can put the whole loop together with the condition inside a function
and call it by PyRunner..


when i remove the condition of the end of the simulation, the loop below
> work well


it works well, but exports data from O.iter==1, see above

cheers
Jan

-- 
You received this question notification because your team yade-users is
an answer contact for Yade.