Changed calling convention for shared pointers.

Expect non-reference type shared pointers arguments instead of references
to shared pointer. This will make it clear to the caller that the called
function is making a copy of the pointer for its own use and not trying
to modify the original pointer of the caller.
This commit is contained in:
Håkon Hægland
2021-09-22 00:25:59 +02:00
parent 5ad65c70ee
commit 4c5245196b
29 changed files with 136 additions and 136 deletions

View File

@@ -82,9 +82,9 @@ struct FlowEarlyBird {
namespace Opm {
template <class TypeTag>
void flowEbosSetDeck(std::shared_ptr<Deck>& deck,
std::shared_ptr<EclipseState>& eclState,
std::shared_ptr<Schedule>& schedule,
void flowEbosSetDeck(std::shared_ptr<Deck> deck,
std::shared_ptr<EclipseState> eclState,
std::shared_ptr<Schedule> schedule,
std::shared_ptr<SummaryConfig> summaryConfig)
{
using Vanguard = GetPropType<TypeTag, Properties::Vanguard>;
@@ -136,16 +136,16 @@ namespace Opm
// This constructor can be called from Python when Python has already
// parsed a deck
Main(
std::shared_ptr<Deck>& deck,
std::shared_ptr<EclipseState>& eclipseState,
std::shared_ptr<Schedule>& schedule,
std::shared_ptr<SummaryConfig>& summaryConfig)
: deck_{deck}
, eclipseState_{eclipseState}
, schedule_{schedule}
, summaryConfig_{summaryConfig}
std::shared_ptr<Deck> deck,
std::shared_ptr<EclipseState> eclipseState,
std::shared_ptr<Schedule> schedule,
std::shared_ptr<SummaryConfig> summaryConfig)
: deck_{std::move(deck)}
, eclipseState_{std::move(eclipseState)}
, schedule_{std::move(schedule)}
, summaryConfig_{std::move(summaryConfig)}
{
setArgvArgc_(deck->getDataFile());
setArgvArgc_(deck_->getDataFile());
initMPI();
}

View File

@@ -40,10 +40,10 @@ private:
public:
PyBlackOilSimulator( const std::string& deckFilename);
PyBlackOilSimulator(
std::shared_ptr<Opm::Deck>& deck,
std::shared_ptr<Opm::EclipseState>& state,
std::shared_ptr<Opm::Schedule>& schedule,
std::shared_ptr<Opm::SummaryConfig>& summary_config);
std::shared_ptr<Opm::Deck> deck,
std::shared_ptr<Opm::EclipseState> state,
std::shared_ptr<Opm::Schedule> schedule,
std::shared_ptr<Opm::SummaryConfig> summary_config);
py::array_t<double> getPorosity();
int run();
void setPorosity(