mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
EclAluGridVanguard: some modernization
- typedef -> using - use constexpr - use nullptr, not 0 - fix some indents
This commit is contained in:
parent
d0c528a240
commit
c2de02a04d
@ -85,7 +85,7 @@ template <class TypeTag>
|
|||||||
class EclAluGridVanguard : public EclBaseVanguard<TypeTag>
|
class EclAluGridVanguard : public EclBaseVanguard<TypeTag>
|
||||||
{
|
{
|
||||||
friend class EclBaseVanguard<TypeTag>;
|
friend class EclBaseVanguard<TypeTag>;
|
||||||
typedef EclBaseVanguard<TypeTag> ParentType;
|
using ParentType = EclBaseVanguard<TypeTag>;
|
||||||
|
|
||||||
using ElementMapper = GetPropType<TypeTag, Properties::ElementMapper>;
|
using ElementMapper = GetPropType<TypeTag, Properties::ElementMapper>;
|
||||||
using Scalar = GetPropType<TypeTag, Properties::Scalar>;
|
using Scalar = GetPropType<TypeTag, Properties::Scalar>;
|
||||||
@ -95,13 +95,13 @@ public:
|
|||||||
using Grid = GetPropType<TypeTag, Properties::Grid>;
|
using Grid = GetPropType<TypeTag, Properties::Grid>;
|
||||||
using EquilGrid = GetPropType<TypeTag, Properties::EquilGrid>;
|
using EquilGrid = GetPropType<TypeTag, Properties::EquilGrid>;
|
||||||
using GridView = GetPropType<TypeTag, Properties::GridView>;
|
using GridView = GetPropType<TypeTag, Properties::GridView>;
|
||||||
typedef Dune::CartesianIndexMapper<Grid> CartesianIndexMapper;
|
using CartesianIndexMapper = Dune::CartesianIndexMapper<Grid>;
|
||||||
typedef Dune::CartesianIndexMapper<EquilGrid> EquilCartesianIndexMapper;
|
using EquilCartesianIndexMapper = Dune::CartesianIndexMapper<EquilGrid>;
|
||||||
using TransmissibilityType = EclTransmissibility<Grid, GridView, ElementMapper, CartesianIndexMapper, Scalar>;
|
using TransmissibilityType = EclTransmissibility<Grid, GridView, ElementMapper, CartesianIndexMapper, Scalar>;
|
||||||
typedef Dune::FromToGridFactory<Grid> Factory;
|
using Factory = Dune::FromToGridFactory<Grid>;
|
||||||
|
|
||||||
static const int dimension = Grid::dimension;
|
static constexpr int dimension = Grid::dimension;
|
||||||
static const int dimensionworld = Grid::dimensionworld;
|
static constexpr int dimensionworld = Grid::dimensionworld;
|
||||||
public:
|
public:
|
||||||
EclAluGridVanguard(Simulator& simulator)
|
EclAluGridVanguard(Simulator& simulator)
|
||||||
: EclBaseVanguard<TypeTag>(simulator)
|
: EclBaseVanguard<TypeTag>(simulator)
|
||||||
@ -146,10 +146,10 @@ public:
|
|||||||
void releaseEquilGrid()
|
void releaseEquilGrid()
|
||||||
{
|
{
|
||||||
delete equilCartesianIndexMapper_;
|
delete equilCartesianIndexMapper_;
|
||||||
equilCartesianIndexMapper_ = 0;
|
equilCartesianIndexMapper_ = nullptr;
|
||||||
|
|
||||||
delete equilGrid_;
|
delete equilGrid_;
|
||||||
equilGrid_ = 0;
|
equilGrid_ = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@ -170,7 +170,7 @@ public:
|
|||||||
|
|
||||||
if (grid().size(0))
|
if (grid().size(0))
|
||||||
{
|
{
|
||||||
globalTrans_.reset(new TransmissibilityType(this->eclState(),
|
globalTrans_ = std::make_unique<TransmissibilityType>(this->eclState(),
|
||||||
this->gridView(),
|
this->gridView(),
|
||||||
this->cartesianIndexMapper(),
|
this->cartesianIndexMapper(),
|
||||||
this->grid(),
|
this->grid(),
|
||||||
@ -178,7 +178,7 @@ public:
|
|||||||
getPropValue<TypeTag,
|
getPropValue<TypeTag,
|
||||||
Properties::EnableEnergy>(),
|
Properties::EnableEnergy>(),
|
||||||
getPropValue<TypeTag,
|
getPropValue<TypeTag,
|
||||||
Properties::EnableDiffusion>()));
|
Properties::EnableDiffusion>());
|
||||||
// Re-ordering for ALUGrid
|
// Re-ordering for ALUGrid
|
||||||
globalTrans_->update(false, [&](unsigned int i) { return gridEquilIdxToGridIdx(i);});
|
globalTrans_->update(false, [&](unsigned int i) { return gridEquilIdxToGridIdx(i);});
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user