mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
move ebos/eclgenericvanguard.[hh|cc] to opm/simulators/flow
This commit is contained in:
parent
6949abbf0d
commit
1362143e48
@ -24,7 +24,6 @@
|
||||
# find opm -name '*.c*' -printf '\t%p\n' | sort
|
||||
list (APPEND MAIN_SOURCE_FILES
|
||||
ebos/eclgenericproblem.cc
|
||||
ebos/eclgenericvanguard.cc
|
||||
ebos/ecltransmissibility.cc
|
||||
opm/core/props/BlackoilPhases.cpp
|
||||
opm/core/props/phaseUsageFromDeck.cpp
|
||||
@ -36,6 +35,7 @@ list (APPEND MAIN_SOURCE_FILES
|
||||
opm/simulators/flow/ConvergenceOutputConfiguration.cpp
|
||||
opm/simulators/flow/EclGenericWriter.cpp
|
||||
opm/simulators/flow/ExtraConvergenceOutputThread.cpp
|
||||
opm/simulators/flow/FlowGenericVanguard.cpp
|
||||
opm/simulators/flow/FlowUtils.cpp
|
||||
opm/simulators/flow/GenericCpGridVanguard.cpp
|
||||
opm/simulators/flow/GenericOutputBlackoilModule.cpp
|
||||
@ -409,10 +409,8 @@ list (APPEND TEST_DATA_FILES
|
||||
# originally generated with the command:
|
||||
# find opm -name '*.h*' -a ! -name '*-pch.hpp' -printf '\t%p\n' | sort
|
||||
list (APPEND PUBLIC_HEADER_FILES
|
||||
ebos/ebos.hh
|
||||
ebos/eclgenericproblem.hh
|
||||
ebos/eclgenericproblem_impl.hh
|
||||
ebos/eclgenericvanguard.hh
|
||||
ebos/eclnewtonmethod.hh
|
||||
ebos/eclproblem.hh
|
||||
ebos/eclproblem_properties.hh
|
||||
@ -440,6 +438,7 @@ list (APPEND PUBLIC_HEADER_FILES
|
||||
opm/simulators/flow/FemCpGridCompat.hpp
|
||||
opm/simulators/flow/FIBlackoilModel.hpp
|
||||
opm/simulators/flow/FlowBaseVanguard.hpp
|
||||
opm/simulators/flow/FlowGenericVanguard.hpp
|
||||
opm/simulators/flow/FlowMain.hpp
|
||||
opm/simulators/flow/FlowUtils.hpp
|
||||
opm/simulators/flow/FlowsData.hpp
|
||||
|
@ -116,8 +116,8 @@ public:
|
||||
|
||||
AluGridVanguard(Simulator& simulator)
|
||||
: FlowBaseVanguard<TypeTag>(simulator)
|
||||
{
|
||||
this->mpiRank = EclGenericVanguard::comm().rank();
|
||||
{
|
||||
this->mpiRank = FlowGenericVanguard::comm().rank();
|
||||
this->callImplementationInit();
|
||||
}
|
||||
|
||||
@ -305,7 +305,7 @@ protected:
|
||||
}
|
||||
|
||||
#if HAVE_MPI
|
||||
this->equilGrid_ = std::make_unique<Dune::CpGrid>(EclGenericVanguard::comm());
|
||||
this->equilGrid_ = std::make_unique<Dune::CpGrid>(FlowGenericVanguard::comm());
|
||||
#else
|
||||
this->equilGrid_ = std::make_unique<Dune::CpGrid>();
|
||||
#endif
|
||||
|
@ -27,11 +27,10 @@
|
||||
#ifndef OPM_FLOW_BASE_VANGUARD_HPP
|
||||
#define OPM_FLOW_BASE_VANGUARD_HPP
|
||||
|
||||
#include <ebos/eclgenericvanguard.hh>
|
||||
|
||||
#include <opm/grid/common/GridEnums.hpp>
|
||||
#include <opm/grid/common/CartesianIndexMapper.hpp>
|
||||
#include <opm/grid/LookUpCellCentroid.hh>
|
||||
|
||||
#include <opm/input/eclipse/EclipseState/Aquifer/NumericalAquifer/NumericalAquiferCell.hpp>
|
||||
#include <opm/input/eclipse/EclipseState/EclipseState.hpp>
|
||||
|
||||
@ -41,6 +40,7 @@
|
||||
#include <opm/models/utils/propertysystem.hh>
|
||||
|
||||
#include <opm/simulators/flow/BlackoilModelParameters.hpp>
|
||||
#include <opm/simulators/flow/FlowGenericVanguard.hpp>
|
||||
|
||||
#include <array>
|
||||
#include <cstddef>
|
||||
@ -212,7 +212,7 @@ namespace Opm {
|
||||
*/
|
||||
template <class TypeTag>
|
||||
class FlowBaseVanguard : public BaseVanguard<TypeTag>,
|
||||
public EclGenericVanguard
|
||||
public FlowGenericVanguard
|
||||
{
|
||||
using ParentType = BaseVanguard<TypeTag>;
|
||||
using Implementation = GetPropType<TypeTag, Properties::Vanguard>;
|
||||
@ -324,7 +324,6 @@ public:
|
||||
init();
|
||||
}
|
||||
|
||||
|
||||
const CartesianIndexMapper& cartesianMapper() const
|
||||
{ return asImp_().cartesianIndexMapper(); }
|
||||
|
||||
|
@ -22,7 +22,7 @@
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
#include <ebos/eclgenericvanguard.hh>
|
||||
#include <opm/simulators/flow//FlowGenericVanguard.hpp>
|
||||
|
||||
#include <opm/common/utility/MemPacker.hpp>
|
||||
#include <opm/common/utility/Serializer.hpp>
|
||||
@ -84,21 +84,21 @@
|
||||
|
||||
namespace Opm {
|
||||
|
||||
std::unique_ptr<Parallel::Communication> EclGenericVanguard::comm_;
|
||||
EclGenericVanguard::SimulationModelParams EclGenericVanguard::modelParams_;
|
||||
std::unique_ptr<Parallel::Communication> FlowGenericVanguard::comm_;
|
||||
FlowGenericVanguard::SimulationModelParams FlowGenericVanguard::modelParams_;
|
||||
|
||||
EclGenericVanguard::EclGenericVanguard()
|
||||
: EclGenericVanguard(std::move(modelParams_))
|
||||
FlowGenericVanguard::FlowGenericVanguard()
|
||||
: FlowGenericVanguard(std::move(modelParams_))
|
||||
{}
|
||||
|
||||
EclGenericVanguard::EclGenericVanguard(SimulationModelParams&& params)
|
||||
FlowGenericVanguard::FlowGenericVanguard(SimulationModelParams&& params)
|
||||
: python(std::make_shared<Python>())
|
||||
{
|
||||
defineSimulationModel(std::move(params));
|
||||
}
|
||||
|
||||
EclGenericVanguard::SimulationModelParams
|
||||
EclGenericVanguard::serializationTestParams()
|
||||
FlowGenericVanguard::SimulationModelParams
|
||||
FlowGenericVanguard::serializationTestParams()
|
||||
{
|
||||
SimulationModelParams result;
|
||||
result.actionState_ = std::make_unique<Action::State>(Action::State::serializationTestObject());
|
||||
@ -109,9 +109,9 @@ EclGenericVanguard::serializationTestParams()
|
||||
return result;
|
||||
}
|
||||
|
||||
EclGenericVanguard::~EclGenericVanguard() = default;
|
||||
FlowGenericVanguard::~FlowGenericVanguard() = default;
|
||||
|
||||
void EclGenericVanguard::defineSimulationModel(SimulationModelParams&& params)
|
||||
void FlowGenericVanguard::defineSimulationModel(SimulationModelParams&& params)
|
||||
{
|
||||
actionState_ = std::move(params.actionState_);
|
||||
eclSchedule_ = std::move(params.eclSchedule_);
|
||||
@ -123,7 +123,7 @@ void EclGenericVanguard::defineSimulationModel(SimulationModelParams&& params)
|
||||
summaryState_ = std::move(params.summaryState_);
|
||||
}
|
||||
|
||||
void EclGenericVanguard::readDeck(const std::string& filename)
|
||||
void FlowGenericVanguard::readDeck(const std::string& filename)
|
||||
{
|
||||
Dune::Timer setupTimer;
|
||||
setupTimer.start();
|
||||
@ -140,7 +140,7 @@ void EclGenericVanguard::readDeck(const std::string& filename)
|
||||
modelParams_.setupTime_ = setupTimer.stop();
|
||||
}
|
||||
|
||||
std::string EclGenericVanguard::canonicalDeckPath(const std::string& caseName)
|
||||
std::string FlowGenericVanguard::canonicalDeckPath(const std::string& caseName)
|
||||
{
|
||||
const auto fileExists = [](const std::filesystem::path& f) -> bool
|
||||
{
|
||||
@ -165,8 +165,8 @@ std::string EclGenericVanguard::canonicalDeckPath(const std::string& caseName)
|
||||
throw std::invalid_argument("Cannot find input case '"+caseName+"'");
|
||||
}
|
||||
|
||||
void EclGenericVanguard::updateOutputDir_(std::string outputDir,
|
||||
bool enableEclCompatFile)
|
||||
void FlowGenericVanguard::updateOutputDir_(std::string outputDir,
|
||||
bool enableEclCompatFile)
|
||||
{
|
||||
// update the location for output
|
||||
auto& ioConfig = eclState_->getIOConfig();
|
||||
@ -193,7 +193,7 @@ void EclGenericVanguard::updateOutputDir_(std::string outputDir,
|
||||
ioConfig.setEclCompatibleRST(enableEclCompatFile);
|
||||
}
|
||||
|
||||
void EclGenericVanguard::init()
|
||||
void FlowGenericVanguard::init()
|
||||
{
|
||||
// Make proper case name.
|
||||
{
|
||||
@ -228,7 +228,7 @@ void EclGenericVanguard::init()
|
||||
|
||||
// set communicator if not set as in opm flow
|
||||
if(!comm_){
|
||||
EclGenericVanguard::setCommunication(std::make_unique<Parallel::Communication>());
|
||||
FlowGenericVanguard::setCommunication(std::make_unique<Parallel::Communication>());
|
||||
}
|
||||
|
||||
// set eclState if not already set as in opm flow
|
||||
@ -256,7 +256,7 @@ void EclGenericVanguard::init()
|
||||
if (enableDistributedWells() )
|
||||
{
|
||||
int hasMsWell = false;
|
||||
const auto& comm = EclGenericVanguard::comm();
|
||||
const auto& comm = FlowGenericVanguard::comm();
|
||||
|
||||
if (useMultisegmentWell_)
|
||||
{
|
||||
@ -289,7 +289,7 @@ void EclGenericVanguard::init()
|
||||
}
|
||||
}
|
||||
|
||||
bool EclGenericVanguard::drsdtconEnabled() const
|
||||
bool FlowGenericVanguard::drsdtconEnabled() const
|
||||
{
|
||||
for (const auto& schIt : this->schedule()) {
|
||||
const auto& oilVaporizationControl = schIt.oilvap();
|
||||
@ -301,13 +301,14 @@ bool EclGenericVanguard::drsdtconEnabled() const
|
||||
return false;
|
||||
}
|
||||
|
||||
std::unordered_map<size_t, const NumericalAquiferCell*> EclGenericVanguard::allAquiferCells() const
|
||||
std::unordered_map<size_t, const NumericalAquiferCell*>
|
||||
FlowGenericVanguard::allAquiferCells() const
|
||||
{
|
||||
return this->eclState_->aquifer().numericalAquifers().allAquiferCells();
|
||||
}
|
||||
|
||||
template<>
|
||||
void EclGenericVanguard::
|
||||
void FlowGenericVanguard::
|
||||
serializeOp<Serializer<Serialization::MemPacker>>(Serializer<Serialization::MemPacker>& serializer)
|
||||
{
|
||||
serializer(*summaryState_);
|
||||
@ -316,7 +317,7 @@ serializeOp<Serializer<Serialization::MemPacker>>(Serializer<Serialization::MemP
|
||||
serializer(*eclSchedule_);
|
||||
}
|
||||
|
||||
bool EclGenericVanguard::operator==(const EclGenericVanguard& rhs) const
|
||||
bool FlowGenericVanguard::operator==(const FlowGenericVanguard& rhs) const
|
||||
{
|
||||
auto cmp_ptr = [](const auto& a, const auto& b)
|
||||
{
|
@ -22,10 +22,10 @@
|
||||
*/
|
||||
/*!
|
||||
* \file
|
||||
* \copydoc Opm::EclBaseVanguard
|
||||
* \copydoc Opm::FlowBaseVanguard
|
||||
*/
|
||||
#ifndef EWOMS_ECL_GENERIC_VANGUARD_HH
|
||||
#define EWOMS_ECL_GENERIC_VANGUARD_HH
|
||||
#ifndef OPM_FLOW_GENERIC_VANGUARD_HPP
|
||||
#define OPM_FLOW_GENERIC_VANGUARD_HPP
|
||||
|
||||
#include <dune/common/parallel/communication.hh>
|
||||
|
||||
@ -35,14 +35,11 @@
|
||||
|
||||
#include <opm/simulators/utils/ParallelCommunication.hpp>
|
||||
|
||||
#include <array>
|
||||
#include <cassert>
|
||||
#include <memory>
|
||||
#include <optional>
|
||||
#include <stdexcept>
|
||||
#include <string>
|
||||
#include <unordered_map>
|
||||
#include <unordered_set>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
@ -60,7 +57,7 @@ class SummaryState;
|
||||
class UDQState;
|
||||
class WellTestState;
|
||||
|
||||
class EclGenericVanguard {
|
||||
class FlowGenericVanguard {
|
||||
public:
|
||||
using ParallelWellStruct = std::vector<std::pair<std::string,bool>>;
|
||||
|
||||
@ -81,14 +78,14 @@ public:
|
||||
* \brief Constructor.
|
||||
* \details Needs to be in compile unit.
|
||||
*/
|
||||
EclGenericVanguard();
|
||||
explicit EclGenericVanguard(SimulationModelParams&& params);
|
||||
FlowGenericVanguard();
|
||||
explicit FlowGenericVanguard(SimulationModelParams&& params);
|
||||
|
||||
/*!
|
||||
* \brief Destructor.
|
||||
* \details Empty, but needs to be in compile unit.
|
||||
*/
|
||||
~EclGenericVanguard();
|
||||
~FlowGenericVanguard();
|
||||
|
||||
static SimulationModelParams serializationTestParams();
|
||||
|
||||
@ -267,7 +264,7 @@ public:
|
||||
void serializeOp(Serializer& serializer);
|
||||
|
||||
// Only compares dynamic state.
|
||||
bool operator==(const EclGenericVanguard& rhs) const;
|
||||
bool operator==(const FlowGenericVanguard& rhs) const;
|
||||
|
||||
protected:
|
||||
void updateOutputDir_(std::string outputDir,
|
||||
@ -333,4 +330,4 @@ protected:
|
||||
|
||||
} // namespace Opm
|
||||
|
||||
#endif
|
||||
#endif // OPM_FLOW_GENERIC_VANGUARD_HPP
|
@ -340,9 +340,10 @@ namespace Opm {
|
||||
Dune::Timer setupTimerAfterReadingDeck;
|
||||
setupTimerAfterReadingDeck.start();
|
||||
|
||||
int status = setupParameters_(this->argc_, this->argv_, EclGenericVanguard::comm());
|
||||
if (status)
|
||||
int status = setupParameters_(this->argc_, this->argv_, FlowGenericVanguard::comm());
|
||||
if (status) {
|
||||
return status;
|
||||
}
|
||||
|
||||
setupParallelism();
|
||||
setupModelSimulator();
|
||||
@ -381,7 +382,7 @@ namespace Opm {
|
||||
// determine the rank of the current process and the number of processes
|
||||
// involved in the simulation. MPI must have already been initialized
|
||||
// here. (yes, the name of this method is misleading.)
|
||||
auto comm = EclGenericVanguard::comm();
|
||||
auto comm = FlowGenericVanguard::comm();
|
||||
mpi_rank_ = comm.rank();
|
||||
mpi_size_ = comm.size();
|
||||
|
||||
@ -422,7 +423,7 @@ namespace Opm {
|
||||
|
||||
void setupModelSimulator()
|
||||
{
|
||||
modelSimulator_ = std::make_unique<ModelSimulator>(EclGenericVanguard::comm(), /*verbose=*/false);
|
||||
modelSimulator_ = std::make_unique<ModelSimulator>(FlowGenericVanguard::comm(), /*verbose=*/false);
|
||||
modelSimulator_->executionTimer().start();
|
||||
modelSimulator_->model().applyInitialSolution();
|
||||
|
||||
|
@ -31,7 +31,7 @@
|
||||
#include <opm/simulators/utils/ParallelFileMerger.hpp>
|
||||
|
||||
#if HAVE_MPI
|
||||
#include <ebos/eclgenericvanguard.hh>
|
||||
#include <opm/simulators/flow/FlowGenericVanguard.hpp>
|
||||
#endif
|
||||
|
||||
#include <fmt/format.h>
|
||||
@ -88,7 +88,7 @@ void handleExtraConvergenceOutput(SimulatorReport& report,
|
||||
void checkAllMPIProcesses()
|
||||
{
|
||||
#if HAVE_MPI
|
||||
const auto& comm = EclGenericVanguard::comm();
|
||||
const auto& comm = FlowGenericVanguard::comm();
|
||||
if (comm.size() > 1)
|
||||
{
|
||||
// we try to prevent the abort here.
|
||||
|
@ -127,7 +127,7 @@ GenericCpGridVanguard<ElementMapper,GridView,Scalar>::GenericCpGridVanguard()
|
||||
this->mpiRank = 0;
|
||||
|
||||
#if HAVE_MPI
|
||||
this->mpiRank = EclGenericVanguard::comm().rank();
|
||||
this->mpiRank = FlowGenericVanguard::comm().rank();
|
||||
#endif // HAVE_MPI
|
||||
}
|
||||
|
||||
@ -141,16 +141,16 @@ void GenericCpGridVanguard<ElementMapper,GridView,Scalar>::releaseEquilGrid()
|
||||
#if HAVE_MPI
|
||||
template<class ElementMapper, class GridView, class Scalar>
|
||||
void GenericCpGridVanguard<ElementMapper, GridView, Scalar>::
|
||||
doLoadBalance_(const Dune::EdgeWeightMethod edgeWeightsMethod,
|
||||
const bool ownersFirst,
|
||||
const bool serialPartitioning,
|
||||
const bool enableDistributedWells,
|
||||
const double zoltanImbalanceTol,
|
||||
const GridView& gridView,
|
||||
const Schedule& schedule,
|
||||
EclipseState& eclState1,
|
||||
EclGenericVanguard::ParallelWellStruct& parallelWells,
|
||||
const int numJacobiBlocks)
|
||||
doLoadBalance_(const Dune::EdgeWeightMethod edgeWeightsMethod,
|
||||
const bool ownersFirst,
|
||||
const bool serialPartitioning,
|
||||
const bool enableDistributedWells,
|
||||
const double zoltanImbalanceTol,
|
||||
const GridView& gridView,
|
||||
const Schedule& schedule,
|
||||
EclipseState& eclState1,
|
||||
FlowGenericVanguard::ParallelWellStruct& parallelWells,
|
||||
const int numJacobiBlocks)
|
||||
{
|
||||
if (!this->zoltanParams().empty())
|
||||
this->grid_->setZoltanParams(setupZoltanParams(this->zoltanParams()));
|
||||
@ -276,16 +276,16 @@ extractFaceTrans(const GridView& gridView) const
|
||||
template <class ElementMapper, class GridView, class Scalar>
|
||||
void
|
||||
GenericCpGridVanguard<ElementMapper, GridView, Scalar>::
|
||||
distributeGrid(const Dune::EdgeWeightMethod edgeWeightsMethod,
|
||||
const bool ownersFirst,
|
||||
const bool serialPartitioning,
|
||||
const bool enableDistributedWells,
|
||||
const double zoltanImbalanceTol,
|
||||
const bool loadBalancerSet,
|
||||
const std::vector<double>& faceTrans,
|
||||
const std::vector<Well>& wells,
|
||||
EclipseState& eclState1,
|
||||
EclGenericVanguard::ParallelWellStruct& parallelWells)
|
||||
distributeGrid(const Dune::EdgeWeightMethod edgeWeightsMethod,
|
||||
const bool ownersFirst,
|
||||
const bool serialPartitioning,
|
||||
const bool enableDistributedWells,
|
||||
const double zoltanImbalanceTol,
|
||||
const bool loadBalancerSet,
|
||||
const std::vector<double>& faceTrans,
|
||||
const std::vector<Well>& wells,
|
||||
EclipseState& eclState1,
|
||||
FlowGenericVanguard::ParallelWellStruct& parallelWells)
|
||||
{
|
||||
if (auto* eclState = dynamic_cast<ParallelEclipseState*>(&eclState1);
|
||||
eclState != nullptr)
|
||||
@ -312,16 +312,16 @@ distributeGrid(const Dune::EdgeWeightMethod edgeWeightsMethod,
|
||||
template <class ElementMapper, class GridView, class Scalar>
|
||||
void
|
||||
GenericCpGridVanguard<ElementMapper, GridView, Scalar>::
|
||||
distributeGrid(const Dune::EdgeWeightMethod edgeWeightsMethod,
|
||||
const bool ownersFirst,
|
||||
const bool serialPartitioning,
|
||||
const bool enableDistributedWells,
|
||||
const double zoltanImbalanceTol,
|
||||
const bool loadBalancerSet,
|
||||
const std::vector<double>& faceTrans,
|
||||
const std::vector<Well>& wells,
|
||||
ParallelEclipseState* eclState,
|
||||
EclGenericVanguard::ParallelWellStruct& parallelWells)
|
||||
distributeGrid(const Dune::EdgeWeightMethod edgeWeightsMethod,
|
||||
const bool ownersFirst,
|
||||
const bool serialPartitioning,
|
||||
const bool enableDistributedWells,
|
||||
const double zoltanImbalanceTol,
|
||||
const bool loadBalancerSet,
|
||||
const std::vector<double>& faceTrans,
|
||||
const std::vector<Well>& wells,
|
||||
ParallelEclipseState* eclState,
|
||||
FlowGenericVanguard::ParallelWellStruct& parallelWells)
|
||||
{
|
||||
OPM_TIMEBLOCK(gridDistribute);
|
||||
const auto isIORank = this->grid_->comm().rank() == 0;
|
||||
@ -372,7 +372,7 @@ void GenericCpGridVanguard<ElementMapper,GridView,Scalar>::doCreateGrids_(Eclips
|
||||
}
|
||||
OPM_TIMEBLOCK(createGrids);
|
||||
#if HAVE_MPI
|
||||
this->grid_ = std::make_unique<Dune::CpGrid>(EclGenericVanguard::comm());
|
||||
this->grid_ = std::make_unique<Dune::CpGrid>(FlowGenericVanguard::comm());
|
||||
#else
|
||||
this->grid_ = std::make_unique<Dune::CpGrid>();
|
||||
#endif
|
||||
@ -481,7 +481,7 @@ doFilterConnections_(Schedule& schedule)
|
||||
try {
|
||||
// Broadcast another time to remove inactive peforations on
|
||||
// slave processors.
|
||||
eclBroadcast(EclGenericVanguard::comm(), schedule);
|
||||
eclBroadcast(FlowGenericVanguard::comm(), schedule);
|
||||
}
|
||||
catch (const std::exception& broadcast_error) {
|
||||
OpmLog::error(fmt::format("Distributing properties to all processes failed\n"
|
||||
|
@ -27,10 +27,10 @@
|
||||
#ifndef OPM_GENERIC_CPGRID_VANGUARD_HPP
|
||||
#define OPM_GENERIC_CPGRID_VANGUARD_HPP
|
||||
|
||||
#include <ebos/eclgenericvanguard.hh>
|
||||
|
||||
#include <opm/grid/CpGrid.hpp>
|
||||
|
||||
#include <opm/simulators/flow/FlowGenericVanguard.hpp>
|
||||
|
||||
#include <functional>
|
||||
#include <memory>
|
||||
#include <optional>
|
||||
@ -147,43 +147,43 @@ protected:
|
||||
* (For parallel simulation runs.)
|
||||
*/
|
||||
#if HAVE_MPI
|
||||
void doLoadBalance_(const Dune::EdgeWeightMethod edgeWeightsMethod,
|
||||
const bool ownersFirst,
|
||||
const bool serialPartitioning,
|
||||
const bool enableDistributedWells,
|
||||
const double zoltanImbalanceTol,
|
||||
const GridView& gridView,
|
||||
const Schedule& schedule,
|
||||
EclipseState& eclState,
|
||||
EclGenericVanguard::ParallelWellStruct& parallelWells,
|
||||
const int numJacobiBlocks);
|
||||
void doLoadBalance_(const Dune::EdgeWeightMethod edgeWeightsMethod,
|
||||
const bool ownersFirst,
|
||||
const bool serialPartitioning,
|
||||
const bool enableDistributedWells,
|
||||
const double zoltanImbalanceTol,
|
||||
const GridView& gridView,
|
||||
const Schedule& schedule,
|
||||
EclipseState& eclState,
|
||||
FlowGenericVanguard::ParallelWellStruct& parallelWells,
|
||||
const int numJacobiBlocks);
|
||||
|
||||
void distributeFieldProps_(EclipseState& eclState);
|
||||
|
||||
private:
|
||||
std::vector<double> extractFaceTrans(const GridView& gridView) const;
|
||||
|
||||
void distributeGrid(const Dune::EdgeWeightMethod edgeWeightsMethod,
|
||||
const bool ownersFirst,
|
||||
const bool serialPartitioning,
|
||||
const bool enableDistributedWells,
|
||||
const double zoltanImbalanceTol,
|
||||
const bool loadBalancerSet,
|
||||
const std::vector<double>& faceTrans,
|
||||
const std::vector<Well>& wells,
|
||||
EclipseState& eclState,
|
||||
EclGenericVanguard::ParallelWellStruct& parallelWells);
|
||||
void distributeGrid(const Dune::EdgeWeightMethod edgeWeightsMethod,
|
||||
const bool ownersFirst,
|
||||
const bool serialPartitioning,
|
||||
const bool enableDistributedWells,
|
||||
const double zoltanImbalanceTol,
|
||||
const bool loadBalancerSet,
|
||||
const std::vector<double>& faceTrans,
|
||||
const std::vector<Well>& wells,
|
||||
EclipseState& eclState,
|
||||
FlowGenericVanguard::ParallelWellStruct& parallelWells);
|
||||
|
||||
void distributeGrid(const Dune::EdgeWeightMethod edgeWeightsMethod,
|
||||
const bool ownersFirst,
|
||||
const bool serialPartitioning,
|
||||
const bool enableDistributedWells,
|
||||
const double zoltanImbalanceTol,
|
||||
const bool loadBalancerSet,
|
||||
const std::vector<double>& faceTrans,
|
||||
const std::vector<Well>& wells,
|
||||
ParallelEclipseState* eclState,
|
||||
EclGenericVanguard::ParallelWellStruct& parallelWells);
|
||||
void distributeGrid(const Dune::EdgeWeightMethod edgeWeightsMethod,
|
||||
const bool ownersFirst,
|
||||
const bool serialPartitioning,
|
||||
const bool enableDistributedWells,
|
||||
const double zoltanImbalanceTol,
|
||||
const bool loadBalancerSet,
|
||||
const std::vector<double>& faceTrans,
|
||||
const std::vector<Well>& wells,
|
||||
ParallelEclipseState* eclState,
|
||||
FlowGenericVanguard::ParallelWellStruct& parallelWells);
|
||||
|
||||
protected:
|
||||
virtual const std::string& zoltanParams() const = 0;
|
||||
|
@ -77,7 +77,7 @@ Main::~Main()
|
||||
int world_size;
|
||||
MPI_Comm_size(MPI_COMM_WORLD, &world_size);
|
||||
if (world_size > 1) {
|
||||
MPI_Comm new_comm = EclGenericVanguard::comm();
|
||||
MPI_Comm new_comm = FlowGenericVanguard::comm();
|
||||
int result;
|
||||
MPI_Comm_compare(MPI_COMM_WORLD, new_comm, &result);
|
||||
assert(result == MPI_UNEQUAL);
|
||||
@ -87,7 +87,7 @@ Main::~Main()
|
||||
#endif // HAVE_MPI
|
||||
|
||||
if (ownMPI_) {
|
||||
EclGenericVanguard::setCommunication(nullptr);
|
||||
FlowGenericVanguard::setCommunication(nullptr);
|
||||
}
|
||||
|
||||
#if HAVE_DAMARIS
|
||||
@ -136,22 +136,22 @@ void Main::initMPI()
|
||||
#elif HAVE_MPI
|
||||
MPI_Init(&argc_, &argv_);
|
||||
#endif
|
||||
EclGenericVanguard::setCommunication(std::make_unique<Parallel::Communication>());
|
||||
FlowGenericVanguard::setCommunication(std::make_unique<Parallel::Communication>());
|
||||
|
||||
handleTestSplitCommunicatorCmdLine_();
|
||||
|
||||
#if HAVE_MPI
|
||||
if (test_split_comm_ && EclGenericVanguard::comm().size() > 1) {
|
||||
int world_rank = EclGenericVanguard::comm().rank();
|
||||
if (test_split_comm_ && FlowGenericVanguard::comm().size() > 1) {
|
||||
int world_rank = FlowGenericVanguard::comm().rank();
|
||||
int color = (world_rank == 0);
|
||||
MPI_Comm new_comm;
|
||||
MPI_Comm_split(EclGenericVanguard::comm(), color, world_rank, &new_comm);
|
||||
MPI_Comm_split(FlowGenericVanguard::comm(), color, world_rank, &new_comm);
|
||||
isSimulationRank_ = (world_rank > 0);
|
||||
EclGenericVanguard::setCommunication(std::make_unique<Parallel::Communication>(new_comm));
|
||||
FlowGenericVanguard::setCommunication(std::make_unique<Parallel::Communication>(new_comm));
|
||||
}
|
||||
|
||||
#if HAVE_CUDA
|
||||
Opm::cuistl::setDevice(EclGenericVanguard::comm().rank(), EclGenericVanguard::comm().size());
|
||||
Opm::cuistl::setDevice(FlowGenericVanguard::comm().rank(), FlowGenericVanguard::comm().size());
|
||||
#endif
|
||||
|
||||
#endif // HAVE_MPI
|
||||
@ -201,7 +201,7 @@ void Main::readDeck(const std::string& deckFilename,
|
||||
outputCout_, "STDOUT_LOGGER", allRanksDbgPrtLog);
|
||||
|
||||
if (outputCout_) {
|
||||
printPRTHeader(EclGenericVanguard::comm().size(), numThreads,
|
||||
printPRTHeader(FlowGenericVanguard::comm().size(), numThreads,
|
||||
parameters, moduleVersion, compileTimestamp);
|
||||
OpmLog::info("Reading deck file '" + deckFilename + "'");
|
||||
}
|
||||
@ -210,7 +210,7 @@ void Main::readDeck(const std::string& deckFilename,
|
||||
if (output_param >= 0)
|
||||
outputInterval = output_param;
|
||||
|
||||
Opm::readDeck(EclGenericVanguard::comm(),
|
||||
Opm::readDeck(FlowGenericVanguard::comm(),
|
||||
deckFilename,
|
||||
eclipseState_,
|
||||
schedule_,
|
||||
@ -224,20 +224,20 @@ void Main::readDeck(const std::string& deckFilename,
|
||||
outputCout_,
|
||||
outputInterval);
|
||||
|
||||
verifyValidCellGeometry(EclGenericVanguard::comm(), *this->eclipseState_);
|
||||
verifyValidCellGeometry(FlowGenericVanguard::comm(), *this->eclipseState_);
|
||||
|
||||
outputFiles_ = (omode != FileOutputMode::OUTPUT_NONE);
|
||||
}
|
||||
|
||||
void Main::setupVanguard()
|
||||
{
|
||||
EclGenericVanguard::modelParams_.setupTime_ = this->setupTime_;
|
||||
EclGenericVanguard::modelParams_.actionState_ = std::move(this->actionState_);
|
||||
EclGenericVanguard::modelParams_.eclSchedule_ = this->schedule_;
|
||||
EclGenericVanguard::modelParams_.eclState_ = this->eclipseState_;
|
||||
EclGenericVanguard::modelParams_.eclSummaryConfig_ = this->summaryConfig_;
|
||||
EclGenericVanguard::modelParams_.udqState_ = std::move(udqState_);
|
||||
EclGenericVanguard::modelParams_.wtestState_ = std::move(wtestState_);
|
||||
FlowGenericVanguard::modelParams_.setupTime_ = this->setupTime_;
|
||||
FlowGenericVanguard::modelParams_.actionState_ = std::move(this->actionState_);
|
||||
FlowGenericVanguard::modelParams_.eclSchedule_ = this->schedule_;
|
||||
FlowGenericVanguard::modelParams_.eclState_ = this->eclipseState_;
|
||||
FlowGenericVanguard::modelParams_.eclSummaryConfig_ = this->summaryConfig_;
|
||||
FlowGenericVanguard::modelParams_.udqState_ = std::move(udqState_);
|
||||
FlowGenericVanguard::modelParams_.wtestState_ = std::move(wtestState_);
|
||||
}
|
||||
|
||||
#if HAVE_DAMARIS
|
||||
@ -251,7 +251,7 @@ void Main::setupDamaris(const std::string& outputDir )
|
||||
//const auto find_replace_map;
|
||||
//const auto find_replace_map = Opm::DamarisOutput::DamarisKeywords<PreTypeTag>(EclGenericVanguard::comm(), outputDir);
|
||||
std::map<std::string, std::string> find_replace_map;
|
||||
find_replace_map = Opm::DamarisOutput::getDamarisKeywords<PreTypeTag>(EclGenericVanguard::comm(), outputDir);
|
||||
find_replace_map = Opm::DamarisOutput::getDamarisKeywords<PreTypeTag>(FlowGenericVanguard::comm(), outputDir);
|
||||
|
||||
// By default EnableDamarisOutputCollective is true so all simulation results will
|
||||
// be written into one single file for each iteration using Parallel HDF5.
|
||||
@ -259,8 +259,8 @@ void Main::setupDamaris(const std::string& outputDir )
|
||||
// node are aggregated by dedicated Damaris cores and stored to separate files per Damaris core.
|
||||
// Irrespective of mode, output is written asynchronously at the end of each timestep.
|
||||
// Using the ModifyModel class to set the XML file for Damaris.
|
||||
DamarisOutput::initializeDamaris(EclGenericVanguard::comm(),
|
||||
EclGenericVanguard::comm().rank(),
|
||||
DamarisOutput::initializeDamaris(FlowGenericVanguard::comm(),
|
||||
FlowGenericVanguard::comm().rank(),
|
||||
find_replace_map);
|
||||
int is_client;
|
||||
MPI_Comm new_comm;
|
||||
@ -270,7 +270,7 @@ void Main::setupDamaris(const std::string& outputDir )
|
||||
isSimulationRank_ = (is_client > 0);
|
||||
if (isSimulationRank_ && err == DAMARIS_OK) {
|
||||
damaris_client_comm_get(&new_comm);
|
||||
EclGenericVanguard::setCommunication(std::make_unique<Parallel::Communication>(new_comm));
|
||||
FlowGenericVanguard::setCommunication(std::make_unique<Parallel::Communication>(new_comm));
|
||||
}
|
||||
|
||||
if (err != DAMARIS_OK) {
|
||||
|
@ -313,7 +313,7 @@ private:
|
||||
using PreProblem = GetPropType<PreTypeTag, Properties::Problem>;
|
||||
|
||||
PreProblem::setBriefDescription("Flow, an advanced reservoir simulator for ECL-decks provided by the Open Porous Media project.");
|
||||
int status = FlowMain<PreTypeTag>::setupParameters_(argc_, argv_, EclGenericVanguard::comm());
|
||||
int status = FlowMain<PreTypeTag>::setupParameters_(argc_, argv_, FlowGenericVanguard::comm());
|
||||
if (status != 0) {
|
||||
// if setupParameters_ returns a value smaller than 0, there was no error, but
|
||||
// the program should abort. This is the case e.g. for the --help and the
|
||||
@ -341,7 +341,7 @@ private:
|
||||
enableDamarisOutput_ = EWOMS_GET_PARAM(PreTypeTag, bool, EnableDamarisOutput);
|
||||
|
||||
// Reset to false as we cannot use Damaris if there is only one rank.
|
||||
if ((enableDamarisOutput_ == true) && (EclGenericVanguard::comm().size() == 1)) {
|
||||
if ((enableDamarisOutput_ == true) && (FlowGenericVanguard::comm().size() == 1)) {
|
||||
std::string msg ;
|
||||
msg = "\nUse of Damaris (command line argument --enable-damaris-output=true) has been disabled for run with only one rank.\n" ;
|
||||
OpmLog::warning(msg);
|
||||
@ -371,7 +371,7 @@ private:
|
||||
return true;
|
||||
}
|
||||
|
||||
int mpiRank = EclGenericVanguard::comm().rank();
|
||||
int mpiRank = FlowGenericVanguard::comm().rank();
|
||||
outputCout_ = false;
|
||||
if (mpiRank == 0)
|
||||
outputCout_ = EWOMS_GET_PARAM(PreTypeTag, bool, EnableTerminalOutput);
|
||||
@ -401,7 +401,7 @@ private:
|
||||
|
||||
std::string cmdline_params;
|
||||
if (outputCout_) {
|
||||
printFlowBanner(EclGenericVanguard::comm().size(),
|
||||
printFlowBanner(FlowGenericVanguard::comm().size(),
|
||||
getNumThreads<PreTypeTag>(),
|
||||
Opm::moduleVersionName());
|
||||
std::ostringstream str;
|
||||
|
@ -187,7 +187,7 @@ public:
|
||||
SimulatorFullyImplicitBlackoil(Simulator& simulator)
|
||||
: simulator_(simulator)
|
||||
, serializer_(*this,
|
||||
EclGenericVanguard::comm(),
|
||||
FlowGenericVanguard::comm(),
|
||||
simulator_.vanguard().eclState().getIOConfig(),
|
||||
EWOMS_GET_PARAM(TypeTag, std::string, SaveStep),
|
||||
EWOMS_GET_PARAM(TypeTag, int, LoadStep),
|
||||
|
@ -20,7 +20,6 @@
|
||||
#include <config.h>
|
||||
|
||||
#include <ebos/ebos.hh>
|
||||
#include <ebos/eclgenericvanguard.hh>
|
||||
|
||||
#include <opm/common/utility/Serializer.hpp>
|
||||
|
||||
@ -32,11 +31,13 @@
|
||||
#include <opm/output/eclipse/Inplace.hpp>
|
||||
|
||||
#include <opm/input/eclipse/EclipseState/WagHysteresisConfig.hpp>
|
||||
|
||||
#include <opm/material/fluidmatrixinteractions/EclHysteresisTwoPhaseLawParams.hpp>
|
||||
|
||||
#include <opm/models/blackoil/blackoilprimaryvariables.hh>
|
||||
|
||||
#include <opm/simulators/flow/FemCpGridCompat.hpp>
|
||||
#include <opm/simulators/flow/FlowGenericVanguard.hpp>
|
||||
#include <opm/simulators/timestepping/AdaptiveTimeStepping.hpp>
|
||||
#include <opm/simulators/timestepping/SimulatorReport.hpp>
|
||||
#include <opm/simulators/timestepping/SimulatorTimer.hpp>
|
||||
@ -203,24 +204,24 @@ BOOST_AUTO_TEST_CASE(WGState)
|
||||
|
||||
BOOST_AUTO_TEST_CASE(EclGenericVanguard)
|
||||
{
|
||||
auto in_params = Opm::EclGenericVanguard::serializationTestParams();
|
||||
Opm::EclGenericVanguard val1(std::move(in_params));
|
||||
auto in_params = Opm::FlowGenericVanguard::serializationTestParams();
|
||||
Opm::FlowGenericVanguard val1(std::move(in_params));
|
||||
Opm::Serialization::MemPacker packer;
|
||||
Opm::Serializer ser(packer);
|
||||
ser.pack(val1);
|
||||
const size_t pos1 = ser.position();
|
||||
Opm::EclGenericVanguard::SimulationModelParams out_params;
|
||||
Opm::FlowGenericVanguard::SimulationModelParams out_params;
|
||||
out_params.setupTime_ = 0.0;
|
||||
out_params.actionState_ = std::make_unique<Opm::Action::State>();
|
||||
out_params.udqState_ = std::make_unique<Opm::UDQState>();
|
||||
out_params.eclSchedule_ = std::make_shared<Opm::Schedule>();
|
||||
out_params.summaryState_ = std::make_unique<Opm::SummaryState>();
|
||||
Opm::EclGenericVanguard val2(std::move(out_params));
|
||||
Opm::FlowGenericVanguard val2(std::move(out_params));
|
||||
ser.unpack(val2);
|
||||
const size_t pos2 = ser.position();
|
||||
|
||||
BOOST_CHECK_MESSAGE(pos1 == pos2, "Packed size differ from unpack size for EclGenericVanguard");
|
||||
BOOST_CHECK_MESSAGE(val1 == val2, "Deserialized EclGenericVanguard differ");
|
||||
BOOST_CHECK_MESSAGE(pos1 == pos2, "Packed size differ from unpack size for FlowGenericVanguard");
|
||||
BOOST_CHECK_MESSAGE(val1 == val2, "Deserialized FlowGenericVanguard differ");
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(EclGenericProblem)
|
||||
@ -448,7 +449,7 @@ struct AquiferFixture {
|
||||
};
|
||||
Opm::AdaptiveTimeStepping<TT>::registerParameters();
|
||||
Opm::setupParameters_<TT>(2, argv, /*registerParams=*/true);
|
||||
Opm::EclGenericVanguard::setCommunication(std::make_unique<Opm::Parallel::Communication>());
|
||||
Opm::FlowGenericVanguard::setCommunication(std::make_unique<Opm::Parallel::Communication>());
|
||||
}
|
||||
};
|
||||
|
||||
@ -460,7 +461,7 @@ BOOST_GLOBAL_FIXTURE(AquiferFixture);
|
||||
BOOST_AUTO_TEST_CASE(TYPE) \
|
||||
{ \
|
||||
using TT = Opm::Properties::TTag::TestRestartTypeTag; \
|
||||
Opm::EclGenericVanguard::readDeck("GLIFT1.DATA"); \
|
||||
Opm::FlowGenericVanguard::readDeck("GLIFT1.DATA"); \
|
||||
using Simulator = Opm::GetPropType<TT, Opm::Properties::Simulator>; \
|
||||
Simulator sim; \
|
||||
auto data_out = Opm::TYPE<TT>::serializationTestObject(sim); \
|
||||
@ -481,7 +482,7 @@ TEST_FOR_AQUIFER(AquiferFetkovich)
|
||||
BOOST_AUTO_TEST_CASE(AquiferNumerical)
|
||||
{
|
||||
using TT = Opm::Properties::TTag::TestRestartTypeTag;
|
||||
Opm::EclGenericVanguard::readDeck("GLIFT1.DATA");
|
||||
Opm::FlowGenericVanguard::readDeck("GLIFT1.DATA");
|
||||
using Simulator = Opm::GetPropType<TT, Opm::Properties::Simulator>;
|
||||
Simulator sim;
|
||||
auto data_out = Opm::AquiferNumerical<TT>::serializationTestObject(sim);
|
||||
@ -499,7 +500,7 @@ BOOST_AUTO_TEST_CASE(AquiferNumerical)
|
||||
BOOST_AUTO_TEST_CASE(AquiferConstantFlux)
|
||||
{
|
||||
using TT = Opm::Properties::TTag::TestRestartTypeTag;
|
||||
Opm::EclGenericVanguard::readDeck("GLIFT1.DATA");
|
||||
Opm::FlowGenericVanguard::readDeck("GLIFT1.DATA");
|
||||
using Simulator = Opm::GetPropType<TT, Opm::Properties::Simulator>;
|
||||
Simulator sim;
|
||||
auto data_out = Opm::AquiferConstantFlux<TT>::serializationTestObject(sim);
|
||||
|
@ -25,7 +25,6 @@
|
||||
#define BOOST_TEST_MODULE Equil
|
||||
|
||||
#include <ebos/eclproblem.hh>
|
||||
#include <ebos/eclgenericvanguard.hh>
|
||||
|
||||
#include <opm/grid/UnstructuredGrid.h>
|
||||
#include <opm/grid/GridManager.hpp>
|
||||
@ -39,6 +38,7 @@
|
||||
#include <opm/models/utils/start.hh>
|
||||
|
||||
#include <opm/simulators/flow/BlackoilModelParameters.hpp>
|
||||
#include <opm/simulators/flow/FlowGenericVanguard.hpp>
|
||||
#include <opm/simulators/flow/equil/EquilibrationHelpers.hpp>
|
||||
#include <opm/simulators/linalg/parallelbicgstabbackend.hh>
|
||||
#include <opm/simulators/wells/BlackoilWellModel.hpp>
|
||||
@ -119,7 +119,7 @@ initSimulator(const char *filename)
|
||||
|
||||
Opm::setupParameters_<TypeTag>(/*argc=*/sizeof(argv)/sizeof(argv[0]), argv, /*registerParams=*/false);
|
||||
|
||||
Opm::EclGenericVanguard::readDeck(filename);
|
||||
Opm::FlowGenericVanguard::readDeck(filename);
|
||||
|
||||
return std::make_unique<Simulator>();
|
||||
}
|
||||
@ -233,7 +233,7 @@ struct EquilFixture {
|
||||
#else
|
||||
Dune::MPIHelper::instance(argc, argv);
|
||||
#endif
|
||||
Opm::EclGenericVanguard::setCommunication(std::make_unique<Opm::Parallel::Communication>());
|
||||
Opm::FlowGenericVanguard::setCommunication(std::make_unique<Opm::Parallel::Communication>());
|
||||
Opm::BlackoilModelParameters<TypeTag>::registerParameters();
|
||||
Opm::AdaptiveTimeStepping<TypeTag>::registerParameters();
|
||||
Opm::Parameters::registerParam<TypeTag, bool>("EnableTerminalOutput",
|
||||
|
@ -89,7 +89,7 @@ initSimulator(const char *filename)
|
||||
Opm::registerEclTimeSteppingParameters<TypeTag>();
|
||||
Opm::setupParameters_<TypeTag>(/*argc=*/sizeof(argv)/sizeof(argv[0]), argv, /*registerParams=*/true);
|
||||
|
||||
Opm::EclGenericVanguard::readDeck(filename);
|
||||
Opm::FlowGenericVanguard::readDeck(filename);
|
||||
|
||||
return std::make_unique<Simulator>();
|
||||
}
|
||||
@ -106,7 +106,7 @@ struct GliftFixture {
|
||||
#else
|
||||
Dune::MPIHelper::instance(argc, argv);
|
||||
#endif
|
||||
Opm::EclGenericVanguard::setCommunication(std::make_unique<Opm::Parallel::Communication>());
|
||||
Opm::FlowGenericVanguard::setCommunication(std::make_unique<Opm::Parallel::Communication>());
|
||||
using TypeTag = Opm::Properties::TTag::FlowProblem;
|
||||
Opm::registerAllParameters_<TypeTag>();
|
||||
}
|
||||
|
@ -192,7 +192,7 @@ int main(int argc, char** argv)
|
||||
Dune::MPIHelper::instance(argcDummy, argvDummy);
|
||||
#endif
|
||||
|
||||
Opm::EclGenericVanguard::setCommunication(std::make_unique<Opm::Parallel::Communication>());
|
||||
Opm::FlowGenericVanguard::setCommunication(std::make_unique<Opm::Parallel::Communication>());
|
||||
|
||||
return boost::unit_test::unit_test_main(&init_unit_test_func, argc, argv);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user