mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
EclProblem: use of alugrid is known at compile time
use the proper define, no need for type gymnastics
This commit is contained in:
parent
73b6c9fdf8
commit
4bbb9656b0
@ -888,15 +888,11 @@ public:
|
|||||||
|
|
||||||
// Re-ordering in case of ALUGrid
|
// Re-ordering in case of ALUGrid
|
||||||
std::function<unsigned int(unsigned int)> gridToEquilGrid;
|
std::function<unsigned int(unsigned int)> gridToEquilGrid;
|
||||||
#ifdef HAVE_DUNE_ALUGRID
|
#if USE_ALUGRID
|
||||||
using Grid = GetPropType<TypeTag, Properties::Grid>;
|
gridToEquilGrid = [&simulator](unsigned int i) {
|
||||||
typename std::is_same<Grid, Dune::ALUGrid<3, 3, Dune::cube, Dune::nonconforming>>::type isAlugrid;
|
return simulator.vanguard().gridIdxToEquilGridIdx(i);
|
||||||
if constexpr (isAlugrid) {
|
};
|
||||||
gridToEquilGrid = [&simulator](unsigned int i) {
|
#endif // USE_ALUGRID
|
||||||
return simulator.vanguard().gridIdxToEquilGridIdx(i);
|
|
||||||
};
|
|
||||||
}
|
|
||||||
#endif // HAVE_DUNE_ALUGRID
|
|
||||||
transmissibilities_.finishInit(gridToEquilGrid);
|
transmissibilities_.finishInit(gridToEquilGrid);
|
||||||
|
|
||||||
const auto& initconfig = eclState.getInitConfig();
|
const auto& initconfig = eclState.getInitConfig();
|
||||||
@ -973,13 +969,11 @@ public:
|
|||||||
|
|
||||||
// Re-ordering in case of ALUGrid
|
// Re-ordering in case of ALUGrid
|
||||||
std::function<unsigned int(unsigned int)> equilGridToGrid;
|
std::function<unsigned int(unsigned int)> equilGridToGrid;
|
||||||
#ifdef HAVE_DUNE_ALUGRID
|
#if USE_ALUGRID
|
||||||
if (isAlugrid) {
|
equilGridToGrid = [&simulator](unsigned int i) {
|
||||||
equilGridToGrid = [&simulator](unsigned int i) {
|
return simulator.vanguard().gridEquilIdxToGridIdx(i);
|
||||||
return simulator.vanguard().gridEquilIdxToGridIdx(i);
|
};
|
||||||
};
|
#endif // USE_ALUGRID
|
||||||
}
|
|
||||||
#endif // HAVE_DUNE_ALUGRID
|
|
||||||
eclWriter_->writeInit(equilGridToGrid);
|
eclWriter_->writeInit(equilGridToGrid);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1068,16 +1062,11 @@ public:
|
|||||||
|
|
||||||
// Re-ordering in case of ALUGrid
|
// Re-ordering in case of ALUGrid
|
||||||
std::function<unsigned int(unsigned int)> equilGridToGrid;
|
std::function<unsigned int(unsigned int)> equilGridToGrid;
|
||||||
#ifdef HAVE_DUNE_ALUGRID
|
#if USE_ALUGRID
|
||||||
using Grid = GetPropType<TypeTag, Properties::Grid>;
|
equilGridToGrid = [&simulator](unsigned int i) {
|
||||||
typename std::is_same<Grid, Dune::ALUGrid<3, 3, Dune::cube,
|
return simulator.vanguard().gridEquilIdxToGridIdx(i);
|
||||||
Dune::nonconforming>>::type isAlugrid;
|
};
|
||||||
if constexpr (isAlugrid) {
|
#endif // USE_ALUGRID
|
||||||
equilGridToGrid = [&simulator](unsigned int i) {
|
|
||||||
return simulator.vanguard().gridEquilIdxToGridIdx(i);
|
|
||||||
};
|
|
||||||
}
|
|
||||||
#endif // HAVE_DUNE_ALUGRID
|
|
||||||
|
|
||||||
// re-compute all quantities which may possibly be affected.
|
// re-compute all quantities which may possibly be affected.
|
||||||
transmissibilities_.update(true, equilGridToGrid);
|
transmissibilities_.update(true, equilGridToGrid);
|
||||||
@ -1219,15 +1208,11 @@ public:
|
|||||||
|
|
||||||
// Re-ordering in case of Alugrid
|
// Re-ordering in case of Alugrid
|
||||||
std::function<unsigned int(unsigned int)> gridToEquilGrid;
|
std::function<unsigned int(unsigned int)> gridToEquilGrid;
|
||||||
#ifdef HAVE_DUNE_ALUGRID
|
#if USE_ALUGRID
|
||||||
using Grid = GetPropType<TypeTag, Properties::Grid>;
|
gridToEquilGrid = [&simulator](unsigned int i) {
|
||||||
typename std::is_same<Grid, Dune::ALUGrid<3, 3, Dune::cube, Dune::nonconforming>>::type isAlugrid;
|
return simulator.vanguard().gridIdxToEquilGridIdx(i);
|
||||||
if constexpr (isAlugrid) {
|
};
|
||||||
gridToEquilGrid = [&simulator](unsigned int i) {
|
#endif // USE_ALUGRID
|
||||||
return simulator.vanguard().gridIdxToEquilGridIdx(i);
|
|
||||||
};
|
|
||||||
}
|
|
||||||
#endif // HAVE_DUNE_ALUGRID
|
|
||||||
|
|
||||||
std::function<void(bool)> transUp =
|
std::function<void(bool)> transUp =
|
||||||
[this,gridToEquilGrid](bool global) {
|
[this,gridToEquilGrid](bool global) {
|
||||||
|
Loading…
Reference in New Issue
Block a user