← Back to team overview

dolfin team mailing list archive

Re: Assembly, FFC, functions, ...

 

On Thu, Feb 03, 2005 at 08:14:00PM +0100, Johan Jansson wrote:

> I forgot that we have a settings system, that's why I didn't see how
> it could work. If we use the settings system for all the parameters,
> then I guess the solver doesn't need to save any state, and these
> types of functions can be statis. As far as I've understood, this is
> the principle we have, that we should store all settings in the
> settings system, or?

It's convenient to use the settings system, but sometimes you may want
to use the GMRES solver for two different equations with different
settings.

Some general things we need to decide for the settings system:

1. Should we make it possible to store (the relevant) settings
individually for each object? There is a class called Variable that
some classes inherit from that makes it possible to put a name and a
label on an object (convenient for functions when they are saved to a
file). Should we add an individual data base to Variable?

I think it is bad design for a class to have a bunch of functions
setThis(), getThis(), setThat(), getThat(), and it might also be
inconvenient if one has to give a long list of arguments to the
constructor.

Another solution is that classes that need lots of settings take an
object containing the settings as an argument.

2. We need something more sophisticated for the settings database. The
good thing about the current system is that you can store and fetch
values using the same functions independent of type:

dolfin_set("tolerance", 0.1);
real TOL = dolfin_get("tolerance");

dolfin_set("file name", "solution.m");
string filename = dolfin_get("file name");

The bad thing is that each dolfin_get() does a linear search through
the data base for the correct key. The list of (key, value) pairs
should be hashed on the key and there is probably a some standard
library we could use for this.

We also need to make it possible to store global settings to files
(like "settings.xml") and make DOLFIN look for settings in appropriate
locations on startup.

/Anders



References