← Back to team overview

dolfin team mailing list archive

Re: Code generation for function spaces

 

Somewhat related to this is that I have found in the past that creating Forms that have a lot of coefficient functions (>5) is error prone because it's easy to make a mistake with the argument order. How easy would it be to have FFC generate a DOLFIN Form wrapper that takes a

  std::map<std::string, Function*>

as input, where the map key is the name of the function in the FFC input?

We could use something similar to extract the function spaces using the name of the Function space in the FFC input.

Garth



Anders Logg wrote:
FFC now generates code for all function spaces appearing in a form.

It also tries to figure out whether

1. All test spaces are equal and in that case generates

  PrefixTestSpace

2. All trial spaces are equal and in that case generates

  PrefixTrialSpace

3. All spaces are equal and in that case generates

  PrefixFunctionSpace

For the Poisson demo in DOLFIN, the following spaces are thus
generated:

  PoissonBilinearFormArgumentSpace0
  PoissonBilinearFormArgumentSpace1
PoissonLinearFormArgumentSpace0
  PoissonLinearFormCoefficientSpace0
  PoissonLinearFormCoefficientSpace1

  PoissonTestSpace
  PoissonTrialSpace
  PoissonFunctionSpace

All these spaces can be initialized with only a Mesh, so the typical
usage is

  PoissonFunctionSpace V(mesh);



------------------------------------------------------------------------

_______________________________________________
DOLFIN-dev mailing list
DOLFIN-dev@xxxxxxxxxx
http://www.fenics.org/mailman/listinfo/dolfin-dev




Follow ups

References