Subject: [FFC-dev] broken Nedelec elements

From: Bartosz Sawicki <[email-masked]>
Date: Wed, 27 Aug 2008 02:22:41 +0200

Hi,

I have few months break in working with Fenics. Today I've just 
downloaded the current version from hg repository, ad realized that my 
previously working code fails.

It seems that the problem is in FFC, which produce no-warning-free C++ 
code, especially evalute_dof() method.

The error is very easy to repeat. Just try to compile any form with 
Nedelec elements. For example:

# File first.form
eN = FiniteElement("Nedelec", "tetrahedron", 0)
eL = VectorElement("Lagrange","tetrahedron", 1)
v = TestFunction(eN)
u = TrialFunction(eN)
source = Function(eL)
a= dot(rot(v), rot(u))*dx
L = dot(v,source)*dx

$ ffc -l dolfin first.form

$ `pkg-config --variable=compiler dolfin` `pkg-config --cflags dolfin` 
-c main.cpp

first.h: In member function ‘virtual double 
UFC_firstBilinearForm_finite_element_1::evaluate_dof(unsigned int, const 
ufc::function&, const ufc::cell&) const’:
first.h:1394: warning: unused variable ‘Jinv_00’
first.h:1395: warning: unused variable ‘Jinv_01’
first.h:1396: warning: unused variable ‘Jinv_02’
first.h:1397: warning: unused variable ‘Jinv_10’
first.h:1398: warning: unused variable ‘Jinv_11’
first.h:1399: warning: unused variable ‘Jinv_12’
first.h:1400: warning: unused variable ‘Jinv_20’
first.h:1401: warning: unused variable ‘Jinv_21’
first.h:1402: warning: unused variable ‘Jinv_22’
(...)

If I comment out these lines, and everything seems to work properly, so 
it seems that this is just a tiny bug :)

Regards,
BArtosz

---

From: Marie Rognes <[email-masked]>
Date: Wed, 27 Aug 2008 12:09:30 +0200

> it seems that this is just a tiny bug :)

See if it works better now.

PS: ffc/compiler/format/codesnippets.py needs a clean-up (especially now 
;) ).

-- 
Marie E. Rognes
Ph.D Fellow, 
Centre of Mathematics for Applications, 
University of Oslo
http://folk.uio.no/meg

---

From: Bartosz Sawicki <[email-masked]>
Date: Wed, 27 Aug 2008 15:53:19 +0200

Marie Rognes wrote:
>> UFC_firstBilinearForm_finite_element_1::evaluate_dof(unsigned int, 
>> const ufc::function&, const ufc::cell&) const’:
>> If I comment out these lines, and everything seems to work properly, 
>> so it seems that this is just a tiny bug :)
>>
>>   
> 

Yes, know it works perfectly :) Thank you.

> PS: ffc/compiler/format/codesnippets.py needs a clean-up (especially now 

I realized that there is no single demo in dolfin which use Nedelec. 
Don't you think, that it won't be such simple bugs when buildbot has a 
chance to find it?
I can prepare simple demo catalog, if you like.

regards,
BArtek

---

From: "Garth N. Wells" <[email-masked]>
Date: Wed, 27 Aug 2008 15:00:52 +0100

> I can prepare simple demo catalog, if you like.

A Python example was added recently,

   sandbox/electromagnetics/demos

but hasn't been moved to the usual demo folder yet. A C++ version of the 
same problem would be good. I suspect that JIT may use less stringent 
g++ compiler flags than dolfin.

If you have something, send a hg bundle to the dolfin-dev list

Garth

> regards,
> BArtek
> 
> _______________________________________________
> FFC-dev mailing list
> [email-masked]
> http://www.fenics.org/mailman/listinfo/ffc-dev