fiat team mailing list archive
-
fiat team
-
Mailing list archive
-
Message #00142
Re: Bug in discontinuous vector Lagrange
This is related to numpy (making me responsible for introducing the
bug). In P0.py, on line 44,
bary = numpy.average( numpy.array( map( numpy.array , \
vs.values() ) ) )
should be replaced by
bary = numpy.average( numpy.array( map( numpy.array , \
vs.values() ) ) , 0 )
Some basic verification tests in FIAT would be really useful.
Garth
Anders Logg wrote:
> Rob, vector-valued DG(0) is broken:
>
>>> from FIAT.DiscontinuousLagrange import *
>>> from FIAT.shapes import *
>>> P0 = DiscontinuousVectorLagrange(TRIANGLE, 0, 2)
> ---------------------------------------------------------------------------
> exceptions.TypeError
>
> /usr/lib/python2.4/site-packages/FIAT/DiscontinuousLagrange.py in
> DiscontinuousVectorLagrange(shape, n, nc)
> 89 else: return DiscLagrange( shape , n )
> 90
> 91 def DiscontinuousVectorLagrange( shape , n , nc ):
> ---> 92 if n == 0: return P0.VecP0( shape , nc )
> 93 else: return DiscVecLagrange( shape , n ,nc )
>
> /usr/lib/python2.4/site-packages/FIAT/P0.py in __init__(self, shape, nc)
> 61 def __init__( self , shape , nc ):
> 62 U = polynomial.OrthogonalPolynomialArraySet( shape , 0
> , nc )
> ---> 63 Udual = VecP0Dual( shape , U )
> 64 polynomial.FiniteElement.__init__( self , Udual , U )
> 65
>
> /usr/lib/python2.4/site-packages/FIAT/P0.py in __init__(self, shape, U)
> 44 bary = numpy.average( numpy.array( map( numpy.array ,
> \
> 45
> vs.values() ) ) )
> ---> 46 self.pts = ( tuple(bary) , )
> 47 ls = [ functional.ComponentPointEvaluation( U , c ,
> bary ) \
> 48 for c in range( nc ) ]
>
> TypeError: iteration over non-sequence
>
> /Anders
> _______________________________________________
> FIAT-dev mailing list
> FIAT-dev@xxxxxxxxxx
> http://www.fenics.org/mailman/listinfo/fiat-dev
>
References