dolfin team mailing list archive
-
dolfin team
-
Mailing list archive
-
Message #10421
Re: Code generation for function spaces
Don't know about the current FFC, but I've thought about the same thing.
As long as the form file defines all Functions in the top level
namespace, the function ufl.load_forms already builds this
map internally using the Python variable names.
Another alternative for UFL would be to let Function have an
optional constructor argument "name" (actually, it's already
there with a TODO: keep me? comment).
We could also add these names to UFC as
"std::string ufc::form::coefficient_name(uint i) const"
--
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
>
References