Subject: [FFC-dev] error

From: "Garth N. Wells" <[email-masked]>
Date: Thu, 26 Apr 2007 17:02:18 +0200

When try to compile the code generated by FFC for the DOFLIN 
Cahn-Hilliard demo (src/demo/nls/cahn-hilliard/CahnHilliard2D.form) , I 
get the below errors related to undeclared variables.

Garth

CahnHilliard2D.h: In member function ‘virtual void 
UFC_CahnHilliard2DBilinearForm_cell_integral_0::tabulate_tensor(double*, 
const double* const*, const ufc::cell&) const’:
CahnHilliard2D.h:3136: error: ‘c3’ was not declared in this scope
CahnHilliard2D.h:3136: error: ‘c2’ was not declared in this scope
CahnHilliard2D.h:3136: error: ‘c1’ was not declared in this scope
CahnHilliard2D.h:4681: error: ‘c0’ was not declared in this scope
CahnHilliard2D.h: In member function ‘virtual void 
UFC_CahnHilliard2DLinearForm_cell_integral_0::tabulate_tensor(double*, 
const double* const*, const ufc::cell&) const’:
CahnHilliard2D.h:7572: error: ‘c3’ was not declared in this scope
CahnHilliard2D.h:7572: error: ‘c2’ was not declared in this scope
CahnHilliard2D.h:7572: error: ‘c1’ was not declared in this scope
CahnHilliard2D.h:9654: error: ‘c0’ was not declared in this scope

---

From: Anders Logg <[email-masked]>
Date: Thu, 26 Apr 2007 17:22:45 +0200

> CahnHilliard2D.h:9654: error: ‘c0’ was not declared in this scope

I think the problem is that constants are no longer supported in
UFC/FFC. They need to be mapped to DG(0) elements and this is something
I haven't fixed yet.

In more detail: In FFC the keyword Constant() should just return a
DG(0) function and on the DOLFIN side, one can create a corresponding
constant function by

    Function c(mesh, 3.0);

for example.

/Anders

---

From: "Garth N. Wells" <[email-masked]>
Date: Mon, 30 Apr 2007 10:05:48 +0200

> UFC/FFC. They need to be mapped to DG(0) elements and this is something

Could you make it possible to invert DG(0) functions (e.g. 1/t)?

Garth

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

---

From: Anders Logg <[email-masked]>
Date: Mon, 30 Apr 2007 13:43:44 +0200

> Could you make it possible to invert DG(0) functions (e.g. 1/t)?

Yes (with some work), but is it necessary?

You can define the corresponding function in DOLFIN as

  Function cinv(mesh, 1.0/c);

/Anders

---

From: "Garth N. Wells" <[email-masked]>
Date: Mon, 30 Apr 2007 14:24:10 +0200

>   Function cinv(mesh, 1.0/c);

Can be useful for terms like time t which can appear as t and 1/t, 
saving the introduction of an extra variable.

Garth

---

From: Anders Logg <[email-masked]>
Date: Fri, 4 May 2007 23:48:56 +0200

> saving the introduction of an extra variable.

Sounds reasonable. I'll put it on my (long and expanding) todo list...

/Anders