Joshua,
> The main issue I see here is that a ParameterHandler needs all parameters to
> be declared upfront, before it attempts to parse the input file.
Yes, that is correct. We made the decision a long time ago that
parameter files are "statically" defined so that we can catch typos
and other mistakes (Wrong types) at parse time.
Note that you only need to call declare_parameters() for every object
that might be enabled, while you only call parse_parameters() if this
material is enabled.
> SolidMechanicsProblem::declare_parameters (ParameterHandler &prm)
> {
> // declare all possible material model parameters here
>
> MaterialOne::declare_parameters(prm);
> MaterialTwo::declare_parameters(prm);
>
> // ... declare a list of potential material types here: One or Two
> }
Yes, that is how I would do it. It can get rather messy, as you can
see how we do it in ASPECT:
https://github.com/geodynamics/aspect/blob/master/source/simulator/parameters.cc#L1367
Note that all these subclasses like GeometryModel are actually
containers for plugins that can all define their own parameters.
--
Timo Heister
http://www.math.clemson.edu/~heister/
--
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see
https://groups.google.com/d/forum/dealii?hl=en
---
You received this message because you are subscribed to the Google Groups
"deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.