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
int ElmerFoamFSI::ExampleProgram::Driver ( int  argc,
char *  argv[] 
)

Unified driver for the example programs.

This driver is exactly the same for both the serial and parallel example programs. It is a direct replacement for main and is responsible for creating the "Program object" and calling its Initialization, Run, and Finalize methods.

Definition at line 444 of file include/ExampleProgram.H.

References SerialDriverProgram::Initialize(), and SerialDriverProgram::VerbLevel().

445  {
446  ProgramType MyProgram(argc,argv);
447  int retval = MyProgram.Initialize();
448  if(retval){
449  if(retval > 0){ // then there was an error
450  MyProgram.ErrOut("Error in Program Initialization.\n");
451  return(1);
452  }
453  else return(0); // no error, but the program should not continue
454  }
455  if(MyProgram.VerbLevel() > 1)
456  MyProgram.StdOut("Calling RUN.\n");
457  if(MyProgram.Run()){
458  MyProgram.ErrOut("Error in Program RUN method.\n");
459  return(1);
460  }
461  if(MyProgram.VerbLevel() > 1){
462  std::ostringstream Ostr;
463  MyProgram.Report(Ostr);
464  MyProgram.StdOut(Ostr.str());
465  MyProgram.StdOut("Calling Finalize.\n");
466  }
467  if(MyProgram.Finalize()){
468  MyProgram.ErrOut("Error in Program Finalization.\n");
469  return(1);
470  }
471  if(MyProgram.VerbLevel() > 1)
472  MyProgram.StdOut("All done.\n");
473  return(0);
474  }
Implementation of the basic parts of the serial program example.
Definition: Driver.H:163

Here is the call graph for this function: