2010/7/16 Benny Malengier <[email protected]>

> I hit a much more problematic thing with this numpy.
> The code
>
> from fipy.meshes.numMesh.grid2D import Grid2D
> mesh = Grid2D(dx=0.1, dy=0.1, nx=10, ny=10)
> ap = CellVariable(mesh=mesh, value=0.01)
> coeff = mesh._getFaceAreas() * mesh._getCellDistances() /  \
>            ap.getArithmeticFaceValue()
> print 'coval', type(coeff), type(coeff.getValue())
>
> Now fails with:
> AttributeError: 'MaskedArray' object has no attribute 'getValue'
>
> So coeff is a MaskedArray, while on older numpy it is the expected binOp
>
> I'm investigating what is causing it.
>

Note that above fragment is from the stokescavity example. Changing the code
to:

coeff = 1/ ap.getArithmeticFaceValue()  * mesh._getFaceAreas() *
mesh._getCellDistances()

works around it. It might be a bug in numpy trunk or it is due to new
features.

Benny



> Benny
>
> 2010/7/15 Jonathan Guyer <[email protected]>
>
>
>>
>> On Jul 15, 2010, at 3:02 AM, Benny Malengier wrote:
>>
>> > It seems ndarray has a dot function now in numpy trunk, updated my numpy
>> and fipy crashes like ...
>>
>> Thanks for the alert
>>
>>
>>
>>
>

Reply via email to