Hi Dan,

Does FiPy also have a corresponding lattice that spans the domain? For
instance:
mesh = PeriodicGrid2D(dx=dx, dy=dy, nx=nx, ny=ny)
phi = CellVariable(name = "periodic",
                   mesh = mesh,
                   value = 0.0)
phi[0] = 1000

places a pulse at 0,0. Does this mean there is a lattice and a set of cells
that span the domain?

On Tue, Sep 20, 2011 at 11:12 AM, Daniel Wheeler
<[email protected]>wrote:

>
> On Tue, Sep 20, 2011 at 10:11 AM, list user <[email protected]> wrote:
> > Is it possible to set the concentration in a specific cell?
>
> Yes as long as you can identify the cell geometrically. You can do
> something like this where X and Y are the closest points to the cell
> that needs changing and var is the cell variable.
>
>  >>> x, y = mesh.getCellCenters()
>  >>> ID = numerix.argmin((x - X)**2 + (y - Y)**2)
>  >>> var[ID] = value
>
> > It's my
> > understanding that CellVariable will allow the user to define an intial
> > concentration for the entire field but I can't seem to find a method to
> set
> > a _pulse_ of concentration.
>
> You can just index as you would with a numpy array.
>
> Hope that helps.
>
> Cheers.
>
> --
> Daniel Wheeler
>
>

Reply via email to