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::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 529 of file Driver.H.

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

530  {
531  ProgramType MyProgram(argc,argv);
532  int retval = MyProgram.Initialize();
533  if(retval){
534  if(retval > 0){ // then there was an error
535  MyProgram.ErrOut("Error in Program Initialization.\n");
536  return(1);
537  }
538  else return(0); // no error, but the program should not continue
539  }
540  if(MyProgram.VerbLevel() > 1)
541  MyProgram.StdOut("Calling RUN.\n");
542  if(MyProgram.DriverRun()){
543  MyProgram.ErrOut("Error in Program RUN method.\n");
544  return(1);
545  }
546  if(MyProgram.VerbLevel() > 1){
547  std::ostringstream Ostr;
548  MyProgram.Report(Ostr);
549  MyProgram.StdOut(Ostr.str());
550  MyProgram.StdOut("Calling Finalize.\n");
551  }
552  if(MyProgram.Finalize()){
553  MyProgram.ErrOut("Error in Program Finalization.\n");
554  return(1);
555  }
556  if(MyProgram.VerbLevel() > 1)
557  MyProgram.StdOut("All done.\n");
558  return(0);
559  }
Implementation of the basic parts of the serial program example.
Definition: Driver.H:163

Here is the call graph for this function: