mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
flow_ebos: only instantiate the grid once
it now uses the grid object which gets created by ebos for everything which should make the parallelization efforts easier. I also tried to cut back the use of the legacy property objects (i.e., for the fluid, geologic and rock properties), but this effort ran aground because of the initialization and output code. (also, if those two were fixed, there would probably be issues with the Newton update.) I ran Norne with this and there did not seem to be any notable performance regressions or benefits.
This commit is contained in:
committed by
Robert Kloefkorn
parent
28c36ef949
commit
5ebed2f500
@@ -73,18 +73,42 @@ namespace Opm
|
||||
class GridInit<Dune::CpGrid>
|
||||
{
|
||||
public:
|
||||
GridInit()
|
||||
{
|
||||
gridSelfManaged_ = false;
|
||||
}
|
||||
|
||||
/// Initialize from a deck and/or an eclipse state and (logical cartesian) specified pore volumes.
|
||||
GridInit(const EclipseState& eclipse_state, const std::vector<double>& porv)
|
||||
{
|
||||
grid_.processEclipseFormat(eclipse_state.getInputGrid(), false, false, false, porv);
|
||||
gridSelfManaged_ = true;
|
||||
|
||||
grid_ = new Dune::CpGrid;
|
||||
grid_->processEclipseFormat(eclipse_state.getInputGrid(), false, false, false, porv);
|
||||
}
|
||||
|
||||
~GridInit()
|
||||
{
|
||||
if (gridSelfManaged_)
|
||||
delete grid_;
|
||||
}
|
||||
|
||||
/// Access the created grid. Note that mutable access may be required for load balancing.
|
||||
Dune::CpGrid& grid()
|
||||
{
|
||||
return grid_;
|
||||
return *grid_;
|
||||
}
|
||||
|
||||
/// set the grid from the outside
|
||||
void setGrid(Dune::CpGrid& newGrid)
|
||||
{
|
||||
gridSelfManaged_ = false;
|
||||
grid_ = &newGrid;
|
||||
}
|
||||
|
||||
private:
|
||||
Dune::CpGrid grid_;
|
||||
Dune::CpGrid* grid_;
|
||||
bool gridSelfManaged_;
|
||||
};
|
||||
#endif // HAVE_OPM_GRID
|
||||
|
||||
|
||||
Reference in New Issue
Block a user