ForestClaw / forestclaw

Quadtree/octree adaptive PDE solver based based on p4est.
http://www.forestclaw.org
BSD 2-Clause "Simplified" License
57 stars 21 forks source link

Add support for multiple ini files, simplify options parsing #265

Closed scottaiton closed 1 year ago

scottaiton commented 1 year ago

The register option calls have an argument for which filename to read from,

clawpatch_opt =   fclaw2d_clawpatch_options_register(app, "clawpatch",  "fclaw_options.ini");

This argument was being ignored and forest claw was hardcoded to read from fclaw_options.ini. This has been fixed to allow the user to specify the ini files.

As for the options parsing calls, there were three functions calls:

options = fclaw_app_get_options (app);
retval = fclaw_options_read_from_file(options);
vexit =  fclaw_app_options_parse (app, &first_arg,"fclaw_options.ini.used");

This has been reduced to a single function call:

vexit =  fclaw_app_options_parse (app, &first_arg,"fclaw_options.ini.used");

fclaw_app_options_parse now does all the parsing and fclaw_options_read_from_file does nothing. fclaw_options_read_from_file has been kept for backwards compatibility.