CSCRestart.cpp File Reference
#include "Mercury3D.h"
#include <sys/time.h>

Classes

class  CSCRestart
 

Functions

double get_wall_time ()
 
int main (int argc, char *argv[])
 

Function Documentation

◆ get_wall_time()

double get_wall_time ( )
29  {
30  struct timeval time;
31  if (gettimeofday(&time,NULL)){
32  // Handle error
33  return 0;
34  }
35  return (double)time.tv_sec + (double)time.tv_usec * .000001;
36 }

Referenced by CSCRestart::CSCRestart(), CSCRestart::printTime(), and CSCRestart::writeOutputFiles().

◆ main()

int main ( int argc  ,
char argv[] 
)
82  {
83  CSCRestart SC;
84  SC.setTimeMax(2000);
85  SC.solve(argc, argv);
86  if (SC.getTimeMax()<2000)
87  SC.restart();
88  return 0;
89 }
Definition: CSCRestart.cpp:38
void restart()
Definition: CSCRestart.cpp:71
void setTimeMax(Mdouble newTMax)
Sets a new value for the maximum simulation duration.
Definition: DPMBase.cc:873
void solve()
The work horse of the code.
Definition: DPMBase.cc:4270
Mdouble getTimeMax() const
Returns the maximum simulation duration.
Definition: DPMBase.cc:888

References DPMBase::getTimeMax(), CSCRestart::restart(), DPMBase::setTimeMax(), and DPMBase::solve().