What martin suggests is correct. You should declare all entries, regardless of
whether you will use them or not.
In your cc file, move all the prm.declare_entry functions before:
prm.declare_entry ("System Type","Error", Patterns::Anything(),"The type of
system being solved: eg. foo, bar, etc.");
prm.declare_entry ("prm foo","false", Patterns::Bool(),"Some Boolean: true
or false");
prm.declare_entry ("prm bar","false", Patterns::Bool(),"Some other Boolean:
true or false");
prm.read_input(prm_file_name);
system_type = prm.get("System Type");
if (system_type == "foo")
etc. etc.
Something similar is done in step-34, where the parameter handler is declared
for both 2 and 3d, and then one decides from the prm file itself if it wants to
run the 2d or the 3d code.
Luca.
--
Luca Heltai <[email protected]>
http://people.sissa.it/~heltai/
Scuola Internazionale Superiore di Studi Avanzati
Phone: +39 040 3787 449, Office: 732
--
There are no answers, only cross references
On Aug 29, 2011, at 7:49 PM, Jason Sheldon wrote:
> Hello everyone,
>
> I've come across the need to read specific values from a parameter file
> before I know which values I will be reading later. I can get the code to
> compile and run, but it shoots out a lot of warnings saying parameters have
> not been declared.
>
> I've mocked up a small example of this. (attached) I was wondering if there
> was a way to prevent these warnings from occurring, or a different way I
> should be calling the parameter file to avoid the issue.
> --
> -Jason Sheldon
> <main.cc><PRMTest.prm>_______________________________________________
> dealii mailing list http://poisson.dealii.org/mailman/listinfo/dealii
_______________________________________________
dealii mailing list http://poisson.dealii.org/mailman/listinfo/dealii