← Back to team overview

yade-users team mailing list archive

[Question #244203]: How to read data from external file

 

New question #244203 on Yade:
https://answers.launchpad.net/yade/+question/244203

Hi mates!

I've made a function which calculates the applyinf force to different particles in function of some variables (shape, mass...). However, appliying this function each time step results in a huge computational cost (time) that i can´t afford. So I've decided to call this function each 100000 time steps and save the resulting forces with their corresponding Ids to be constant applied during the 99999 other iterations.

So, which is the best way to deal with the problem??? I was thinking about saving the particle Ids and their corresponding forces in a external file and call it each one of the 99999 remaining iterations. That is made with a defined function that reads the data and assigns the corresponding force to the corresponding particle Id.

But maybe it would be better to use the addData function... Anyways, I don't know the best way to read (not  to save) an external file (I'm a python newbie :S).

I would be very grateful for any kind of help.



-- 
You received this question notification because you are a member of
yade-users, which is an answer contact for Yade.