On Feb 22, 2010, at 5:59 PM, Michael Johnston wrote:
I am continuing to have trouble with a variable flux condition based
on the
phase variable value. For example, the right boundary the depends
the phase
variable in such a way:
BCs = (FixedFlux(mesh.getFacesRight(),
value=pow(var.getFaceValue[mesh.getFacesRight().getValue()],
0.5)*pow(1-var.getFaceValue[mesh.getFacesRight().getValue()],0.5)
However, I receive a shape mismatch error:
ValueError: shape mismatch: objects cannot be broadcast to a single
shape
I thought that only those phase values on the right side should be
used to
determine a right handed fixed flux.
Passing `faces=mesh.getFacesRight()` to FixedFlux() takes care of that.
Just do:
BCs = (FixedFlux(mesh.getFacesRight(),
value=pow(var.getFaceValue(),0.5)*pow(1-var.getFaceValue(),0.5)),)
or
BCs = (FixedFlux(mesh.getFacesRight(),
value=var.getFaceValue()**0.5*(1-var.getFaceValue())**0.5),)
as you prefer.