Dear Fipy developers and users,
Thanks again for solving my last problem. This is the most powerful forum I
have ever been involved.

I do not know if this is an known issue, but I found it very slow to assign
fipy variables as elements of the numerix array. Please see below.

from fipy import *
import fipy.tools.numerix as numerix
mesh=Grid3D(nx=10,ny=10,nz=10)
Dx=CellVariable(mesh=mesh,value=1.)
Dy=CellVariable(mesh=mesh,value=2.)
Dz=CellVariable(mesh=mesh,value=3.)
zeros=CellVariable(mesh=mesh,value=0.)
Ds=numerix.array(((Dx,zeros,zeros),(zeros,Dy,zeros),(zeros,zeros,Dz)))

The last line of the above code took 3.5 second while the rest of the code
only took 0.002 second, using my laptop.

I wonder if it can be improved. Or maybe the way I did it is too clumsy? I
define the "Ds" in the code in order to use it as the anisotropic
coefficient in the DiffusionTerm.

Thank you for any advice.

Enjoy the rest of the Labor Day!

Regards,
Zhiwen

Reply via email to