On Thu, Jul 14, 2011 at 10:44 AM, Julien Derr <julien.d...@gmail.com> wrote:
> reoups.. actually, if you could mind ... I tried this implementation,
>
>     return self.distanceVar._cellInterfaceFlag * 1e+20 * (self.ionvar() -
> 0.1)
>
> where 0.1 would be the value I want at the boundary... and ionvar is
> supposed to represent the diffusing field I guess ...
>
> but get the error :
>
> AttributeError: '_CUSTOMMetalIonSourceVariable' object has no attribute
> 'ionvar'

Is ionvar defined anywhere as an attribute of
'_CUSTOMMetalIonSourceVariable'? Regardless of the error, I don't
believe your implementation will achieve what you want as you aren't
using an ImplicitSourceTerm. You need both an implicit and explicit
source term to fix the value of a cells in a given location. Something
like this

  >>> x = mesh.cellCenters ## mesh.getCellCenters() for older fipy
  >>> myRegularEqn + ImplicitSourceTerm(1e+20 * (x > 3)) - 1e-20 * (x
> 3) * value == 0

This would set the value of the variable to be `value` where x > 3.

-- 
Daniel Wheeler


Reply via email to