← Back to team overview

dolfin team mailing list archive

Re: Parameter system

 



Martin Sandve Alnæs wrote:
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;


It was a problem and the above approach is how we resolved it. It doesn't however work well for mixed elements. This still needs to be resolved. Are there names which could be used for a Function in Python (like 'default') which are not legal in C++?

or:

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


. . . which looks like it hasn't been fully implemented. It would fix the problem that in order to do

  Form* my_form = new MyForm(V, V);
  my_form.a = a;

we had to keep the old-style constructor in the generated code.

Garth

Martin




Follow ups

References