replace boost::scoped_ptr by std::unique_ptr
thanks to Bård Skaflestad, Atgeirr Rasmusen and Roland Kaufmann for the hint.
This commit is contained in:
parent
cab7125da3
commit
bd094b2e11
@ -24,7 +24,7 @@
|
|||||||
#include <opm/core/grid/cart_grid.h>
|
#include <opm/core/grid/cart_grid.h>
|
||||||
#include <opm/core/grid.h>
|
#include <opm/core/grid.h>
|
||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
#include <boost/scoped_ptr.hpp>
|
#include <memory>
|
||||||
#include <opm/core/props/IncompPropertiesBasic.hpp>
|
#include <opm/core/props/IncompPropertiesBasic.hpp>
|
||||||
#include <opm/core/props/IncompPropertiesFromDeck.hpp>
|
#include <opm/core/props/IncompPropertiesFromDeck.hpp>
|
||||||
|
|
||||||
@ -248,8 +248,8 @@ ecl_grid_type * create_ecl_grid( const struct UnstructuredGrid * g) {
|
|||||||
int main(int /*argc*/ , char **argv)
|
int main(int /*argc*/ , char **argv)
|
||||||
{
|
{
|
||||||
std::string filename( argv[1] );
|
std::string filename( argv[1] );
|
||||||
boost::scoped_ptr<Opm::GridManager> grid;
|
const std::unique_ptr<Opm::GridManager> grid;
|
||||||
boost::scoped_ptr<Opm::IncompPropertiesInterface> props;
|
const std::unique_ptr<Opm::IncompPropertiesInterface> props;
|
||||||
Opm::EclipseGridParser eclParser(filename , false);
|
Opm::EclipseGridParser eclParser(filename , false);
|
||||||
|
|
||||||
//eclParser.saveEGRID_INIT("/tmp" , "OPM" );
|
//eclParser.saveEGRID_INIT("/tmp" , "OPM" );
|
||||||
|
@ -47,7 +47,7 @@
|
|||||||
#include <opm/core/tof/TofReorder.hpp>
|
#include <opm/core/tof/TofReorder.hpp>
|
||||||
#include <opm/core/tof/TofDiscGalReorder.hpp>
|
#include <opm/core/tof/TofDiscGalReorder.hpp>
|
||||||
|
|
||||||
#include <boost/scoped_ptr.hpp>
|
#include <memory>
|
||||||
#include <boost/filesystem.hpp>
|
#include <boost/filesystem.hpp>
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
@ -101,10 +101,10 @@ main(int argc, char** argv)
|
|||||||
|
|
||||||
// If we have a "deck_filename", grid and props will be read from that.
|
// If we have a "deck_filename", grid and props will be read from that.
|
||||||
bool use_deck = param.has("deck_filename");
|
bool use_deck = param.has("deck_filename");
|
||||||
boost::scoped_ptr<EclipseGridParser> deck;
|
std::unique_ptr<EclipseGridParser> deck;
|
||||||
boost::scoped_ptr<GridManager> grid;
|
std::unique_ptr<GridManager> grid;
|
||||||
boost::scoped_ptr<IncompPropertiesInterface> props;
|
std::unique_ptr<IncompPropertiesInterface> props;
|
||||||
boost::scoped_ptr<Opm::WellsManager> wells;
|
std::unique_ptr<Opm::WellsManager> wells;
|
||||||
TwophaseState state;
|
TwophaseState state;
|
||||||
// bool check_well_controls = false;
|
// bool check_well_controls = false;
|
||||||
// int max_well_control_iterations = 0;
|
// int max_well_control_iterations = 0;
|
||||||
@ -190,7 +190,7 @@ main(int argc, char** argv)
|
|||||||
bool use_dg = param.getDefault("use_dg", false);
|
bool use_dg = param.getDefault("use_dg", false);
|
||||||
bool use_multidim_upwind = false;
|
bool use_multidim_upwind = false;
|
||||||
// Need to initialize dg solver here, since it uses parameters now.
|
// Need to initialize dg solver here, since it uses parameters now.
|
||||||
boost::scoped_ptr<Opm::TofDiscGalReorder> dg_solver;
|
std::unique_ptr<Opm::TofDiscGalReorder> dg_solver;
|
||||||
if (use_dg) {
|
if (use_dg) {
|
||||||
dg_solver.reset(new Opm::TofDiscGalReorder(*grid->c_grid(), param));
|
dg_solver.reset(new Opm::TofDiscGalReorder(*grid->c_grid(), param));
|
||||||
} else {
|
} else {
|
||||||
|
@ -46,7 +46,7 @@
|
|||||||
#include <opm/core/tof/TofReorder.hpp>
|
#include <opm/core/tof/TofReorder.hpp>
|
||||||
#include <opm/core/tof/TofDiscGalReorder.hpp>
|
#include <opm/core/tof/TofDiscGalReorder.hpp>
|
||||||
|
|
||||||
#include <boost/scoped_ptr.hpp>
|
#include <memory>
|
||||||
#include <boost/filesystem.hpp>
|
#include <boost/filesystem.hpp>
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
@ -142,7 +142,7 @@ main(int argc, char** argv)
|
|||||||
bool use_dg = param.getDefault("use_dg", false);
|
bool use_dg = param.getDefault("use_dg", false);
|
||||||
bool use_multidim_upwind = false;
|
bool use_multidim_upwind = false;
|
||||||
// Need to initialize dg solver here, since it uses parameters now.
|
// Need to initialize dg solver here, since it uses parameters now.
|
||||||
boost::scoped_ptr<Opm::TofDiscGalReorder> dg_solver;
|
std::unique_ptr<Opm::TofDiscGalReorder> dg_solver;
|
||||||
if (use_dg) {
|
if (use_dg) {
|
||||||
dg_solver.reset(new Opm::TofDiscGalReorder(grid, param));
|
dg_solver.reset(new Opm::TofDiscGalReorder(grid, param));
|
||||||
} else {
|
} else {
|
||||||
|
@ -44,7 +44,7 @@
|
|||||||
#include <opm/core/simulator/WellState.hpp>
|
#include <opm/core/simulator/WellState.hpp>
|
||||||
#include <opm/core/simulator/SimulatorCompressibleTwophase.hpp>
|
#include <opm/core/simulator/SimulatorCompressibleTwophase.hpp>
|
||||||
|
|
||||||
#include <boost/scoped_ptr.hpp>
|
#include <memory>
|
||||||
#include <boost/filesystem.hpp>
|
#include <boost/filesystem.hpp>
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
@ -79,10 +79,10 @@ main(int argc, char** argv)
|
|||||||
|
|
||||||
// If we have a "deck_filename", grid and props will be read from that.
|
// If we have a "deck_filename", grid and props will be read from that.
|
||||||
bool use_deck = param.has("deck_filename");
|
bool use_deck = param.has("deck_filename");
|
||||||
boost::scoped_ptr<EclipseGridParser> deck;
|
std::unique_ptr<EclipseGridParser> deck;
|
||||||
boost::scoped_ptr<GridManager> grid;
|
std::unique_ptr<GridManager> grid;
|
||||||
boost::scoped_ptr<BlackoilPropertiesInterface> props;
|
std::unique_ptr<BlackoilPropertiesInterface> props;
|
||||||
boost::scoped_ptr<RockCompressibility> rock_comp;
|
std::unique_ptr<RockCompressibility> rock_comp;
|
||||||
BlackoilState state;
|
BlackoilState state;
|
||||||
// bool check_well_controls = false;
|
// bool check_well_controls = false;
|
||||||
// int max_well_control_iterations = 0;
|
// int max_well_control_iterations = 0;
|
||||||
|
@ -45,7 +45,7 @@
|
|||||||
#include <opm/core/simulator/WellState.hpp>
|
#include <opm/core/simulator/WellState.hpp>
|
||||||
#include <opm/core/simulator/SimulatorIncompTwophase.hpp>
|
#include <opm/core/simulator/SimulatorIncompTwophase.hpp>
|
||||||
|
|
||||||
#include <boost/scoped_ptr.hpp>
|
#include <memory>
|
||||||
#include <boost/filesystem.hpp>
|
#include <boost/filesystem.hpp>
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
@ -93,10 +93,10 @@ main(int argc, char** argv)
|
|||||||
|
|
||||||
// If we have a "deck_filename", grid and props will be read from that.
|
// If we have a "deck_filename", grid and props will be read from that.
|
||||||
bool use_deck = param.has("deck_filename");
|
bool use_deck = param.has("deck_filename");
|
||||||
boost::scoped_ptr<EclipseGridParser> deck;
|
std::unique_ptr<EclipseGridParser> deck;
|
||||||
boost::scoped_ptr<GridManager> grid;
|
std::unique_ptr<GridManager> grid;
|
||||||
boost::scoped_ptr<IncompPropertiesInterface> props;
|
std::unique_ptr<IncompPropertiesInterface> props;
|
||||||
boost::scoped_ptr<RockCompressibility> rock_comp;
|
std::unique_ptr<RockCompressibility> rock_comp;
|
||||||
TwophaseState state;
|
TwophaseState state;
|
||||||
// bool check_well_controls = false;
|
// bool check_well_controls = false;
|
||||||
// int max_well_control_iterations = 0;
|
// int max_well_control_iterations = 0;
|
||||||
|
@ -27,7 +27,7 @@
|
|||||||
#include <opm/core/props/satfunc/SaturationPropsFromDeck.hpp>
|
#include <opm/core/props/satfunc/SaturationPropsFromDeck.hpp>
|
||||||
#include <opm/core/io/eclipse/EclipseGridParser.hpp>
|
#include <opm/core/io/eclipse/EclipseGridParser.hpp>
|
||||||
#include <opm/core/utility/parameters/ParameterGroup.hpp>
|
#include <opm/core/utility/parameters/ParameterGroup.hpp>
|
||||||
#include <boost/scoped_ptr.hpp>
|
#include <memory>
|
||||||
|
|
||||||
struct UnstructuredGrid;
|
struct UnstructuredGrid;
|
||||||
|
|
||||||
@ -186,7 +186,7 @@ namespace Opm
|
|||||||
private:
|
private:
|
||||||
RockFromDeck rock_;
|
RockFromDeck rock_;
|
||||||
BlackoilPvtProperties pvt_;
|
BlackoilPvtProperties pvt_;
|
||||||
boost::scoped_ptr<SaturationPropsInterface> satprops_;
|
std::unique_ptr<SaturationPropsInterface> satprops_;
|
||||||
mutable std::vector<double> B_;
|
mutable std::vector<double> B_;
|
||||||
mutable std::vector<double> dB_;
|
mutable std::vector<double> dB_;
|
||||||
mutable std::vector<double> R_;
|
mutable std::vector<double> R_;
|
||||||
|
@ -49,7 +49,7 @@
|
|||||||
#include <opm/core/transport/reorder/TransportSolverCompressibleTwophaseReorder.hpp>
|
#include <opm/core/transport/reorder/TransportSolverCompressibleTwophaseReorder.hpp>
|
||||||
|
|
||||||
#include <boost/filesystem.hpp>
|
#include <boost/filesystem.hpp>
|
||||||
#include <boost/scoped_ptr.hpp>
|
#include <memory>
|
||||||
#include <boost/lexical_cast.hpp>
|
#include <boost/lexical_cast.hpp>
|
||||||
|
|
||||||
#include <numeric>
|
#include <numeric>
|
||||||
|
@ -90,7 +90,7 @@ namespace Opm
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
class Impl;
|
class Impl;
|
||||||
// Using shared_ptr instead of scoped_ptr since scoped_ptr requires complete type for Impl.
|
// Using shared_ptr instead of unique_ptr since unique_ptr requires complete type for Impl.
|
||||||
std::shared_ptr<Impl> pimpl_;
|
std::shared_ptr<Impl> pimpl_;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -47,7 +47,7 @@
|
|||||||
#include <opm/core/transport/reorder/TransportSolverTwophaseReorder.hpp>
|
#include <opm/core/transport/reorder/TransportSolverTwophaseReorder.hpp>
|
||||||
#include <opm/core/transport/implicit/TransportSolverTwophaseImplicit.hpp>
|
#include <opm/core/transport/implicit/TransportSolverTwophaseImplicit.hpp>
|
||||||
#include <boost/filesystem.hpp>
|
#include <boost/filesystem.hpp>
|
||||||
#include <boost/scoped_ptr.hpp>
|
#include <memory>
|
||||||
#include <boost/lexical_cast.hpp>
|
#include <boost/lexical_cast.hpp>
|
||||||
#include <boost/function.hpp>
|
#include <boost/function.hpp>
|
||||||
#include <boost/signal.hpp>
|
#include <boost/signal.hpp>
|
||||||
@ -98,7 +98,7 @@ namespace Opm
|
|||||||
const FlowBoundaryConditions* bcs_;
|
const FlowBoundaryConditions* bcs_;
|
||||||
// Solvers
|
// Solvers
|
||||||
IncompTpfa psolver_;
|
IncompTpfa psolver_;
|
||||||
boost::scoped_ptr<TransportSolverTwophaseInterface> tsolver_;
|
std::unique_ptr<TransportSolverTwophaseInterface> tsolver_;
|
||||||
// Misc. data
|
// Misc. data
|
||||||
std::vector<int> allcells_;
|
std::vector<int> allcells_;
|
||||||
|
|
||||||
|
@ -119,7 +119,7 @@ namespace Opm
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
struct Impl;
|
struct Impl;
|
||||||
// Using shared_ptr instead of scoped_ptr since scoped_ptr requires complete type for Impl.
|
// Using shared_ptr instead of unique_ptr since unique_ptr requires complete type for Impl.
|
||||||
std::shared_ptr<Impl> pimpl_;
|
std::shared_ptr<Impl> pimpl_;
|
||||||
|
|
||||||
// implementation which is not templated, and can be in library
|
// implementation which is not templated, and can be in library
|
||||||
|
@ -37,7 +37,7 @@
|
|||||||
#include <opm/core/grid.h>
|
#include <opm/core/grid.h>
|
||||||
#include <opm/core/linalg/LinearSolverFactory.hpp>
|
#include <opm/core/linalg/LinearSolverFactory.hpp>
|
||||||
|
|
||||||
#include <boost/scoped_ptr.hpp>
|
#include <memory>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user