mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
use std::shared_ptr instead of boost::shared_ptr
our policy is that we only use boost if necessary, i.e., if the oldest supported compiler does not support a given feature but boost does. since we recently switched to GCC 4.4 or newer, std::shared_ptr is available unconditionally.
This commit is contained in:
@@ -22,7 +22,7 @@
|
||||
|
||||
|
||||
#include <opm/core/linalg/LinearSolverInterface.hpp>
|
||||
#include <boost/shared_ptr.hpp>
|
||||
#include <memory>
|
||||
|
||||
namespace Opm
|
||||
{
|
||||
@@ -87,7 +87,7 @@ namespace Opm
|
||||
virtual double getTolerance() const;
|
||||
|
||||
private:
|
||||
boost::shared_ptr<LinearSolverInterface> solver_;
|
||||
std::shared_ptr<LinearSolverInterface> solver_;
|
||||
};
|
||||
|
||||
|
||||
|
@@ -21,7 +21,7 @@
|
||||
#define OPM_TOFDISCGALREORDER_HEADER_INCLUDED
|
||||
|
||||
#include <opm/core/transport/reorder/ReorderSolverInterface.hpp>
|
||||
#include <boost/shared_ptr.hpp>
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
#include <map>
|
||||
#include <ostream>
|
||||
@@ -128,7 +128,7 @@ namespace Opm
|
||||
|
||||
// Data members
|
||||
const UnstructuredGrid& grid_;
|
||||
boost::shared_ptr<VelocityInterpolationInterface> velocity_interpolation_;
|
||||
std::shared_ptr<VelocityInterpolationInterface> velocity_interpolation_;
|
||||
bool use_cvi_;
|
||||
bool use_limiter_;
|
||||
double limiter_relative_flux_threshold_;
|
||||
@@ -139,7 +139,7 @@ namespace Opm
|
||||
const double* darcyflux_; // one flux per grid face
|
||||
const double* porevolume_; // one volume per cell
|
||||
const double* source_; // one volumetric source term per cell
|
||||
boost::shared_ptr<DGBasisInterface> basis_func_;
|
||||
std::shared_ptr<DGBasisInterface> basis_func_;
|
||||
double* tof_coeff_;
|
||||
// For tracers.
|
||||
double* tracer_coeff_;
|
||||
|
@@ -19,7 +19,7 @@
|
||||
|
||||
#include "config.h"
|
||||
#include <opm/core/wells/WellCollection.hpp>
|
||||
#include <boost/shared_ptr.hpp>
|
||||
#include <memory>
|
||||
|
||||
namespace Opm
|
||||
{
|
||||
@@ -33,7 +33,7 @@ namespace Opm
|
||||
roots_.push_back(createWellsGroup(parent_name, deck));
|
||||
parent = roots_[roots_.size() - 1].get();
|
||||
}
|
||||
boost::shared_ptr<WellsGroupInterface> child;
|
||||
std::shared_ptr<WellsGroupInterface> child;
|
||||
|
||||
for (size_t i = 0; i < roots_.size(); ++i) {
|
||||
if (roots_[i]->name() == child_name) {
|
||||
@@ -99,7 +99,7 @@ namespace Opm
|
||||
/// \param[in] child the child node
|
||||
/// \param[in] parent name of parent node
|
||||
|
||||
void WellCollection::addChild(boost::shared_ptr<WellsGroupInterface>& child_node,
|
||||
void WellCollection::addChild(std::shared_ptr<WellsGroupInterface>& child_node,
|
||||
const std::string& parent_name)
|
||||
{
|
||||
WellsGroupInterface* parent = findNode(parent_name);
|
||||
@@ -116,7 +116,7 @@ namespace Opm
|
||||
|
||||
/// Adds the node to the collection (as a root node)
|
||||
|
||||
void WellCollection::addChild(boost::shared_ptr<WellsGroupInterface>& child_node)
|
||||
void WellCollection::addChild(std::shared_ptr<WellsGroupInterface>& child_node)
|
||||
{
|
||||
roots_.push_back(child_node);
|
||||
if (child_node->isLeafNode()) {
|
||||
|
@@ -26,7 +26,7 @@
|
||||
#include <opm/core/wells/WellsGroup.hpp>
|
||||
#include <opm/core/grid.h>
|
||||
#include <opm/core/io/eclipse/EclipseGridParser.hpp>
|
||||
#include <boost/shared_ptr.hpp>
|
||||
#include <memory>
|
||||
|
||||
namespace Opm
|
||||
{
|
||||
@@ -48,11 +48,11 @@ namespace Opm
|
||||
/// and appends it to parent's children.
|
||||
/// \param[in] child the child node
|
||||
/// \param[in] parent name of parent node
|
||||
void addChild(boost::shared_ptr<WellsGroupInterface>& child_node,
|
||||
void addChild(std::shared_ptr<WellsGroupInterface>& child_node,
|
||||
const std::string& parent);
|
||||
|
||||
/// Adds the node to the collection (as a root node)
|
||||
void addChild(boost::shared_ptr<WellsGroupInterface>& child_node);
|
||||
void addChild(std::shared_ptr<WellsGroupInterface>& child_node);
|
||||
|
||||
/// Checks if each condition is met, applies well controls where needed
|
||||
/// (that is, it either changes the active control of violating wells, or shuts
|
||||
@@ -113,7 +113,7 @@ namespace Opm
|
||||
|
||||
private:
|
||||
// To account for the possibility of a forest
|
||||
std::vector<boost::shared_ptr<WellsGroupInterface> > roots_;
|
||||
std::vector<std::shared_ptr<WellsGroupInterface> > roots_;
|
||||
|
||||
// This will be used to traverse the bottom nodes.
|
||||
std::vector<WellNode*> leaf_nodes_;
|
||||
|
@@ -20,6 +20,7 @@
|
||||
#include "config.h"
|
||||
#include <opm/core/wells/WellsGroup.hpp>
|
||||
#include <cmath>
|
||||
#include <memory>
|
||||
#include <opm/core/wells.h>
|
||||
#include <opm/core/props/phaseUsageFromDeck.hpp>
|
||||
|
||||
@@ -401,7 +402,7 @@ namespace Opm
|
||||
return true;
|
||||
}
|
||||
|
||||
void WellsGroup::addChild(boost::shared_ptr<WellsGroupInterface> child)
|
||||
void WellsGroup::addChild(std::shared_ptr<WellsGroupInterface> child)
|
||||
{
|
||||
children_.push_back(child);
|
||||
}
|
||||
@@ -1041,12 +1042,12 @@ namespace Opm
|
||||
}
|
||||
} // anonymous namespace
|
||||
|
||||
boost::shared_ptr<WellsGroupInterface> createWellsGroup(const std::string& name,
|
||||
std::shared_ptr<WellsGroupInterface> createWellsGroup(const std::string& name,
|
||||
const EclipseGridParser& deck)
|
||||
{
|
||||
PhaseUsage phase_usage = phaseUsageFromDeck(deck);
|
||||
|
||||
boost::shared_ptr<WellsGroupInterface> return_value;
|
||||
std::shared_ptr<WellsGroupInterface> return_value;
|
||||
// First we need to determine whether it's a group or just a well:
|
||||
bool isWell = false;
|
||||
if (deck.hasField("WELSPECS")) {
|
||||
|
@@ -26,7 +26,7 @@
|
||||
#include <opm/core/grid.h>
|
||||
#include <opm/core/props/BlackoilPhases.hpp>
|
||||
#include <string>
|
||||
#include <boost/shared_ptr.hpp>
|
||||
#include <memory>
|
||||
|
||||
namespace Opm
|
||||
{
|
||||
@@ -232,7 +232,7 @@ namespace Opm
|
||||
|
||||
virtual WellsGroupInterface* findGroup(const std::string& name_of_node);
|
||||
|
||||
void addChild(boost::shared_ptr<WellsGroupInterface> child);
|
||||
void addChild(std::shared_ptr<WellsGroupInterface> child);
|
||||
|
||||
virtual bool conditionsMet(const std::vector<double>& well_bhp,
|
||||
const std::vector<double>& well_reservoirrates_phase,
|
||||
@@ -301,7 +301,7 @@ namespace Opm
|
||||
const std::vector<double>& well_surfacerates_phase);
|
||||
|
||||
private:
|
||||
std::vector<boost::shared_ptr<WellsGroupInterface> > children_;
|
||||
std::vector<std::shared_ptr<WellsGroupInterface> > children_;
|
||||
};
|
||||
|
||||
|
||||
@@ -402,7 +402,7 @@ namespace Opm
|
||||
/// Creates the WellsGroupInterface for the given name
|
||||
/// \param[in] name the name of the wells group.
|
||||
/// \param[in] deck the deck from which to fetch information.
|
||||
boost::shared_ptr<WellsGroupInterface> createWellsGroup(const std::string& name,
|
||||
std::shared_ptr<WellsGroupInterface> createWellsGroup(const std::string& name,
|
||||
const EclipseGridParser& deck);
|
||||
|
||||
|
||||
|
@@ -32,7 +32,7 @@
|
||||
|
||||
#include <iostream>
|
||||
#include <vector>
|
||||
#include <boost/shared_ptr.hpp>
|
||||
#include <memory>
|
||||
|
||||
BOOST_AUTO_TEST_CASE(Construction)
|
||||
{
|
||||
@@ -40,7 +40,7 @@ BOOST_AUTO_TEST_CASE(Construction)
|
||||
const int nwells = 2;
|
||||
const int nperfs = 2;
|
||||
|
||||
boost::shared_ptr<Wells> W(create_wells(nphases, nwells, nperfs),
|
||||
std::shared_ptr<Wells> W(create_wells(nphases, nwells, nperfs),
|
||||
destroy_wells);
|
||||
|
||||
if (W) {
|
||||
@@ -83,7 +83,7 @@ BOOST_AUTO_TEST_CASE(Controls)
|
||||
const int nwells = 1;
|
||||
const int nperfs = 2;
|
||||
|
||||
boost::shared_ptr<Wells> W(create_wells(nphases, nwells, nperfs),
|
||||
std::shared_ptr<Wells> W(create_wells(nphases, nwells, nperfs),
|
||||
destroy_wells);
|
||||
|
||||
if (W) {
|
||||
@@ -130,9 +130,9 @@ BOOST_AUTO_TEST_CASE(Copy)
|
||||
const int nwells = 2;
|
||||
const int nperfs = 2;
|
||||
|
||||
boost::shared_ptr<Wells> W1(create_wells(nphases, nwells, nperfs),
|
||||
std::shared_ptr<Wells> W1(create_wells(nphases, nwells, nperfs),
|
||||
destroy_wells);
|
||||
boost::shared_ptr<Wells> W2;
|
||||
std::shared_ptr<Wells> W2;
|
||||
|
||||
if (W1) {
|
||||
int cells[] = { 0, 9 };
|
||||
|
Reference in New Issue
Block a user