>>> print C_V((1.0,1.0))

[0.    0.]

>>> print C_V_xy((20,20))

0.0


Works for me: the problem comes after the initialization.

Please provide a minimal working example, or dig into why C_V_xy gives a scalar 
value instead of the array you're expecting.


Trevor Keller, Ph.D.
Materials Science and Engineering Division
National Institute of Standards and Technology
100 Bureau Dr. MS 8550; Gaithersburg, MD 20899
Office: 223/A131 or (301) 975-2889



________________________________
From: [email protected] <[email protected]> on behalf of Zebo LI 
<[email protected]>
Sent: Thursday, September 10, 2015 4:07 PM
To: FIPY
Subject: Extract data from fipy variables

I defined two meshes in the following way,
(1)
nLnR = 100
nCta = 50
dLnR = 0.02
dCta = 2*np.pi/nCta
PL = nLnR*dLnR
##Create mesh in Polar Coordinate system (LnR,Cta)
Pmesh = PeriodicGrid2DTopBottom(dx=dLnR, dy=dCta, nx=nLnR, ny=nCta)
(2)
##Create mesh in the Cartesian Coordinate system (X,Y)
nx = 100
ny = nx
dx = 1.0
dy = dx
CL = nx*dx
Cmesh = Grid2D(dx=dx, dy=dy, nx=nx, ny=ny)

I also defined two variables on these two meshes:
C_V = CellVariable(name = "Vacancy Concentration", mesh = Pmesh, value = 0.0)
C_V_xy = CellVariable(name = "C_V in XY plane",mesh=Cmesh,value = 0.0)

After solving the equation, I want to check the values at certain points,
If I use
C_V((1.0,1.0))
The out put is array([ 0.,  0.]).
But when I use
C_V_xy((20,20))
I got an error:
IndexError: 0-d arrays can't be indexed

I wonder why this happens and can I extract data at a certain point using the 
coordinate values for the second one?

best,
Zebo

_______________________________________________
fipy mailing list
[email protected]
http://www.ctcms.nist.gov/fipy
  [ NIST internal ONLY: https://email.nist.gov/mailman/listinfo/fipy ]

Reply via email to