On Oct 11, 2006, at 10:46 AM, hzhatlboro wrote:
Attached please find the program. When I ran the program, I got
the following error message:-
Traceback (most recent call last):
File "C:\Python24\hzh\pf2dtest.py", line 206, in ?
S20+=s[k]*((.5*epsilon[counti,k]**2-.5*epsilon[j,k]**2)*(phases
[k].getFaceGrad()).getDivergence() \
ValueError: object __array__ method not producing an array
I believe the problem is that you have installed a version of SciPy
that is too new. As explained at <http://www.ctcms.nist.gov/fipy/
installation.html#scipy>, FiPy does not require SciPy but, if
present, it can only use version 0.3.x of SciPy. I get the error you
see when I import version 0.4.x or 0.5.x of SciPy.
Specifically, omega is defined in terms of sigma, and sigma is
declared with:
----
import scipy
# sigma & M
sigma=sigmaGb*scipy.ones((numPhases,numPhases))
M=Mgb*scipy.ones((numPhases,numPhases))
sigma-=sigmaGb*scipy.eye(numPhases,numPhases)
M-=Mgb*scipy.eye(numPhases,numPhases)
----
As a result of using a newer version of SciPy, the type of (omega
[counti,k]-omega[j,k]) is <type 'float64_arrtype'>, which FiPy (and
the Numeric library that it uses) doesn't understand. If you use
SciPy 0.3, then the type of (omega[counti,k]-omega[j,k]) is <type
'float'>, which is just a plain Python floating point number.
It is our intention to make FiPy compatible with the newer NumPy and
SciPy libraries, but this is not trivial and the work is not yet
complete.