AdaptiveTimeSteppingEbos: avoid boost include in header

This commit is contained in:
Arne Morten Kvarving 2021-06-08 15:36:56 +02:00
parent 30d4cbc2f2
commit fce3247c56
3 changed files with 31 additions and 12 deletions

View File

@ -46,8 +46,9 @@ list (APPEND MAIN_SOURCE_FILES
opm/simulators/utils/PartiallySupportedFlowKeywords.cpp
opm/simulators/utils/readDeck.cpp
opm/simulators/utils/UnsupportedFlowKeywords.cpp
opm/simulators/timestepping/TimeStepControl.cpp
opm/simulators/timestepping/AdaptiveSimulatorTimer.cpp
opm/simulators/timestepping/AdaptiveTimeSteppingEbos.cpp
opm/simulators/timestepping/TimeStepControl.cpp
opm/simulators/timestepping/SimulatorTimer.cpp
opm/simulators/timestepping/gatherConvergenceReport.cpp
opm/simulators/utils/DeferredLogger.cpp

View File

@ -0,0 +1,27 @@
/*
*/
#include <config.h>
#include <opm/common/OpmLog/OpmLog.hpp>
#include <opm/parser/eclipse/Units/Units.hpp>
#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());
}
}

View File

@ -18,8 +18,6 @@
#include <opm/core/props/phaseUsageFromDeck.hpp>
#include <opm/common/Exceptions.hpp>
#include <boost/date_time.hpp>
namespace Opm::Properties {
namespace TTag {
@ -224,6 +222,7 @@ struct MinTimeStepBasedOnNewtonIterations<TypeTag, TTag::FlowTimeSteppingParamet
namespace Opm {
// AdaptiveTimeStepping
//---------------------
void logTimer(const AdaptiveSimulatorTimer& substepTimer);
template<class TypeTag>
class AdaptiveTimeSteppingEbos
@ -391,15 +390,7 @@ namespace Opm {
// get current delta t
const double dt = substepTimer.currentStepLength() ;
if (timestepVerbose_) {
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());
logTimer(substepTimer);
}
SimulatorReportSingle substepReport;