Use CpGrid::loadBalance to distribute the field properties.

The created data handle for the communication could in theory be used
with other DUNE grids, too. In reality we will need to merge with the
handle that ALUGrid already uses to communicate the cartesian indices.

This PR gets rid of using the get_global_(double|int) method in
ParallelEclipseState and reduces the amount of boilerplate code there.
This commit is contained in:
Markus Blatt
2020-03-04 12:46:22 +01:00
parent 123a9d4579
commit 77478a59eb
5 changed files with 213 additions and 137 deletions

View File

@@ -20,6 +20,7 @@
#define PARALLEL_ECLIPSE_STATE_HPP
#include <opm/parser/eclipse/EclipseState/EclipseState.hpp>
//#include <opm/simulators/utils/FieldPropsDataHandle.hpp>
#include <dune/common/parallel/mpihelper.hh>
namespace Opm {
@@ -38,6 +39,9 @@ class EclMpiSerializer;
class ParallelFieldPropsManager : public FieldPropsManager {
public:
friend class ParallelEclipseState; //!< Friend so props can be setup.
//! \brief Friend to set up props
template<class Grid>
friend class FieldPropsDataHandle;
//! \brief Constructor.
//! \param manager The field property manager to wrap.
@@ -100,6 +104,9 @@ protected:
*/
class ParallelEclipseState : public EclipseState {
//! \brief Friend to set up props
template<class Grid>
friend class FieldPropsDataHandle;
public:
//! \brief Default constructor.
ParallelEclipseState();
@@ -135,13 +142,6 @@ public:
//! setupLocalProps must be called prior to this.
void switchToDistributedProps();
#if HAVE_MPI
//! \brief Setup local properties.
//! \param localToGlobal Map from local cells on calling process to global cartesian cell
//! \details Must be called after grid has been paritioned
void setupLocalProps(const std::vector<int>& localToGlobal);
#endif
//! \brief Returns a const ref to current field properties.
const FieldPropsManager& fieldProps() const override;