mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-01-27 18:46:25 -06:00
ECL problem: move the code which potentially throws into the finishInit() method
this avoids some segfaults due to half constructed objects if an exception is thrown on initialization.
This commit is contained in:
parent
d59f32edc4
commit
6f429d0590
@ -210,7 +210,12 @@ public:
|
||||
*/
|
||||
EclProblem(Simulator &simulator)
|
||||
: ParentType(simulator)
|
||||
{}
|
||||
|
||||
void finishInit()
|
||||
{
|
||||
ParentType::finishInit();
|
||||
|
||||
temperature_ = EWOMS_GET_PARAM(TypeTag, Scalar, Temperature);
|
||||
|
||||
// invert the direction of the gravity vector for ECL problems
|
||||
@ -222,6 +227,7 @@ public:
|
||||
readInitialCondition_();
|
||||
|
||||
// Start the first episode. For this, ask the Eclipse schedule.
|
||||
auto& simulator = this->simulator();
|
||||
Opm::TimeMapConstPtr timeMap = simulator.gridManager().schedule()->getTimeMap();
|
||||
tm curTime = boost::posix_time::to_tm(timeMap->getStartTime(/*timeStepIdx=*/0));
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user