use finishInit() properly for all problems

this means that all code which could potentially throw an exception is
moved to this method(). (In particular FluidSystem::init() proved
troublesome in the past.) Besides avoiding segmentation the faults
which stem from exceptions thrown in constructors, this also has the
advantage that simulations which spend a noticable amount of time to
initialize stop at the "correct" place, i.e. after the "Finish init of
the problem" message was printed by the simulator...
This commit is contained in:
Andreas Lauser
2014-08-06 16:31:48 +02:00
parent 6ff728565b
commit 2922a8e3a0
18 changed files with 138 additions and 10 deletions

View File

@@ -163,11 +163,20 @@ class Tutorial1Problem
enum { contiNonWettingEqIdx = Indices::conti0EqIdx + nonWettingPhaseIdx };
public:
//! The constructor of the problem
//! The constructor of the problem. This only _allocates_ the memory required by the
//! problem. The constructor is supposed to _never ever_ throw an exception.
Tutorial1Problem(Simulator &simulator)
: ParentType(simulator)
, eps_(3e-6)
{ }
//! This method initializes the data structures allocated by the problem
//! constructor. In contrast to the constructor, exceptions thrown from within this
//! method won't lead to segmentation faults.
void finishInit()
{
ParentType::finishInit();
// Use an isotropic and homogeneous intrinsic permeability
K_ = this->toDimMatrix_(1e-7);