Merge pull request #3273 from akva2/clang_cleanups

Quell various clang warnings
This commit is contained in:
Atgeirr Flø Rasmussen 2021-05-21 09:22:31 +02:00 committed by GitHub
commit dee7030784
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 24 additions and 23 deletions

View File

@ -52,6 +52,8 @@
namespace Opm {
std::optional<std::function<std::vector<int> (const Dune::CpGrid&)>> externalLoadBalancer;
template<class ElementMapper, class GridView, class Scalar>
EclGenericCpGridVanguard<ElementMapper,GridView,Scalar>::EclGenericCpGridVanguard()
{
@ -102,7 +104,7 @@ void EclGenericCpGridVanguard<ElementMapper,GridView,Scalar>::doLoadBalance_(Dun
const auto& gridView = grid_->leafGridView();
unsigned numFaces = grid_->numFaces();
std::vector<double> faceTrans;
int loadBalancerSet = externalLoadBalancer_.has_value();
int loadBalancerSet = externalLoadBalancer.has_value();
grid_->comm().broadcast(&loadBalancerSet, 1, 0);
if (!loadBalancerSet){
faceTrans.resize(numFaces, 0.0);
@ -150,7 +152,7 @@ void EclGenericCpGridVanguard<ElementMapper,GridView,Scalar>::doLoadBalance_(Dun
std::vector<int> parts;
if (grid_->comm().rank() == 0)
{
parts = (*externalLoadBalancer_)(*grid_);
parts = (*externalLoadBalancer)(*grid_);
}
parallelWells = std::get<1>(grid_->loadBalance(handle, parts, &wells, ownersFirst, false, 1));
}
@ -367,10 +369,6 @@ Scalar EclGenericCpGridVanguard<ElementMapper,GridView,Scalar>::computeCellThick
return zz2-zz1;
}
template<class ElementMapper, class GridView, class Scalar>
std::optional<std::function<std::vector<int> (const Dune::CpGrid&)>>
EclGenericCpGridVanguard<ElementMapper,GridView,Scalar>::externalLoadBalancer_;
#if HAVE_DUNE_FEM
template class EclGenericCpGridVanguard<Dune::MultipleCodimMultipleGeomTypeMapper<
Dune::GridView<

View File

@ -34,6 +34,11 @@
namespace Opm {
/// \brief optional functor returning external load balancing information
///
/// If it is set then this will be used during loadbalance.
extern std::optional<std::function<std::vector<int> (const Dune::CpGrid&)>> externalLoadBalancer;
template<class ElementMapper, class GridView, class Scalar>
class EclGenericCpGridVanguard {
protected:
@ -43,6 +48,8 @@ protected:
public:
EclGenericCpGridVanguard();
virtual ~EclGenericCpGridVanguard() = default;
/*!
* \brief Return a reference to the simulation grid.
*/
@ -80,7 +87,7 @@ public:
/// The information is a vector of integers indication the partition index for each cell id.
static void setExternalLoadBalancer(const std::function<std::vector<int> (const Dune::CpGrid&)>& loadBalancer)
{
externalLoadBalancer_ = loadBalancer;
externalLoadBalancer = loadBalancer;
}
/*!
@ -129,10 +136,6 @@ protected:
std::unique_ptr<CartesianIndexMapper> cartesianIndexMapper_;
std::unique_ptr<CartesianIndexMapper> equilCartesianIndexMapper_;
/// \brief optional functor returning external load balancing information
///
/// If it is set then this will be used during loadbalance.
static std::optional<std::function<std::vector<int> (const Dune::CpGrid&)>> externalLoadBalancer_;
int mpiRank;
};

View File

@ -45,7 +45,7 @@ namespace Action { class State; }
class Deck;
class EclipseState;
class ErrorGuard;
class NumericalAquiferCell;
struct NumericalAquiferCell;
class ParseContext;
class Schedule;
class Python;

View File

@ -49,19 +49,19 @@ class RestartValue;
namespace data
{
class CellData;
class Connection;
class CurrentControl;
struct CellData;
struct Connection;
struct CurrentControl;
class GroupAndNetworkValues;
class GroupConstraints;
class GroupData;
class GroupGuideRates;
struct GroupConstraints;
struct GroupData;
struct GroupGuideRates;
class GuideRateValue;
class NodeData;
struct NodeData;
class Rates;
class Segment;
struct Segment;
class Solution;
class Well;
struct Well;
class WellRates;
}

View File

@ -32,7 +32,7 @@ namespace Opm
class DeferredLogger;
class GroupState;
class PhaseUsage;
struct PhaseUsage;
namespace WellGroupHelpers
{

View File

@ -34,7 +34,7 @@ class DeferredLogger;
class Group;
class GroupState;
namespace Network { class ExtNetwork; }
class PhaseUsage;
struct PhaseUsage;
class Schedule;
class VFPProdProperties;
class WellStateFullyImplicitBlackoil;