← Back to team overview

yade-users team mailing list archive

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

 

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

    Status: Open => Answered

Jan Stránský proposed the following answer:
Hello,

I must say that your problem is not very clear to me. Could you please be
more specific or perhaps post a short script describing your problem more
in detail?
Anyway, if computational costs is an issue for you, do not do file
manipulations each time step.
cheers
Jan



2014-02-18 17:51 GMT+01:00 rayolau <question244203@xxxxxxxxxxxxxxxxxxxxx>:

> 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.
>
> _______________________________________________
> 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
>

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