On Wed, Feb 23, 2011 at 10:01 AM, Julien Derr <julien.d...@gmail.com> wrote:
> Hi everyone,
>
> I guess I understand where is the problem in my last post: I am a little bit
> lost in the classes
> I am just modifying the simpletrenchSystem.py example file. I would like the
> extension velocity to be proportional to the gradient of the metalVar field.

Unfortunately the extension veloocity is a scalar that propogates in
teh direction normal to the interface so it isn't a true velocity. The
name is a slight misnomer, but in any event you can't set it with a
vector value.

> in the example, depositionRateVariable is of type
>>>><class 'fipy.variables.binaryOperatorVariable.binOp'>
> so it is not already a CellVariable

"binOp"s can be CellVariable's, it's just in this case the binOp is
constructed from vector values face variables.

> naively I wrote something like
>>>>depositionRateVariable=metalVar.getFaceGrad()
>
> but now depositionRateVariable is a different type ??? that's why I get an
> error  :
>>>>    self._value[:] = value
>>>>ValueError: shape mismatch: objects cannot be broadcast to a single shape

Remember that the depositionRateVariable is a scalar quantity. You may
want to advect the interface proportinal to the gradient of the metal
ion field. To do this you might set,

     depositionRateVariable =  metalVar.getGrad().dot(distanceVar.getGrad())

I think this is probably what you want.

> thanks a lot for your help,

No problem.

Cheers

-- 
Daniel Wheeler


Reply via email to