mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-11 22:05:34 -06:00
Merge pull request #2036 from blattms/improve-vanguard-layering-violation
Make sure subclass functions are not called before subclass is initia…
This commit is contained in:
commit
2b9e30df33
@ -81,10 +81,11 @@ private:
|
||||
static const int dimension = Grid::dimension;
|
||||
|
||||
public:
|
||||
/*!
|
||||
* \brief Inherit the constructors from the base class.
|
||||
*/
|
||||
using EclBaseVanguard<TypeTag>::EclBaseVanguard;
|
||||
EclAluGridVanguard(Simulator& simulator)
|
||||
: EclBaseVanguard<TypeTag>(simulator)
|
||||
{
|
||||
this->callImplementationInit();
|
||||
}
|
||||
|
||||
~EclAluGridVanguard()
|
||||
{
|
||||
|
@ -373,16 +373,6 @@ public:
|
||||
int outputInterval = EWOMS_GET_PARAM(TypeTag, int, EclOutputInterval);
|
||||
if (outputInterval >= 0)
|
||||
eclState_->getRestartConfig().overrideRestartWriteInterval(outputInterval);
|
||||
|
||||
asImp_().createGrids_();
|
||||
asImp_().filterConnections_();
|
||||
asImp_().updateOutputDir_();
|
||||
asImp_().finalizeInit_();
|
||||
|
||||
if (enableExperiments) {
|
||||
Opm::RelpermDiagnostics relpermDiagnostics;
|
||||
relpermDiagnostics.diagnosis(*eclState_, *deck_, asImp_().grid());
|
||||
}
|
||||
}
|
||||
|
||||
/*!
|
||||
@ -538,6 +528,19 @@ public:
|
||||
std::unordered_set<std::string> defunctWellNames() const
|
||||
{ return std::unordered_set<std::string>(); }
|
||||
|
||||
protected:
|
||||
void callImplementationInit()
|
||||
{
|
||||
asImp_().createGrids_();
|
||||
asImp_().filterConnections_();
|
||||
asImp_().updateOutputDir_();
|
||||
asImp_().finalizeInit_();
|
||||
|
||||
if (enableExperiments) {
|
||||
Opm::RelpermDiagnostics relpermDiagnostics;
|
||||
relpermDiagnostics.diagnosis(*eclState_, *deck_, asImp_().grid());
|
||||
}
|
||||
}
|
||||
private:
|
||||
void updateOutputDir_()
|
||||
{
|
||||
|
@ -70,6 +70,7 @@ class EclCpGridVanguard : public EclBaseVanguard<TypeTag>
|
||||
typedef EclBaseVanguard<TypeTag> ParentType;
|
||||
|
||||
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
|
||||
typedef typename GET_PROP_TYPE(TypeTag, Simulator) Simulator;
|
||||
typedef typename GET_PROP_TYPE(TypeTag, ElementMapper) ElementMapper;
|
||||
|
||||
public:
|
||||
@ -81,10 +82,11 @@ private:
|
||||
typedef Dune::CartesianIndexMapper<Grid> CartesianIndexMapper;
|
||||
|
||||
public:
|
||||
/*!
|
||||
* \brief Inherit the constructors from the base class.
|
||||
*/
|
||||
using EclBaseVanguard<TypeTag>::EclBaseVanguard;
|
||||
EclCpGridVanguard(Simulator& simulator)
|
||||
: EclBaseVanguard<TypeTag>(simulator)
|
||||
{
|
||||
this->callImplementationInit();
|
||||
}
|
||||
|
||||
~EclCpGridVanguard()
|
||||
{
|
||||
|
@ -77,10 +77,11 @@ private:
|
||||
typedef CartesianIndexMapper* CartesianIndexMapperPointer;
|
||||
|
||||
public:
|
||||
/*!
|
||||
* \brief Inherit the constructors from the base class.
|
||||
*/
|
||||
using EclBaseVanguard<TypeTag>::EclBaseVanguard;
|
||||
EclPolyhedralGridVanguard(Simulator& simulator)
|
||||
: EclBaseVanguard<TypeTag>(simulator)
|
||||
{
|
||||
this->callImplementationInit();
|
||||
}
|
||||
|
||||
~EclPolyhedralGridVanguard()
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user