Thank you very much Daniel.
In the meantime, I was thinking about the alternate solution to use an
extra variable to put my constraint by adding in my equation :

ceq=CUSTOMbuildMetalIonDiffusionEquation(ionVar=c,distanceVar=phi,depositionRate=depositionRateVariable,diffusionCoeff=D)
 - ImplicitSourceTerm(1E20*interfaceforceq) + interfaceforceq*1E20


the second line shouldn't guarantee that the variable c will be equal
to 1 where interfaceforeq=1 ?
and not change anything when interfaceforeq=0 ?

thanks,

Julien

PS because I'm not observing that, c goes to zero everywhere!

On Thu, Nov 8, 2012 at 5:02 PM, Daniel Wheeler
<[email protected]> wrote:
>
>
>
> On Wed, Nov 7, 2012 at 1:43 PM, Julien Derr <[email protected]> wrote:
>>
>> Hi everyone,
>>
>>
>> I am using constrain in a syntax like
>> c.constrain(1., where=facesOutside)
>>
>> If I want to release the constrain, Is it possible? how can I do this ?
>
>
> Hi Julien,
>
> Yes this is possible. There is a method of the Variable class called
> "release". All this does is remove the constraint from the variables list of
> constraints. One issue in the case above it getting a handle on the actual
> constraint. You'll need to use the "faceConstraints" list to do this. The
> following will probably deal with your issue.
>
>   > import fipy as fp
>   > m = fp.Grid1D()
>   > v = fp.CellVariable(mesh=m)
>   > v.constrain(1., where=m.facesLeft)
>   > print v.faceValue
>   [ 1.  0.]
>   > v.release(v.faceConstraints[0])
>   > print v.faceValue
>   [ 0.  0.]
>
> It might be better if "constrain" returned a reference to the actual
> constraint rather than using the "faceConstraints" attribute to get the
> reference, but at least for now it works as described above.
>
> Cheers
>
> --
> Daniel Wheeler
>
> _______________________________________________
> 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