Fix Build After "Unused.hpp" Removal

Needed for configurations that don't have Dune-localfunctions or
which *do* have ALUGrid.
This commit is contained in:
Bård Skaflestad 2022-08-04 15:09:11 +02:00
parent 000ed8b8ae
commit 326449fe0b
2 changed files with 49 additions and 57 deletions

View File

@ -345,9 +345,9 @@ public:
* \copydoc FvBaseMultiPhaseProblem::temperature
*/
template <class Context>
Scalar temperature(const Context& context OPM_UNUSED,
unsigned spaceIdx OPM_UNUSED,
unsigned timeIdx OPM_UNUSED) const
Scalar temperature([[maybe_unused]] const Context& context,
[[maybe_unused]] unsigned spaceIdx,
[[maybe_unused]] unsigned timeIdx) const
{ return temperature_; }
// \}
@ -361,9 +361,9 @@ public:
* \copydoc FvBaseMultiPhaseProblem::intrinsicPermeability
*/
template <class Context>
const DimMatrix& intrinsicPermeability(const Context& context OPM_UNUSED,
unsigned spaceIdx OPM_UNUSED,
unsigned timeIdx OPM_UNUSED) const
const DimMatrix& intrinsicPermeability([[maybe_unused]] const Context& context,
[[maybe_unused]] unsigned spaceIdx,
[[maybe_unused]] unsigned timeIdx) const
{ return matrixK_; }
/*!
@ -372,18 +372,18 @@ public:
* \copydoc Doxygen::contextParams
*/
template <class Context>
const DimMatrix& fractureIntrinsicPermeability(const Context& context OPM_UNUSED,
unsigned spaceIdx OPM_UNUSED,
unsigned timeIdx OPM_UNUSED) const
const DimMatrix& fractureIntrinsicPermeability([[maybe_unused]] const Context& context,
[[maybe_unused]] unsigned spaceIdx,
[[maybe_unused]] unsigned timeIdx) const
{ return fractureK_; }
/*!
* \copydoc FvBaseMultiPhaseProblem::porosity
*/
template <class Context>
Scalar porosity(const Context& context OPM_UNUSED,
unsigned spaceIdx OPM_UNUSED,
unsigned timeIdx OPM_UNUSED) const
Scalar porosity([[maybe_unused]] const Context& context,
[[maybe_unused]] unsigned spaceIdx,
[[maybe_unused]] unsigned timeIdx) const
{ return matrixPorosity_; }
/*!
@ -392,18 +392,18 @@ public:
* \copydoc Doxygen::contextParams
*/
template <class Context>
Scalar fracturePorosity(const Context& context OPM_UNUSED,
unsigned spaceIdx OPM_UNUSED,
unsigned timeIdx OPM_UNUSED) const
Scalar fracturePorosity([[maybe_unused]] const Context& context,
[[maybe_unused]] unsigned spaceIdx,
[[maybe_unused]] unsigned timeIdx) const
{ return fracturePorosity_; }
/*!
* \copydoc FvBaseMultiPhaseProblem::materialLawParams
*/
template <class Context>
const MaterialLawParams& materialLawParams(const Context& context OPM_UNUSED,
unsigned spaceIdx OPM_UNUSED,
unsigned timeIdx OPM_UNUSED) const
const MaterialLawParams& materialLawParams([[maybe_unused]] const Context& context,
[[maybe_unused]] unsigned spaceIdx,
[[maybe_unused]] unsigned timeIdx) const
{ return matrixMaterialParams_; }
/*!
@ -412,9 +412,9 @@ public:
* \copydoc Doxygen::contextParams
*/
template <class Context>
const MaterialLawParams& fractureMaterialLawParams(const Context& context OPM_UNUSED,
unsigned spaceIdx OPM_UNUSED,
unsigned timeIdx OPM_UNUSED) const
const MaterialLawParams& fractureMaterialLawParams([[maybe_unused]] const Context& context,
[[maybe_unused]] unsigned spaceIdx,
[[maybe_unused]] unsigned timeIdx) const
{ return fractureMaterialParams_; }
/*!
@ -436,10 +436,10 @@ public:
* \param timeIdx The index used by the time discretization.
*/
template <class Context>
Scalar fractureWidth(const Context& context OPM_UNUSED,
unsigned spaceIdx1 OPM_UNUSED,
unsigned spaceIdx2 OPM_UNUSED,
unsigned timeIdx OPM_UNUSED) const
Scalar fractureWidth([[maybe_unused]] const Context& context,
[[maybe_unused]] unsigned spaceIdx1,
[[maybe_unused]] unsigned spaceIdx2,
[[maybe_unused]] unsigned timeIdx) const
{ return fractureWidth_; }
/*!
@ -447,9 +447,9 @@ public:
*/
template <class Context>
const ThermalConductionLawParams&
thermalConductionLawParams(const Context& context OPM_UNUSED,
unsigned spaceIdx OPM_UNUSED,
unsigned timeIdx OPM_UNUSED) const
thermalConductionLawParams([[maybe_unused]] const Context& context,
[[maybe_unused]] unsigned spaceIdx,
[[maybe_unused]] unsigned timeIdx) const
{ return thermalConductionParams_; }
/*!
@ -459,9 +459,9 @@ public:
*/
template <class Context>
const SolidEnergyLawParams&
solidEnergyLawParams(const Context& context OPM_UNUSED,
unsigned spaceIdx OPM_UNUSED,
unsigned timeIdx OPM_UNUSED) const
solidEnergyLawParams([[maybe_unused]] const Context& context,
[[maybe_unused]] unsigned spaceIdx,
[[maybe_unused]] unsigned timeIdx) const
{ return solidEnergyParams_; }
// \}
@ -569,9 +569,9 @@ public:
*/
template <class Context>
void initial(PrimaryVariables& values,
const Context& context OPM_UNUSED,
unsigned spaceIdx OPM_UNUSED,
unsigned timeIdx OPM_UNUSED) const
[[maybe_unused]] const Context& context,
[[maybe_unused]] unsigned spaceIdx,
[[maybe_unused]] unsigned timeIdx) const
{
FluidState fluidState;
fluidState.setTemperature(temperature_);
@ -593,9 +593,9 @@ public:
*/
template <class Context>
void source(RateVector& rate,
const Context& context OPM_UNUSED,
unsigned spaceIdx OPM_UNUSED,
unsigned timeIdx OPM_UNUSED) const
[[maybe_unused]] const Context& context,
[[maybe_unused]] unsigned spaceIdx,
[[maybe_unused]] unsigned timeIdx) const
{ rate = Scalar(0.0); }
// \}

View File

@ -45,12 +45,6 @@
#include <vector>
#ifdef HAVE_DUNE_LOCALFUNCTIONS
#define EWOMS_NO_LOCALFUNCTIONS_UNUSED
#else
#define EWOMS_NO_LOCALFUNCTIONS_UNUSED OPM_UNUSED
#endif
namespace Opm {
/*!
* \ingroup FiniteElementDiscretizations
@ -96,8 +90,8 @@ public:
* \param elemCtx The current execution context
*/
template <bool prepareValues = true, bool prepareGradients = true>
void prepare(const ElementContext& elemCtx EWOMS_NO_LOCALFUNCTIONS_UNUSED,
unsigned timeIdx EWOMS_NO_LOCALFUNCTIONS_UNUSED)
void prepare([[maybe_unused]] const ElementContext& elemCtx,
[[maybe_unused]] unsigned timeIdx)
{
if (getPropValue<TypeTag, Properties::UseP1FiniteElementGradients>()) {
#if !HAVE_DUNE_LOCALFUNCTIONS
@ -156,9 +150,9 @@ public:
* freedom
*/
template <class QuantityCallback>
auto calculateScalarValue(const ElementContext& elemCtx EWOMS_NO_LOCALFUNCTIONS_UNUSED,
unsigned fapIdx EWOMS_NO_LOCALFUNCTIONS_UNUSED,
const QuantityCallback& quantityCallback EWOMS_NO_LOCALFUNCTIONS_UNUSED) const
auto calculateScalarValue([[maybe_unused]] const ElementContext& elemCtx,
[[maybe_unused]] unsigned fapIdx,
[[maybe_unused]] const QuantityCallback& quantityCallback) const
-> typename std::remove_reference<typename QuantityCallback::ResultType>::type
{
if (getPropValue<TypeTag, Properties::UseP1FiniteElementGradients>()) {
@ -201,9 +195,9 @@ public:
* freedom
*/
template <class QuantityCallback>
auto calculateVectorValue(const ElementContext& elemCtx EWOMS_NO_LOCALFUNCTIONS_UNUSED,
unsigned fapIdx EWOMS_NO_LOCALFUNCTIONS_UNUSED,
const QuantityCallback& quantityCallback EWOMS_NO_LOCALFUNCTIONS_UNUSED) const
auto calculateVectorValue([[maybe_unused]] const ElementContext& elemCtx,
[[maybe_unused]] unsigned fapIdx,
[[maybe_unused]] const QuantityCallback& quantityCallback) const
-> typename std::remove_reference<typename QuantityCallback::ResultType>::type
{
if (getPropValue<TypeTag, Properties::UseP1FiniteElementGradients>()) {
@ -257,10 +251,10 @@ public:
* freedom
*/
template <class QuantityCallback, class EvalDimVector>
void calculateGradient(EvalDimVector& quantityGrad EWOMS_NO_LOCALFUNCTIONS_UNUSED,
const ElementContext& elemCtx EWOMS_NO_LOCALFUNCTIONS_UNUSED,
unsigned fapIdx EWOMS_NO_LOCALFUNCTIONS_UNUSED,
const QuantityCallback& quantityCallback EWOMS_NO_LOCALFUNCTIONS_UNUSED) const
void calculateGradient([[maybe_unused]] EvalDimVector& quantityGrad,
[[maybe_unused]] const ElementContext& elemCtx,
[[maybe_unused]] unsigned fapIdx,
[[maybe_unused]] const QuantityCallback& quantityCallback) const
{
if (getPropValue<TypeTag, Properties::UseP1FiniteElementGradients>()) {
#if !HAVE_DUNE_LOCALFUNCTIONS
@ -360,6 +354,4 @@ P1FeGradientCalculator<TypeTag>::feCache_;
#endif
} // namespace Opm
#undef EWOMS_NO_LOCALFUNCTIONS_UNUSED
#endif