Commit 9b73db6e authored by Dennis Gläser's avatar Dennis Gläser
Browse files

Merge branch 'feature/maybe_unused-replace-DUNE_UNUSED' into 'master'

Feature/maybe unused replace dune unused

See merge request !2515
parents e9f526d4 3ca2e697
......@@ -323,7 +323,7 @@ protected:
// epsilon was added to the temperature. (this is case
// rarely happens, though)
const Scalar eps = - 1e-8;
bool DUNE_UNUSED hasExtrema = findExtrema_(minVm, maxVm, minP, maxP, a, b, T + eps);
[[maybe_unused]] bool hasExtrema = findExtrema_(minVm, maxVm, minP, maxP, a, b, T + eps);
assert(hasExtrema);
Scalar fStar = maxVm - minVm;
......
......@@ -481,8 +481,8 @@ void FvMpfaL3dPressure2pAdaptive<TypeTag>::assembleHangingNodeInteractionVolume(
Scalar volume4 = element4.geometry().volume();
Scalar volume5 = element5.geometry().volume();
Scalar volume6 = element6.geometry().volume();
Scalar volume7 DUNE_UNUSED = element7.geometry().volume();
Scalar volume8 DUNE_UNUSED = element8.geometry().volume();
[[maybe_unused]] Scalar volume7 = element7.geometry().volume();
[[maybe_unused]] Scalar volume8 = element8.geometry().volume();
// cell index
int globalIdx1 = problem_.variables().index(element1);
......
......@@ -301,7 +301,7 @@ void FvMpfaL3dPressureVelocity2p<TypeTag>::calculateVelocity(const Intersection&
auto elementI = intersection.inside();
auto elementJ = intersection.outside();
int eIdxGlobalI DUNE_UNUSED = problem_.variables().index(elementI);
[[maybe_unused]] int eIdxGlobalI = problem_.variables().index(elementI);
int eIdxGlobalJ = problem_.variables().index(elementJ);
CellData& cellDataJ = problem_.variables().cellData(eIdxGlobalJ);
......
......@@ -299,7 +299,7 @@ int FvMpfaL3dTransmissibilityCalculator<TypeTag>::transmissibility(Transmissibil
TransmissibilityType transCaseThree(0);
int DUNE_UNUSED transTypeCaseThree = transmissibilityCaseThree(transCaseThree, interactionVolume,
[[maybe_unused]] int transTypeCaseThree = transmissibilityCaseThree(transCaseThree, interactionVolume,
lambda, idx1, idx2, idx4, idx5);
transTypeTemp = transmissibilityCaseFour(transTemp, interactionVolume, lambda, idx1, idx2, idx3, idx6);
......@@ -319,7 +319,7 @@ int FvMpfaL3dTransmissibilityCalculator<TypeTag>::transmissibility(Transmissibil
{
TransmissibilityType transTemp(0);
int DUNE_UNUSED transTypeTemp = transmissibilityCaseOne(transTemp, interactionVolume,
[[maybe_unused]] int transTypeTemp = transmissibilityCaseOne(transTemp, interactionVolume,
lambda, idx1, idx2, idx3, idx5);
int transType = transmissibilityCaseTwo(transmissibility, interactionVolume, lambda, idx1, idx2, idx4, idx6);
......@@ -334,7 +334,7 @@ int FvMpfaL3dTransmissibilityCalculator<TypeTag>::transmissibility(Transmissibil
{
TransmissibilityType transTemp(0);
int DUNE_UNUSED transTypeTemp = transmissibilityCaseThree(transTemp, interactionVolume, lambda, idx1, idx2, idx4, idx5);
[[maybe_unused]] int transTypeTemp = transmissibilityCaseThree(transTemp, interactionVolume, lambda, idx1, idx2, idx4, idx5);
int transType = transmissibilityCaseFour(transmissibility, interactionVolume, lambda, idx1, idx2, idx3, idx6);
transType = chooseTransmissibility(transTemp, transmissibility, 3, 4);
......@@ -464,7 +464,7 @@ int FvMpfaL3dTransmissibilityCalculator<TypeTag>::transmissibility(Transmissibil
{
TransmissibilityType transTemp(0);
int DUNE_UNUSED transTypeTemp = transmissibilityCaseOne(transTemp, interactionVolume,
[[maybe_unused]] int transTypeTemp = transmissibilityCaseOne(transTemp, interactionVolume,
lambda, idx1, idx2, idx3, idx5);
int transType = transmissibilityCaseTwo(transmissibility, interactionVolume,
lambda, idx1, idx2, idx4, idx6);
......@@ -495,7 +495,7 @@ int FvMpfaL3dTransmissibilityCalculator<TypeTag>::transmissibility(Transmissibil
{
TransmissibilityType transTemp(0);
int DUNE_UNUSED transTypeTemp = transmissibilityCaseThree(transTemp, interactionVolume,
[[maybe_unused]] int transTypeTemp = transmissibilityCaseThree(transTemp, interactionVolume,
lambda, idx1, idx2, idx4, idx5);
int transType = transmissibilityCaseFour(transmissibility, interactionVolume,
lambda, idx1, idx2, idx3, idx6);
......
......@@ -3,7 +3,7 @@ dune_symlink_to_source_files(FILES "params.input")
dumux_add_test(NAME example_pnm1p_permeabilityupscaling
LABELS porenetwork example
SOURCES main.cc
CMAKE_GUARD HAVE_UMFPACK
CMAKE_GUARD HAVE_UMFPACK dune-foamgrid_FOUND
COMMAND ${CMAKE_CURRENT_BINARY_DIR}/example_pnm1p_permeabilityupscaling
CMD_ARGS -Problem.ReferenceData "2.95910919e-13 2.91015548e-13 2.71752264e-13"
-Problem.TestEpsilon 1e-7)
......@@ -24,7 +24,7 @@ int main (int argc, char *argv[])
if (!enableGravity) DUNE_THROW(Dune::InvalidStateException, "Gravity should be true!");
// use some given parameters
const auto DUNE_UNUSED cells = getParam<std::array<int, 2>>("Grid.Cells", std::array<int, 2>{{1, 1}});
const auto cells = getParam<std::array<int, 2>>("Grid.Cells", std::array<int, 2>{{1, 1}});
if (cells[0] != 100 || cells[1] != 100) DUNE_THROW(Dune::InvalidStateException, "Cells should be 100 100!");
auto tEnd = getParam<double>("TimeLoop.TEnd");
......
......@@ -53,7 +53,7 @@ int checkBinaryCoefficients()
// Test the function gasDiffCoeff:
try
{
Scalar DUNE_UNUSED val = BinaryCoefficients::gasDiffCoeff(t, p);
[[maybe_unused]] Scalar val = BinaryCoefficients::gasDiffCoeff(t, p);
} catch (Dune::NotImplemented&)
{
std::cout << "warning: " << className << "::gasDiffCoeff() is not implemented." << std::endl;
......@@ -66,7 +66,7 @@ int checkBinaryCoefficients()
// Test the function liquidDiffCoeff:
try
{
Scalar DUNE_UNUSED val = BinaryCoefficients::liquidDiffCoeff(t, p);
[[maybe_unused]] Scalar val = BinaryCoefficients::liquidDiffCoeff(t, p);
} catch (Dune::NotImplemented&)
{
std::cout << "warning: " << className << "::liquidDiffCoeff() is not implemented." << std::endl;
......
......@@ -262,7 +262,7 @@ int checkFluidState(const BaseFluidState &fs)
std::string collectedWarnings;
// make sure the fluid state provides all mandatory methods
Scalar DUNE_UNUSED val;
[[maybe_unused]] Scalar val;
try
{
......@@ -518,7 +518,7 @@ int checkFluidSystem(bool enablePhaseRestriction = true)
// some value to make sure the return values of the fluid system
// are convertible to scalars
Scalar DUNE_UNUSED val;
[[maybe_unused]] Scalar val;
// actually check the fluid system API
for (int phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx)
......@@ -631,10 +631,8 @@ int checkFluidSystem(bool enablePhaseRestriction = true)
// test for phaseName(), isGas() and isIdealGas()
for (int phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx)
{
std::string
DUNE_UNUSED name = FluidSystem::phaseName(phaseIdx);
bool DUNE_UNUSED
bVal = FluidSystem::isGas(phaseIdx);
[[maybe_unused]] std::string name = FluidSystem::phaseName(phaseIdx);
[[maybe_unused]] bool bVal = FluidSystem::isGas(phaseIdx);
bVal = FluidSystem::isIdealGas(phaseIdx);
}
......@@ -642,8 +640,7 @@ int checkFluidSystem(bool enablePhaseRestriction = true)
for (int compIdx = 0; compIdx < numComponents; ++compIdx)
{
val = FluidSystem::molarMass(compIdx);
std::string
DUNE_UNUSED name = FluidSystem::componentName(compIdx);
[[maybe_unused]] std::string name = FluidSystem::componentName(compIdx);
}
std::cout << collectedErrors;
......
......@@ -32,7 +32,6 @@
#include <iostream>
#include <dune/common/classname.hh>
#include <dune/common/unused.hh>
#include <dune/common/exceptions.hh>
// include all solid states
......@@ -69,24 +68,24 @@ int checkSolidSystem()
// some value to make sure the return values of the solid system
// are convertible to scalars
Scalar DUNE_UNUSED val;
[[maybe_unused]] Scalar val;
// test for componentName and isCompressible
for (int phaseIdx = 0; phaseIdx < numComponents; ++phaseIdx)
{
std::string name DUNE_UNUSED= SolidSystem::componentName(phaseIdx);
bool DUNE_UNUSED bVal = SolidSystem::isCompressible(phaseIdx);
[[maybe_unused]] std::string name = SolidSystem::componentName(phaseIdx);
[[maybe_unused]] bool bVal = SolidSystem::isCompressible(phaseIdx);
val = SolidSystem::molarMass(phaseIdx);
}
// test for componentName
for (int compIdx = 0; compIdx < numComponents; ++compIdx)
{
std::string name DUNE_UNUSED= SolidSystem::componentName(compIdx);
[[maybe_unused]] std::string name = SolidSystem::componentName(compIdx);
}
// test for name
std::string name DUNE_UNUSED = SolidSystem::name();
[[maybe_unused]] std::string name = SolidSystem::name();
try
{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment