changed: get rid of OPM_UNUSED macro usages

prefer anonymous parameters or c++17 [[maybe_unused]]
This commit is contained in:
Arne Morten Kvarving 2021-08-02 14:55:41 +02:00
parent ea4e4a1520
commit 78c5675daf
9 changed files with 43 additions and 39 deletions

View File

@ -72,7 +72,7 @@ public:
* aquifer pressure and the base run's total produced liquid
* volume from the model's aquifers.
*/
void initFromRestart(const data::Aquifers& aquiferSoln OPM_UNUSED)
void initFromRestart(const data::Aquifers&)
{
throw std::logic_error {
"Initialization from restart data not supported "
@ -102,10 +102,10 @@ public:
* \brief Add the water which enters or leaves the reservoir due to aquifiers.
*/
template <class Context>
void addToSource(RateVector& rate OPM_UNUSED,
const Context& context OPM_UNUSED,
unsigned spaceIdx OPM_UNUSED,
unsigned timeIdx OPM_UNUSED) const
void addToSource(RateVector&,
const Context&,
unsigned,
unsigned) const
{ }
/*!
@ -138,7 +138,7 @@ public:
* format.
*/
template <class Restarter>
void serialize(Restarter& res OPM_UNUSED)
void serialize(Restarter&)
{ }
/*!
@ -146,7 +146,7 @@ public:
* format.
*/
template <class Restarter>
void deserialize(Restarter& res OPM_UNUSED)
void deserialize(Restarter&)
{ }

View File

@ -59,39 +59,39 @@ public:
{ }
template <bool prepareValues = true, bool prepareGradients = true>
void prepare(const ElementContext& elemCtx OPM_UNUSED, unsigned timeIdx OPM_UNUSED)
void prepare(const ElementContext&, unsigned)
{ }
template <class QuantityCallback, class QuantityType = Scalar>
QuantityType calculateValue(const ElementContext& elemCtx OPM_UNUSED,
unsigned fapIdx OPM_UNUSED,
const QuantityCallback& quantityCallback OPM_UNUSED) const
QuantityType calculateValue(const ElementContext&,
unsigned,
const QuantityCallback&) const
{
throw std::logic_error("Generic values are not supported by the ECL black-oil simulator");
}
template <class QuantityCallback>
void calculateGradient(DimVector& quantityGrad OPM_UNUSED,
const ElementContext& elemCtx OPM_UNUSED,
unsigned fapIdx OPM_UNUSED,
const QuantityCallback& quantityCallback OPM_UNUSED) const
void calculateGradient(DimVector&,
const ElementContext&,
unsigned,
const QuantityCallback&) const
{
throw std::logic_error("Generic gradients are not supported by the ECL black-oil simulator");
}
template <class QuantityCallback>
Scalar calculateBoundaryValue(const ElementContext& elemCtx OPM_UNUSED,
unsigned fapIdx OPM_UNUSED,
const QuantityCallback& quantityCallback OPM_UNUSED)
Scalar calculateBoundaryValue(const ElementContext&,
unsigned,
const QuantityCallback&)
{
throw std::logic_error("Generic boundary values are not supported by the ECL black-oil simulator");
}
template <class QuantityCallback>
void calculateBoundaryGradient(DimVector& quantityGrad OPM_UNUSED,
const ElementContext& elemCtx OPM_UNUSED,
unsigned fapIdx OPM_UNUSED,
const QuantityCallback& quantityCallback OPM_UNUSED) const
void calculateBoundaryGradient(DimVector&,
const ElementContext&,
unsigned,
const QuantityCallback&) const
{
throw std::logic_error("Generic boundary gradients are not supported by the ECL black-oil simulator");
}

View File

@ -87,7 +87,7 @@ class EclTransIntensiveQuantities
{
using ElementContext = GetPropType<TypeTag, Properties::ElementContext>;
protected:
void update_(const ElementContext& elemCtx OPM_UNUSED, unsigned dofIdx OPM_UNUSED, unsigned timeIdx OPM_UNUSED)
void update_(const ElementContext&, unsigned, unsigned)
{ }
};
@ -134,7 +134,7 @@ public:
*
* \param phaseIdx The index of the fluid phase
*/
const EvalDimVector& potentialGrad(unsigned phaseIdx OPM_UNUSED) const
const EvalDimVector& potentialGrad(unsigned) const
{
throw std::invalid_argument("The ECL transmissibility module does not provide explicit potential gradients");
}
@ -154,7 +154,7 @@ public:
*
* \param phaseIdx The index of the fluid phase
*/
const EvalDimVector& filterVelocity(unsigned phaseIdx OPM_UNUSED) const
const EvalDimVector& filterVelocity(unsigned) const
{
throw std::invalid_argument("The ECL transmissibility module does not provide explicit filter velocities");
}
@ -470,10 +470,10 @@ protected:
/*!
* \brief Update the volumetric fluxes for all fluid phases on the interior faces of the context
*/
void calculateFluxes_(const ElementContext& elemCtx OPM_UNUSED, unsigned scvfIdx OPM_UNUSED, unsigned timeIdx OPM_UNUSED)
void calculateFluxes_(const ElementContext&, unsigned, unsigned)
{ }
void calculateBoundaryFluxes_(const ElementContext& elemCtx OPM_UNUSED, unsigned scvfIdx OPM_UNUSED, unsigned timeIdx OPM_UNUSED)
void calculateBoundaryFluxes_(const ElementContext&, unsigned, unsigned)
{}
private:

View File

@ -145,7 +145,7 @@ public:
return this->error_ <= this->tolerance() && errorSum_ <= sumTolerance_;
}
void preSolve_(const SolutionVector& currentSolution OPM_UNUSED,
void preSolve_(const SolutionVector&,
const GlobalEqVector& currentResidual)
{
const auto& constraintsMap = this->model().linearizer().constraintsMap();

View File

@ -577,7 +577,7 @@ public:
* to the hard disk.
*/
template <class Restarter>
void serialize(Restarter& res OPM_UNUSED)
void serialize(Restarter&)
{
/* do nothing: Everything which we need here is provided by the deck->.. */
}
@ -589,7 +589,7 @@ public:
* It is the inverse of the serialize() method.
*/
template <class Restarter>
void deserialize(Restarter& res OPM_UNUSED)
void deserialize(Restarter&)
{
// initialize the wells for the current episode
beginEpisode(/*wasRestarted=*/true);
@ -619,7 +619,7 @@ public:
ScheduleEvents::WELL_STATUS_CHANGE );
}
void initFromRestartFile(const RestartValue& restartValues OPM_UNUSED){
void initFromRestartFile(const RestartValue&) {
throw std::logic_error("initFromRestartFile() method not implemented for class eclwellmanager");
}
@ -683,7 +683,7 @@ public:
protected:
bool wellTopologyChanged_(const EclipseState& eclState OPM_UNUSED,
bool wellTopologyChanged_(const EclipseState&,
const Schedule& schedule,
unsigned reportStepIdx) const
{
@ -702,7 +702,7 @@ protected:
ScheduleEvents::COMPLETION_CHANGE);
}
void updateWellTopology_(unsigned reportStepIdx OPM_UNUSED,
void updateWellTopology_(unsigned,
const WellConnectionsMap& wellConnections,
std::vector<bool>& gridDofIsPenetrated) const
{
@ -762,7 +762,8 @@ protected:
}
}
void computeWellConnectionsMap_(unsigned reportStepIdx OPM_UNUSED, WellConnectionsMap& cartesianIdxToConnectionMap)
void computeWellConnectionsMap_(unsigned reportStepIdx,
WellConnectionsMap& cartesianIdxToConnectionMap)
{
const auto& deckSchedule = simulator_.vanguard().schedule();

View File

@ -401,7 +401,7 @@ namespace Opm {
/// Called once after each time step.
/// In this class, this function does nothing.
/// \param[in] timer simulation timer
SimulatorReportSingle afterStep(const SimulatorTimerInterface& timer OPM_UNUSED)
SimulatorReportSingle afterStep(const SimulatorTimerInterface&)
{
SimulatorReportSingle report;
Dune::Timer perfTimer;

View File

@ -190,7 +190,10 @@ void getSparsityPattern(BridgeMatrix& mat, std::vector<int> &h_rows, std::vector
template <class BridgeMatrix, class BridgeVector, int block_size>
void BdaBridge<BridgeMatrix, BridgeVector, block_size>::solve_system(BridgeMatrix *mat OPM_UNUSED, BridgeVector &b OPM_UNUSED, WellContributions& wellContribs OPM_UNUSED, InverseOperatorResult &res OPM_UNUSED)
void BdaBridge<BridgeMatrix, BridgeVector, block_size>::solve_system([[maybe_unused]] BridgeMatrix* mat,
[[maybe_unused]] BridgeVector& b,
[[maybe_unused]] WellContributions& wellContribs,
[[maybe_unused]] InverseOperatorResult& res)
{
if (use_gpu || use_fpga) {
@ -256,7 +259,7 @@ void BdaBridge<BridgeMatrix, BridgeVector, block_size>::solve_system(BridgeMatri
template <class BridgeMatrix, class BridgeVector, int block_size>
void BdaBridge<BridgeMatrix, BridgeVector, block_size>::get_result(BridgeVector &x OPM_UNUSED) {
void BdaBridge<BridgeMatrix, BridgeVector, block_size>::get_result([[maybe_unused]] BridgeVector& x) {
if (use_gpu || use_fpga) {
backend->get_result(static_cast<double*>(&(x[0][0])));
}

View File

@ -222,7 +222,7 @@ void FpgaSolverBackend<block_size>::get_result(double *x_)
template <unsigned int block_size>
SolverStatus FpgaSolverBackend<block_size>::solve_system(int N_, int nnz_, int dim, double *vals, int *rows, int *cols, double *b, WellContributions& wellContribs OPM_UNUSED, BdaResult &res)
SolverStatus FpgaSolverBackend<block_size>::solve_system(int N_, int nnz_, int dim, double *vals, int *rows, int *cols, double *b, WellContributions&, BdaResult &res)
{
if (initialized == false) {
initialize(N_, nnz_, dim, vals, rows, cols);

View File

@ -358,7 +358,7 @@ void amgclSolverBackend<block_size>::get_result(double *x_) {
template <unsigned int block_size>
SolverStatus amgclSolverBackend<block_size>::solve_system(int N_, int nnz_, int dim, double *vals, int *rows, int *cols, double *b, WellContributions& wellContribs OPM_UNUSED, BdaResult &res) {
SolverStatus amgclSolverBackend<block_size>::solve_system(int N_, int nnz_, int dim, double *vals, int *rows, int *cols, double *b, WellContributions&, BdaResult &res) {
if (initialized == false) {
initialize(N_, nnz_, dim);
convert_sparsity_pattern(rows, cols);