Hello Jonathan,

I try now to work with a Constraint object. This doesn't give me an error
message but I also do not see the rectangle in the plot.

>>>x, y = mesh.cellCenters[0], mesh.cellCenters[1]
>>>X, Y = mesh.faceCenters[0], mesh.faceCenters[1]
>>>
>>>rect2 = (x>9)&(x<22)&(y>50)&(y<100)
>>>
>>>crect2 = Constraint(10,rect2 )
>>>
>>>rect2.constrain(crect2)

Thank you for your help!
Damian




2013/9/27 Guyer, Jonathan E. Dr. <[email protected]>

>
> On Sep 27, 2013, at 8:26 AM, Jon Guyer <[email protected]>
>  wrote:
>
> >> 2) I included
> >>>>> phi.constrain(phi[bacteria5.value], where=bacteria2)
> >> before
> >>>>> viewer = Viewer(vars=phi, datamin=0., datamax=2.)
> >> and never got beyond this line. (It didnt give me an error within two
> minutes…)
> >
> > That needs to be phi.value[bacteria5.value], not phi[bacteria5.value].
> >
> > As it stands, the constraint is that the value at bacteria2 should be
> the instantaneous value of phi at bacteria5. To determine this, FiPy has to
> get the field of current values, then apply all constraints and return the
> result. You have a constraint that depends on all constraints (including
> itself) and it goes into an infinite loop.
>
> I meant to say, I can see the value of having a constraint that depends on
> the *unconstrained* instantaneous value, which would not provoke the
> infinite loop. I've filed a ticket to look into making a public API for
> this: http://matforge.org/fipy/ticket/656.
>
> As it stands, you'll need to manually reset the constraint at every
> timestep.
>
>
> _______________________________________________
> fipy mailing list
> [email protected]
> http://www.ctcms.nist.gov/fipy
>   [ NIST internal ONLY: https://email.nist.gov/mailman/listinfo/fipy ]
>
_______________________________________________
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