2021-06-08 08:36:56 -05:00
|
|
|
/*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <config.h>
|
|
|
|
|
|
|
|
#include <opm/common/OpmLog/OpmLog.hpp>
|
2021-12-14 01:30:15 -06:00
|
|
|
#include <opm/input/eclipse/Units/Units.hpp>
|
2021-06-08 08:36:56 -05:00
|
|
|
#include <opm/simulators/timestepping/AdaptiveSimulatorTimer.hpp>
|
|
|
|
#include <boost/date_time.hpp>
|
|
|
|
#include <sstream>
|
|
|
|
|
|
|
|
namespace Opm {
|
|
|
|
|
|
|
|
void logTimer(const AdaptiveSimulatorTimer& substepTimer)
|
|
|
|
{
|
|
|
|
std::ostringstream ss;
|
|
|
|
boost::posix_time::time_facet* facet = new boost::posix_time::time_facet("%d-%b-%Y");
|
|
|
|
ss.imbue(std::locale(std::locale::classic(), facet));
|
|
|
|
ss <<"\nStarting time step " << substepTimer.currentStepNum() << ", stepsize "
|
|
|
|
<< unit::convert::to(substepTimer.currentStepLength(), unit::day) << " days,"
|
|
|
|
<< " at day " << (double)unit::convert::to(substepTimer.simulationTimeElapsed(), unit::day)
|
|
|
|
<< "/" << (double)unit::convert::to(substepTimer.totalTime(), unit::day)
|
|
|
|
<< ", date = " << substepTimer.currentDateTime();
|
|
|
|
OpmLog::info(ss.str());
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|