← Back to team overview

dolfin team mailing list archive

Re: Parameter system

 

On Thu, May 7, 2009 at 9:43 PM, Garth N. Wells <gnw20@xxxxxxxxx> wrote:
>
>
> Anders Logg wrote:
>> I've added some of the requested features to the parameter system,
>> some pushed and some sitting here in a local repository. But the
>> current design makes it a pain to add new features. A single change
>> will make it necessary to add a function in at least 5 different
>> classes.
>>
>> So I'm thinking of reimplementing and simplifying the parameter
>> system. I think I know how to make it simpler.
>>
>> But before I do that, does anyone have opinions on the
>> design/implementation? Is there any third-party library that we
>> could/should use (maybe something in boost)?
>>
>
> This could be interesting:
>
>   http://www.boost.org/doc/libs/1_39_0/doc/html/program_options.html
>
>
> While we're on the topic of boost, this is neat
>
>  http://www.boost.org/doc/libs/1_39_0/libs/parameter/doc/html/index.html
>
> It addresses the problem we had with attaching functions to forms -
> arguments can associated with a name. At first glance it allows
>
>   BilinearForm a(V, V, "f", f, "h", h);
>
> or
>
>    BilinearForm a(V, V, "h", h, "f", f);
>
> so the user doesn't need to worry about the order of the arguments.

We don't have that problem with code generated by dolfin_utils.wrappers:

    BilinearForm a(V, V):
    a.f = f;
    a.h = h;

or:

    CoefficientSet coeffs;
    coeffs.u       = u;
    coeffs.dt      = dt;
    coeffs.beta    = beta;
    BilinearForm a(V, V, coeffs);
    LinearForm L(V, coeffs);

Martin


Follow ups

References