On Sep 24, 2013, at 3:22 PM, Damian Kösters <[email protected]> wrote:

>  * Why is my selection "bacteria" of type <type 'numpy.ndarray'>, whereas  the
> facesTopLeft is <class 'fipy.variables.binaryOperatorVariable.binOp'> ?

Because of a bug: http://matforge.org/fipy/ticket/447

Use:

>>> x, y = mesh.cellCenters[0], mesh.cellCenters[1]
>>> X, Y = mesh.faceCenters[0], mesh.faceCenters[1]

>  * How can I change the value of phi in the bacteria2-area to the recent 
> value in another equally sized patch?

>>> bacteria5 = ((x-70)**2+(y-40)**2) < 10

apply a new constraint to be applied after the original one

>>> phi.constrain(phi.value[bacteria5], where=bacteria2)  

or

change the value of the original constraint (assuming you know which one)
note that the facesTopLeft and facesBottomRight constraints don't appear 
in phi.constraints

>>> phi.constraints[1].value = phi.value[bacteria5] 


> And how can I manipulate phi at one single place?  It should not be constant 
> afterwards.


>>> phi[bacteria5] = phi[bacteria2]

If you make the change to x, y above, then

>>> phi[bacteria5.value] = phi[bacteria2.value]


_______________________________________________
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