getfem-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Getfem-users] Problem with parameters handling


From: Roman Putanowicz
Subject: [Getfem-users] Problem with parameters handling
Date: Mon, 30 Oct 2006 12:10:31 +0100
User-agent: Mutt/1.5.13 (2006-08-11)

Hi, 

I have a problem with setting string parameters from command line:
I have written this small test program:

#include <ftool.h>
#include <iostream>

int main(int argc, char *argv[]) {
  ftool::md_param params;
  params.add_string_param("MSG", "Foo is not Bar");
  params.add_real_param("size", 1.0);
  params.read_command_line(argc, argv);
  std::cout << params.string_value("MSG") << "\n";
  std::cout << params.real_value("size") <<  "\n";
  return 0;
};

and this is the result of running it with different command line arguments.

jinx:~/programming/c++/getfem/examples/params>./params 
Foo is not Bar
1

jinx:~/programming/c++/getfem/examples/params>./params -d size=10.11
Foo is not Bar
10.11

jinx:~/programming/c++/getfem/examples/params>./params -d size=10.11 -d
MSG='foo'
terminate called after throwing an instance of 'dal::failure_error'
  what():  Error in ftool.cc, line 166 : 
  Error reading command line line 1 : Parameter foo not found
  Abort

So as you can see it fails when trying to set string parameter.
On the other hand when using parameter file it works all right.

I will look at the source code but maybe some of you will be 
quicker in finding this bug (if this is a bug:).


Regards

Roman

-- 
Roman Putanowicz  < address@hidden  >
Institute for Computational Civil Engng (L-5)
Dept. of Civil Engng, Cracow Univ. of Technology
www.l5.pk.edu.pl, tel. +48 12 628 2569, fax 2034



reply via email to

[Prev in Thread] Current Thread [Next in Thread]