27#ifndef OPM_GENERIC_CPGRID_VANGUARD_HPP
28#define OPM_GENERIC_CPGRID_VANGUARD_HPP
30#include <opm/grid/CpGrid.hpp>
31#include <opm/grid/cpgrid/LevelCartesianIndexMapper.hpp>
48 class ParallelEclipseState;
59 explicit MPIPartitionFromFile(
const std::filesystem::path& partitionFile)
60 : partitionFile_(partitionFile)
63 std::vector<int> operator()(
const Dune::CpGrid& grid)
const;
66 std::filesystem::path partitionFile_{};
78template<
class ElementMapper,
class Gr
idView,
class Scalar>
83 using Element =
typename GridView::template Codim<0>::Entity;
99 const Dune::CpGrid&
grid()
const
147 const std::vector<int>& cellPartition()
const
149 return this->cell_part_;
159 void doLoadBalance_(
const Dune::EdgeWeightMethod edgeWeightsMethod,
160 const bool ownersFirst,
165 const bool enableDistributedWells,
168 const GridView& gridView,
170 EclipseState& eclState,
171 FlowGenericVanguard::ParallelWellStruct& parallelWells,
172 const int numJacobiBlocks,
173 const bool enableEclOutput);
180 void distributeGrid(
const Dune::EdgeWeightMethod edgeWeightsMethod,
181 const bool ownersFirst,
186 const bool enableDistributedWells,
190 const std::vector<Well>& wells,
192 EclipseState& eclState,
193 FlowGenericVanguard::ParallelWellStruct& parallelWells);
195 void distributeGrid(
const Dune::EdgeWeightMethod edgeWeightsMethod,
196 const bool ownersFirst,
201 const bool enableDistributedWells,
205 const std::vector<Well>& wells,
207 ParallelEclipseState* eclState,
208 FlowGenericVanguard::ParallelWellStruct& parallelWells);
213 virtual const std::string&
metisParams()
const = 0;
219 void doCreateGrids_(EclipseState& eclState);
224 virtual void allocTrans() = 0;
225 virtual double getTransmissibility(
unsigned I,
unsigned J)
const = 0;
228 void doFilterConnections_(
Schedule& schedule);
230 Scalar computeCellThickness(
const Element& element)
const;
232 std::unique_ptr<Dune::CpGrid> grid_;
233 std::unique_ptr<Dune::CpGrid> equilGrid_;
234 std::unique_ptr<CartesianIndexMapper> cartesianIndexMapper_;
235 std::unique_ptr<CartesianIndexMapper> equilCartesianIndexMapper_;
238 std::vector<int> cell_part_{};
Helper class for grid instantiation of ECL file-format using problems.
Definition CollectDataOnIORank.hpp:49
Definition GenericCpGridVanguard.hpp:79
void releaseEquilGrid()
Indicates that the initial condition has been computed and the memory used by the EQUIL grid can be r...
Definition GenericCpGridVanguard.cpp:136
const Dune::CpGrid & equilGrid() const
Returns a refefence to the grid which should be used by the EQUIL initialization code.
Definition GenericCpGridVanguard.cpp:615
const CartesianIndexMapper & cartesianIndexMapper() const
Returns the object which maps a global element index of the simulation grid to the corresponding elem...
Definition GenericCpGridVanguard.cpp:623
const CartesianIndexMapper & equilCartesianIndexMapper() const
Returns mapper from compressed to cartesian indices for the EQUIL grid.
Definition GenericCpGridVanguard.cpp:637
const Dune::CpGrid & grid() const
Return a reference to the simulation grid.
Definition GenericCpGridVanguard.hpp:99
static void setExternalLoadBalancer(const std::function< std::vector< int >(const Dune::CpGrid &)> &loadBalancer)
Sets a function that returns external load balancing information when passed the grid.
Definition GenericCpGridVanguard.hpp:125
Dune::CpGrid & grid()
Return a reference to the simulation grid.
Definition GenericCpGridVanguard.hpp:93
void allocCartMapper()
Distribute the simulation grid over multiple processes.
const LevelCartesianIndexMapper levelCartesianIndexMapper() const
Returns the object which maps a global element index of the simulation grid to the corresponding elem...
Definition GenericCpGridVanguard.cpp:630
Definition RelpermDiagnostics.hpp:31
This file contains a set of helper functions used by VFPProd / VFPInj.
Definition blackoilboundaryratevector.hh:37
std::optional< std::function< std::vector< int >(const Dune::CpGrid &)> > externalLoadBalancer
optional functor returning external load balancing information
Definition GenericCpGridVanguard.cpp:123
constexpr auto getPropValue()
get the value data member of a property
Definition propertysystem.hh:242