Subject: [FFC-dev] DOLFIN wrapper code

From: "Garth N. Wells" <[email-masked]>
Date: Wed, 05 Nov 2008 15:17:13 +0000

In the FFC-produced wrapper code for DOLFIN, could will still generate a 
Form constructor which takes the coefficient functions (or a vector of 
coefficient functions) as an argument? This is needed when one works 
with a pointer to a form. Doing

   Form* a;
   a = new WeightedPoissonBilinearForm(V, V);

it's not possible to attach coefficient functions because a Form doesn't 
know about them, only WeightedPoissonBilinearForm does.

Garth

---

From: Anders Logg <[email-masked]>
Date: Thu, 6 Nov 2008 10:55:47 +0100

> know about them, only WeightedPoissonBilinearForm does.

Is this something that happens in user code (so it needs to look
nice)?

Otherwise, just do

  Form* a;
  static_cast<WeightedPoissonBilinearForm*>(a)->f = f;

-- 
Anders

---

From: "Garth N. Wells" <[email-masked]>
Date: Thu, 06 Nov 2008 10:13:56 +0000

> Is this something that happens in user code (so it needs to look

Kristian has also run into this issue with the plasticity solver library 
in fenics-apps.

The problem arises when the Form can only be determined at runtime, e.g. 
switching between 2D and 3D depending on the supplied mesh.

Garth

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

---

From: Kristian Oelgaard <[email-masked]>
Date: Thu, 06 Nov 2008 11:21:02 +0100

>   static_cast<WeightedPoissonBilinearForm*>(a)->f = f;

In this case, how and when do you set the FunctionSpace of the form?
I don't see a problem in having the old constructor of the type

PoissonLinearForm(dolfin::FunctionSpace& V0, dolfin::Function& v0)

existing alongside the new approach such that the user can avoid doing too much
complicated stuff.

Kristian

---

From: Anders Logg <[email-masked]>
Date: Thu, 6 Nov 2008 17:20:42 +0100

> existing alongside the new approach such that the user can avoid doing too much

I agree. I'll add it back again.

-- 
Anders

---

From: "Garth N. Wells" <[email-masked]>
Date: Thu, 06 Nov 2008 16:24:06 +0000

> I agree. I'll add it back again.

Could you take a look at the wrapper code for Functional too while 
you're at it? Presently, two identical constructors are being produced 
by FFC.

Garth

---

From: Anders Logg <[email-masked]>
Date: Thu, 6 Nov 2008 17:51:22 +0100

> you're at it? Presently, two identical constructors are being produced 

ok.

-- 
Anders