Hello Everyone,


I have a problem related to saving the results I get with fipy. It's in some way related to my previous post entitled "Using functions from the math or numpy modules".

I'm working on a transient problem and I need to store the values of my variables at each time step. I decided to use a dictionary for that purpose because it's easy to pickle for latter use. For example, if I had a variable "T":

d = {'T': []}

Then, at each time step, I would append the value of the variable to the list:

d['T'].append(T.getValue())

The problem is that each entry of the list is evaluated (lazy evaluation) when it's called and a the end, I get a list with a series of identical entries.

So, my question is: What would be the best way of bypassing the lazy evaluation and just save the numerical values? I tried

T.getNumericalValue()

but that didn't work.

I'm now considering

d['T'].append(copy(T.getValue()))

Would that be a good solution or is there something better?


Many thanks!

Etienne


Reply via email to