mirror of
https://github.com/OPM/opm-simulators.git
synced 2024-12-27 09:40:59 -06:00
Merge pull request #5247 from bska/expose-fipreg-statistics
Add Procedure for Calculating Basic FIP Region Statistics
This commit is contained in:
commit
5f522cf172
@ -170,6 +170,8 @@ public:
|
||||
}
|
||||
|
||||
this->rank_ = this->simulator_.vanguard().grid().comm().rank();
|
||||
|
||||
this->simulator_.vanguard().eclState().computeFipRegionStatistics();
|
||||
}
|
||||
|
||||
~EclWriter()
|
||||
|
@ -20,13 +20,18 @@
|
||||
#include <config.h>
|
||||
#include <opm/simulators/utils/ParallelEclipseState.hpp>
|
||||
|
||||
#include <opm/input/eclipse/EclipseState/Grid/FIPRegionStatistics.hpp>
|
||||
#include <opm/input/eclipse/EclipseState/Grid/FieldData.hpp>
|
||||
#include <opm/input/eclipse/EclipseState/Runspec.hpp>
|
||||
|
||||
#include <opm/common/ErrorMacros.hpp>
|
||||
|
||||
#include <cstddef>
|
||||
#include <map>
|
||||
#include <regex>
|
||||
#include <stdexcept>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
namespace {
|
||||
bool is_FIP(const std::string& keyword)
|
||||
@ -280,6 +285,20 @@ const FieldPropsManager& ParallelEclipseState::globalFieldProps() const
|
||||
}
|
||||
|
||||
|
||||
void ParallelEclipseState::computeFipRegionStatistics()
|
||||
{
|
||||
if (! this->fipRegionStatistics_.has_value()) {
|
||||
this->fipRegionStatistics_
|
||||
.emplace(declaredMaxRegionID(this->runspec()),
|
||||
this->fieldProps(),
|
||||
[this](std::vector<int>& maxRegionID)
|
||||
{
|
||||
this->m_comm.max(maxRegionID.data(), maxRegionID.size());
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
const EclipseGrid& ParallelEclipseState::getInputGrid() const
|
||||
{
|
||||
if (m_comm.rank() != 0)
|
||||
|
@ -179,6 +179,12 @@ public:
|
||||
//! \details Can only be called on root process.
|
||||
const FieldPropsManager& globalFieldProps() const override;
|
||||
|
||||
//! \brief Compute basic descriptive statistics about all FIP region sets
|
||||
//!
|
||||
//! MPI-aware version which knows how to compute statistics across all
|
||||
//! ranks.
|
||||
void computeFipRegionStatistics() override;
|
||||
|
||||
//! \brief Returns a const ref to the eclipse grid.
|
||||
//! \details Can only be called on root process.
|
||||
const EclipseGrid& getInputGrid() const override;
|
||||
|
Loading…
Reference in New Issue
Block a user