dolfin team mailing list archive
-
dolfin team
-
Mailing list archive
-
Message #10423
Re: Code generation for function spaces
What about generating code to do this:
FooFunctionSpace V(mesh);
FooForm a(V, V)
Function f(V);
a.f = &f; // can't use reference
or
a.set_f(f); // allow both reference and shared_ptr
a.set_g(g);
this requires reserving the names set_* in Form.
--
Martin
2008/10/27 Garth N. Wells <gnw20@xxxxxxxxx>:
> 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
>
>
> _______________________________________________
> DOLFIN-dev mailing list
> DOLFIN-dev@xxxxxxxxxx
> http://www.fenics.org/mailman/listinfo/dolfin-dev
>
Follow ups
References