Subject: [FFC-dev] DOLFIN wrapper code generated by FFC

From: "Garth N. Wells" <[email-masked]>
Date: Thu, 23 Oct 2008 10:59:53 +0100

Anders, Could you modify the wrapper code generated by FFC to include 
FunctionSpaces as arguments? I modified the code in 
dolfin/ale/Poisson*.h by hand.

It would reduce the number of Form constructors if the FFC generated 
wrapper code would create a vector of FunctionSpaces.

Garth

---

From: Anders Logg <[email-masked]>
Date: Thu, 23 Oct 2008 13:27:56 +0200

> dolfin/ale/Poisson*.h by hand.

Yes, I'm just about to.

> wrapper code would create a vector of FunctionSpaces.

Yes, we can assume that the Form constructor takes a vector of
FunctionSpace pointers (or shared pointers). The generated code will
add the appropriate constructors:

  class Form
  {
    Form(Array<FunctionSpace*> function_spaces);
    Form(Array<std::tr1::shared_ptr<FunctionSpace> > function_spaces);
  };

  class PoissonBilinearForm : public Form
  {
    PoissonBilinearForm(FunctionSpace& V0, FunctionSpace& V1);
    PoissonBilinearForm(std::tr1::shared_ptr<FunctionSpace> V0, std::tr1::shared_ptr<FunctionSpace>);

    PoissonBilinearForm(Array<FunctionSpace*> function_spaces);
    PoissonBilinearForm(Array<std::tr1::shared_ptr<FunctionSpace> > function_spaces);
  };

-- 
Anders

---

From: "Garth N. Wells" <[email-masked]>
Date: Thu, 23 Oct 2008 12:40:29 +0100

>     Form(Array<FunctionSpace*> function_spaces);

I changed the above to

      Form(Array<FunctionSpace&> function_spaces);

to keep away from plain pointers so ownership is unambiguous.

Garth

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

---

From: Anders Logg <[email-masked]>
Date: Thu, 23 Oct 2008 13:46:06 +0200

> to keep away from plain pointers so ownership is unambiguous.

ok. I've pushed some more adjustments to the Form class (which breaks
compilation) but will try to push some changes to the code generation
soon.

-- 
Anders