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 187 of file include/ExampleProgram.H.

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

188  {
189  int retval = SerialProgramType::Initialize();
190  if(!_command_line.GetOption("help").empty()){
191  std::ostringstream Ostr;
192  Ostr << _command_line.LongUsage() << std::endl;
193  StdOut(Ostr.str());
194  return(-1);
195  }
196  if(retval){
197  std::ostringstream Ostr;
198  Ostr << _command_line.ErrorReport() << std::endl
199  << std::endl << _command_line.ShortUsage() << std::endl;
200  ErrOut(Ostr.str());
201  return(retval);
202  }
203 
204  // Check if output file is specified
205  output_name = _command_line.GetOption("output");
206 
207  // Set input file to first argument
208  std::vector<std::string> args(_command_line.GetArgs());
209  input_name = args[0];
210 
211  // Check the verbosity level
212  std::string sverb(_command_line.GetOption("verbosity"));
213  if(sverb.empty() || sverb == ".true.")
214  verblevel = 1;
215  else {
216  std::istringstream Vin(sverb);
217  Vin >> verblevel;
218  if(verblevel < 0)
219  verblevel = 1;
220  }
221 
222  // If high verbosity, stick a configuration blurb to stdout.
223  if(verblevel > 1){
224  std::ostringstream Ostr;
225  Ostr << "Configuration:" << std::endl
226  << "verbosity = " << verblevel << std::endl
227  << "input_name = " << input_name << std::endl;
228  if(!output_name.empty())
229  Ostr << "output file = " << output_name << std::endl;
230  Ostr << std::endl;
231  StdOut(Ostr.str());
232  }
233 
234  return(0);
235  };
std::string output_name
Name of file for output.