← Back to team overview

ffc team mailing list archive

Re: FFC error

 

On Fri, May 25, 2007 at 10:16:56AM +0200, Kristian Oelgaard wrote:
> Quoting "Garth N. Wells" <g.n.wells@xxxxxxxxxx>:
> 
> > 
> > 
> > Anders Logg wrote:
> > > On Fri, May 25, 2007 at 09:01:04AM +0200, Garth N. Wells wrote:
> > >> Anders Logg wrote:
> > >>> I'm pretty sure the problem is a few changes we made to get BDM
> > >>> elements working. I was looking at it but ran out of time. I'll fix it
> > >>> as soon as I can (which should be early next week). If you want to
> > >>> take a look, try to find out at which changeset it broke.
> > >>>
> > >> I tried to find an old changeset, but it still didn't work. I think that 
> > >> the example has an extra factor in it (which I didn't have before) which 
> > >> breaks things. It does work with quadrature.
> > >>
> > >> Garth
> > > 
> > > Could it just be that numpy is generating the error since FFC tries to
> > > create an array that is too large? (Product of all dimensions.)
> > >
> > 
> > Yes. I had a quick look on the net, but couldn't find information on the 
> > limitations of numpy.
> 
> The following python script generates a similar error:
> import numpy
> 
> n = 12 # ok
> #n = 13 # not ok
> shape = [2 for i in range(n)]
> print "shape A: ", shape
> 
> A = numpy.zeros(shape, dtype= numpy.float)
> print "A: ", A
> 
> rearr = range(n)
> rearr = rearr[::-1]
> print "rearr: ", rearr
> 
> Ar = numpy.transpose(A, rearr)
> print "Ar", Ar
> print "shape Ar: ", numpy.shape(Ar)
> 
> looks like there's a limitation in Numpy
> 
> Kristian

Yes, I was just looking at this myself. You will get the same thing
if you do

  import numpy

  n = 13
  shape = n*(1,)
  axes  = range(n)

  A = numpy.zeros(shape)
  numpy.transpose(A, axes)

I will ask some Python gurus.

/Anders


> 
> > Garth
> > 
> > > /Anders
> > > 
> > > 
> > >>> I tried to simplify the form a bit and find the simplest possible form
> > >>> where it still breaks, but it seems it only breaks if the form is
> > >>> complicated enough (has enough factors in it).
> > >>>
> > >>> /Anders
> > >>>
> > >>>
> > >>> On Thu, May 24, 2007 at 09:55:15PM +0200, Garth N. Wells wrote:
> > >>>> Any ideas what going on here? It's causing problem for me.
> > >>>>
> > >>>> Garth
> > >>>>
> > >>>> Anders Logg wrote:
> > >>>>> I'll take a look.
> > >>>>>
> > >>>>> /Anders
> > >>>>>
> > >>>>>
> > >>>>> On Thu, May 17, 2007 at 03:45:10PM +0200, Garth N. Wells wrote:
> > >>>>>> When trying to compile a form file, I'm getting the error
> > >>>>>>
> > >>>>>> Computing tensor representation for term 0... *** dimensions too
> > large.
> > >>>>>> *** To get more information about this error, rerun ffc with the
> > option -d1.
> > >>>>>>
> > >>>>>> Running with -d1,
> > >>>>>>
> > >>>>>>   File
> > >>>>>>
> >
> "/usr/lib/python2.5/site-packages/ffc/compiler/representation/tensor/monomialintegration.py",
> > 
> > >>>>>>
> > >>>>>> line 54, in integrate
> > >>>>>>      A0 = __compute_product(psis, vscaling * monomial.numeric *
> > weights)
> > >>>>>>    File
> > >>>>>>
> >
> "/usr/lib/python2.5/site-packages/ffc/compiler/representation/tensor/monomialintegration.py",
> > 
> > >>>>>>
> > >>>>>> line 268, in __compute_product
> > >>>>>>      A0 = numpy.transpose(A0, rearrangement)
> > >>>>>>    File "/usr/lib/python2.5/site-packages/numpy/core/fromnumeric.py",
> > >>>>>> line 118, in transpose
> > >>>>>>      return transpose(axes)
> > >>>>>> ValueError: dimensions too large.
> > >>>>>>
> > >>>>>> I was able to compile this form last weeks. Below is the form.
> > >>>>>>
> > >>>>>> Garth
> > >>>>>>
> > >>>>>>
> > >>>>>>
> > >>>>>> scalar1 = FiniteElement("Lagrange", "triangle", 1)
> > >>>>>>
> > >>>>>> r  = TestFunction(scalar1)
> > >>>>>> p1 = TrialFunction(scalar1)
> > >>>>>>
> > >>>>>> p0   = Function(scalar1)
> > >>>>>> lam  = Function(scalar1)
> > >>>>>> FFF  = Function(scalar1)
> > >>>>>>
> > >>>>>> stab = Function(scalar1)
> > >>>>>> h    = Constant("triangle")
> > >>>>>>
> > >>>>>> k     = Constant("triangle")
> > >>>>>> theta = Constant("triangle")
> > >>>>>> dt    = Constant("triangle")
> > >>>>>>
> > >>>>>> beta = mult(h,stab)
> > >>>>>> SUPG = - beta*lam*k*dot(grad(p0),grad(r))
> > >>>>>>
> > >>>>>> L_saturation_stab = SUPG*lam*k*dot(grad(p0),grad(FFF))*dx
> > >>>>>>
> > >>>>>> L = L_saturation_stab
> > >>>>>>
> > >>>>>> _______________________________________________
> > >>>>>> FFC-dev mailing list
> > >>>>>> FFC-dev@xxxxxxxxxx
> > >>>>>> http://www.fenics.org/mailman/listinfo/ffc-dev
> > >>>>> _______________________________________________
> > >>>>> FFC-dev mailing list
> > >>>>> FFC-dev@xxxxxxxxxx
> > >>>>> http://www.fenics.org/mailman/listinfo/ffc-dev
> > >>>>>
> > >>>> _______________________________________________
> > >>>> FFC-dev mailing list
> > >>>> FFC-dev@xxxxxxxxxx
> > >>>> http://www.fenics.org/mailman/listinfo/ffc-dev
> > >>> _______________________________________________
> > >>> FFC-dev mailing list
> > >>> FFC-dev@xxxxxxxxxx
> > >>> http://www.fenics.org/mailman/listinfo/ffc-dev
> > >>>
> > >>
> > >> _______________________________________________
> > >> FFC-dev mailing list
> > >> FFC-dev@xxxxxxxxxx
> > >> http://www.fenics.org/mailman/listinfo/ffc-dev
> > > _______________________________________________
> > > FFC-dev mailing list
> > > FFC-dev@xxxxxxxxxx
> > > http://www.fenics.org/mailman/listinfo/ffc-dev
> > > 
> > 
> > 
> > _______________________________________________
> > FFC-dev mailing list
> > FFC-dev@xxxxxxxxxx
> > http://www.fenics.org/mailman/listinfo/ffc-dev
> > 
> 
> 
> _______________________________________________
> FFC-dev mailing list
> FFC-dev@xxxxxxxxxx
> http://www.fenics.org/mailman/listinfo/ffc-dev


References