ElmerFoamFSI  2.0
ElmerFoamFSI is fluid-solid interaction simulation application built up from OpenFOAM CFD and Elmer CSM coupled through the IMPACT multiphysics software integration infrastructure.
 All Classes Namespaces Files Functions Variables Typedefs Enumerator Macros Groups Pages
virtual int Initialize ( )
inlinevirtual

Initializes native data structures from commandline args.

Definition at line 218 of file Driver.H.

References SerialDriverProgram::input_name, SerialDriverProgram::output_name, and SerialDriverProgram::verblevel.

Referenced by ElmerFoamFSI::ExampleProgram::Driver(), ElmerModuleDriver::ExampleProgram::Driver(), and ElmerFoamFSI::Driver().

219  {
220  int retval = SerialProgramType::Initialize();
221  if(!_command_line.GetOption("help").empty()){
222  std::ostringstream Ostr;
223  Ostr << _command_line.LongUsage() << std::endl;
224  StdOut(Ostr.str());
225  return(-1);
226  }
227  if(retval){
228  std::ostringstream Ostr;
229  Ostr << _command_line.ErrorReport() << std::endl
230  << std::endl << _command_line.ShortUsage() << std::endl;
231  ErrOut(Ostr.str());
232  return(retval);
233  }
234  if(!_command_line.GetOption("debug").empty()){
235  this->SetDebugLevel(2);
236  this->SetDebugStream(std::cout);
237  }
238  // Check if output file is specified
239  output_name = _command_line.GetOption("output");
240 
241  // Set input file to first argument
242  std::vector<std::string> args(_command_line.GetArgs());
243  input_name = args[0];
244 
245  // Check the verbosity level
246  std::string sverb(_command_line.GetOption("verbosity"));
247  if(sverb.empty() || sverb == ".true.")
248  verblevel = 1;
249  else {
250  std::istringstream Vin(sverb);
251  Vin >> verblevel;
252  if(verblevel < 0)
253  verblevel = 1;
254  }
255 
256  //Set the verblevel within IRAD
257  SetVerbLevel((char)verblevel);
258 
259  // If high verbosity, stick a configuration blurb to stdout.
260  if(verblevel > 1){
261  std::ostringstream Ostr;
262  Ostr << "Configuration:" << std::endl
263  << "verbosity = " << verblevel << std::endl
264  << "config file = " << input_name << std::endl;
265  if(!output_name.empty())
266  Ostr << "output file = " << output_name << std::endl;
267  Ostr << std::endl;
268  StdOut(Ostr.str());
269  }
270 
271  return(0);
272  };
std::string input_name
Name of input file.
Definition: Driver.H:169
std::string output_name
Name of file for output.
Definition: Driver.H:167
int verblevel
Verbosity level.
Definition: Driver.H:171

Here is the caller graph for this function: