Subject: [FFC-dev] ffc-0.2.0 problem with running demos

From: osman buyukisik <[email-masked]>
Date: Sun, 25 Sep 2005 10:18:02 -0700

Hi,
  After I installed ffc-0.2.0 , tried the demos directory. I am getting the 
following error:
osman@linux:~/ffc-0.2.0/src/demo> ffc Stokes.form
This is FFC, the FEniCS Form Compiler, version 0.2.0.
For further information, go to http://www/fenics.org/ffc/.

Parsing Stokes.form
Output written to Stokes.py
*** Sum instance has no attribute 'conjugate'
osman@linux:~/ffc-0.2.0/src/demo>

Mass.form, Elasticity.form, NavierStokes.form, PoissonSystem.form  work; 
Heat.form, Stokes.form, Poisson.form do not, similar error.

-osman

---

From: Anders Logg <[email-masked]>
Date: Sun, 25 Sep 2005 09:35:12 -0500

Which version of Python and Python Numeric are you running?
I'm using Python 2.4.1 and Python Numeric 23.8-3 (from Debian)
and all forms compile cleanly on my system.

This looks like a problem with using the correct dot function. The
Python Numeric dot function tries to take the conjugate of one of the
arguments. It would help if you commented out some of the exception
handling code in src/bin/ffc:

#        except RuntimeError, exception:
#            print "*** " + str(exception)
#        except Exception, exception:
#            print "*** " + str(exception)

which would print out a traceback to give some more information about
the error.

I should probably add a flag -d (for debug) to ffc that prints out the
full traceback on errors.

/Anders

On Sun, Sep 25, 2005 at 10:18:02AM -0700, osman buyukisik wrote:
> _______________________________________________
> FFC-dev mailing list
> [email-masked]
> http://www.fenics.org/cgi-bin/mailman/listinfo/ffc-dev
> 

-- 
Anders Logg
Research Assistant Professor
Toyota Technological Institute at Chicago
http://www.tti-c.org/logg/

---

From: osman buyukisik <[email-masked]>
Date: Sun, 25 Sep 2005 11:55:00 -0700

> and all forms compile cleanly on my system.
Numeric-24.0b2
Python 2.4.1 (#1, Jul 17 2005, 00:43:15)
[GCC 3.3.4 (pre 3.3.5 20040809)] on linux2
on SuSE 9.2
will try the debug/trace and report later.
-osman

---

From: osman buyukisik <[email-masked]>
Date: Sun, 25 Sep 2005 14:30:50 -0700

> which would print out a traceback to give some more information about

osman@linux:~/ffc-0.2.0/src/demo> ffc Heat.form
This is FFC, the FEniCS Form Compiler, version 0.2.0.
For further information, go to http://www/fenics.org/ffc/.

Parsing Heat.form
Output written to Heat.py
Traceback (most recent call last):
  File "/usr/bin/ffc", line 94, in ?
    main(sys.argv[1:])
  File "/usr/bin/ffc", line 64, in main
    execfile(outname, ns)
  File "Heat.py", line 38, in ?
    a = u1*v*dx + k*c*dot(grad(u1), grad(v))*dx
  File "/usr/lib/python2.3/site-packages/ffc/compiler/operators.py", line 65, 
in dot
    return Numeric.vdot(vec(v), vec(w))
  File "/usr/lib/python2.3/site-packages/Numeric/Numeric.py", line 353, in 
vdot
    return multiarray.matrixproduct(conjugate(ravel(a)),
AttributeError: Product instance has no attribute 'conjugate'
osman@linux:~/ffc-0.2.0/src/demo>

---

From: Anders Logg <[email-masked]>
Date: Sun, 25 Sep 2005 16:07:58 -0500

Thanks for the report. It looks like there is a Numeric.vdot where
there should be a Numeric.dot. Changing from

    # Otherwise, use Numeric.vdot
    return Numeric.vdot(vec(v), vec(w))

to

    # Otherwise, use Numeric.dot
    return Numeric.dot(vec(v), vec(w))

in src/ffc/compilers/operators.py should do the trick.

If possible, could you try it out and see if it works?

/Anders

---

From: osman buyukisik <[email-masked]>
Date: Sun, 25 Sep 2005 22:33:54 -0700

> If possible, could you try it out and see if it works?

No I am getting :
osman@linux:~/ffc-cvs/src/demo> ffc Heat.form
This is FFC, the FEniCS Form Compiler, version 0.2.0.
For further information, go to http://www/fenics.org/ffc/.

Parsing Heat.form
Output written to Heat.py
*** No module named Numeric
osman@linux:~/ffc-cvs/src/demo>

Maybe I have a defective Numeric???

osman

---

From: Anders Logg <[email-masked]>
Date: Sun, 25 Sep 2005 22:20:40 -0500

> Maybe I have a defective Numeric???

Very strange. If no one else can reproduce this error, I'm guessing
there may be something wrong with your Python/Numeric installation.

I've modified FFC in CVS (snapshot created each hour) to use the
correct dot product from Numeric (dot instead of vdot).

/Anders