On Wed, Apr 15, 2009 at 08:30:17AM +0200, Johan Hake wrote: > On Tuesday 14 April 2009 17:28:07 Anders Logg wrote: > > On Tue, Apr 14, 2009 at 10:17:06AM -0500, Robert Kirby wrote: > > > In most Trilinos packages, you also have the opportunity to set these > > > parameters in code (though I think it's a case-by-case procedure rather > > > than having a common Parametrized class). So there could be three > > > methods for setting parameters: > > > 1.) Directly in code > > > 2.) a parameter list via XML > > > 3.) command line > > > > > > I'm not sure if there are any advantages to having both 2 & 3 in place, > > > but am happy to be persuaded. > > > > 1. Obvious > > > > 2. Good for storing default values system-wide and on a per-user basis in > > say ~/.dolfin (but less obvious that it will be useful). But maybe most > > of all to store the set of parameters used for a particular simulation > > and remember those parameters. > > > > 3. Good for quickly changing an option without needing to edit any > > file (either code or XML). > > > > The first option is already in place. The second would require little > > work: XML input/output already working, just need to decide on a > > location for the XML files. The third would require some work but not > > that much. > > Looks good. I think it is worth while to have a breif look at what diffpack > do, as Kent suggests. The command line parser would be nice if it could read > out what parameters are defined and then define valid options based on these. > I do not know if this is possible though :P > > With nested parameters I ment hierarchical parametrization. I did not know it > was in place already! Well, then I use my own system in python instead ;)
If foo and bar are parametrized, then foo can make bar parametrized by
foo by doing
bar.set("parent", foo);
This is typically used for parametrizing member variables. For
example, VariationalProblem is a parent to its linear solver by doing
solver.set("parent", *this);
So when the linear solver requires a parameter and it's not found in
the solver itself, the parent is asked, then its parent etc until
finally the global parameter value is used.
--
Anders
> > Anyone is welcome to have a go at these, but I have limited time right
> > now myself.
>
> Unfortunatly I neither have the time...
>
> Johan
signature.asc
Description: Digital signature
_______________________________________________ DOLFIN-dev mailing list [email protected] http://www.fenics.org/mailman/listinfo/dolfin-dev
