How to read data from external file
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.
Question information
- Language:
- English Edit question
- Status:
- Answered
- For:
- Yade Edit question
- Assignee:
- No assignee Edit question
- Last query:
- Last reply:
Can you help with this problem?
Provide an answer of your own, or ask rayolau for more information if necessary.