Thanks for ur code,
I try to run it in a shell, but i have this error message,

Traceback (most recent call last):
  File "C:/Python25/surface.py", line 10, in <module>
    v = CellVariable(mesh=m, value=numerix.exp(-(x**2+y**2)))
  File "C:\Python25\lib\site-packages\fipy\variables\cellVariable.py", line
74, in __init__
    Variable.__init__(self, mesh = mesh, name = name, value = value, unit =
unit, array = array)
  File "C:\Python25\lib\site-packages\fipy\variables\variable.py", line 130,
in __init__
    self._setValue(value = value, unit = unit, array = array)
  File "C:\Python25\lib\site-packages\fipy\variables\variable.py", line 512,
in _setValue
    self.value = self._makeValue(value = value, unit = unit, array = array)
  File "C:\Python25\lib\site-packages\fipy\variables\variable.py", line 542,
in _makeValue
    array[:] = value
ValueError: shape mismatch: objects cannot be broadcast to a single shape

Regards



2008/8/26 Daniel Wheeler <[EMAIL PROTECTED]>

>
> from fipy import *
>
> L = 1.
> N = 100
>
> m = Grid2D(nx=N, ny=N, dx=L / N, dy=L / N)
>
> x, y = m.getCellCenters()
>
> v = CellVariable(mesh=m, value=numerix.exp(-(x**2+y**2)))
>
> vi = viewers.make(v)
>
> vi.plot()
>
> raw_input("wait")
>
> Hope that helps. Cheers.
>
> On Mon, Aug 25, 2008 at 8:25 PM, franck kalala
> <[EMAIL PROTECTED]> wrote:
> > Hi all
> >
> > How do I plot  this surface z=exp(-(x**2+y**2)) using viewers within
> fipy,
> > for a given 2D mesh.
> >
> > Regards
> >
> >
> >
> > --
> > ***********************************************
> > ***********************************************
> > Franck Kalala Mutombo
> > [EMAIL PROTECTED]
> > African Institut for Mathematical Sciences, Muizenberg Cape Town, South
> > Africa
> > [EMAIL PROTECTED]
> > ************************************************
> > ************************************************
> >
>
>
>
> --
> Daniel Wheeler
>
>


-- 
***********************************************
***********************************************
Franck Kalala Mutombo
[EMAIL PROTECTED]
African Institut for Mathematical Sciences, Muizenberg Cape Town, South
Africa
[EMAIL PROTECTED]
************************************************
************************************************

Reply via email to