Commit 133356fc authored by Praetorius, Simon's avatar Praetorius, Simon

Merge branch 'feature/attributes' into 'master'

use standard attributes instead of dune macros

See merge request !222
parents beedaf81 f47c56f1
Pipeline #5095 passed with stage
in 39 minutes and 47 seconds
......@@ -24,7 +24,7 @@ namespace AMDiS
* }
*
**/
inline void DUNE_DEPRECATED init(int& argc, char**& argv, std::string const& initFileName = "")
inline void [[deprecated]] init(int& argc, char**& argv, std::string const& initFileName = "")
{
static Environment env(argc, argv, initFileName);
}
......@@ -35,6 +35,6 @@ namespace AMDiS
*
* The \ref Environment is closed automatically on destruction.
**/
inline void DUNE_DEPRECATED finalize() { /* no nothing */ }
inline void [[deprecated]] finalize() { /* no nothing */ }
} // end namespace AMDiS
......@@ -24,24 +24,22 @@ namespace AMDiS
// dune version independent creation of node from preBasis
template <class PB, class TP>
auto makeNode(PB const& preBasis, TP const& treePath)
auto makeNode(PB const& preBasis, [[maybe_unused]] TP const& treePath)
{
#if DUNE_VERSION_LT(DUNE_FUNCTIONS,2,7)
return preBasis.node(treePath);
#else
DUNE_UNUSED_PARAMETER(treePath);
return preBasis.makeNode();
#endif
}
// dune version independent creation of node from preBasis
template <class PB, class TP>
auto makeNodeIndexSet(PB const& preBasis, TP const& treePath)
auto makeNodeIndexSet(PB const& preBasis, [[maybe_unused]] TP const& treePath)
{
#if DUNE_VERSION_LT(DUNE_FUNCTIONS,2,7)
return preBasis.indexSet(treePath);
#else
DUNE_UNUSED_PARAMETER(treePath);
return preBasis.makeIndexSet();
#endif
}
......
......@@ -49,9 +49,8 @@ namespace AMDiS
using Communication = C;
template <class Basis>
static Communication create(Basis const& basis, std::string const& prefix = "")
static Communication create(Basis const& basis, [[maybe_unused]] std::string const& prefix = "")
{
DUNE_UNUSED_PARAMETER(prefix);
return DefaultCommunicationCreator<C>::create(basis);
}
};
......
......@@ -49,10 +49,8 @@ namespace AMDiS
}
/// Implements \ref RunnerInterface::solve()
int solve(M const& A, X& x, Y const& b, SolverInfo& solverInfo) override
int solve([[maybe_unused]] M const& A, X& x, Y const& b, SolverInfo& solverInfo) override
{
DUNE_UNUSED_PARAMETER(A);
x = solver_.solveWithGuess(b, x);
Y r = b;
......
......@@ -76,7 +76,7 @@ namespace AMDiS
{
static void init(std::string const& prefix, Eigen::UmfPackLU<M>& solver)
{
DUNE_UNUSED auto& control = solver.umfpackControl();
[[maybe_unused]] auto& control = solver.umfpackControl();
// TODO: initialized umfpack parameters
}
};
......
......@@ -38,9 +38,8 @@ namespace AMDiS
template <class Smoother, class LinOp, class Criterion, class Comm>
static std::unique_ptr<PrecBase>
create(std::string prefix, LinOp const& linOp, Criterion const& criterion, SmootherArgs<Smoother> const& smootherArgs, Comm const& comm)
create([[maybe_unused]] std::string prefix, LinOp const& linOp, Criterion const& criterion, SmootherArgs<Smoother> const& smootherArgs, Comm const& comm)
{
DUNE_UNUSED_PARAMETER(prefix);
using Solver = Dune::Amg::AMG<LinOp, typename Traits::X, Smoother, Comm>;
return std::make_unique<Solver>(linOp, criterion, smootherArgs, comm);
}
......@@ -59,10 +58,9 @@ namespace AMDiS
template <class Smoother, class LinOp, class Criterion>
static std::unique_ptr<PrecBase>
create(std::string prefix, LinOp const& linOp, Criterion const& criterion, SmootherArgs<Smoother> const& smootherArgs,
create(std::string prefix, LinOp const& linOp, Criterion const& criterion, [[maybe_unused]] SmootherArgs<Smoother> const& smootherArgs,
Dune::Amg::SequentialInformation const& comm)
{
DUNE_UNUSED_PARAMETER(smootherArgs);
bool symmetric = Parameters::get<bool>(prefix + "->symmetric").value_or(true);
using Solver = Dune::Amg::FastAMG<LinOp, typename Traits::X, Dune::Amg::SequentialInformation>;
......@@ -98,9 +96,8 @@ namespace AMDiS
template <class Smoother, class LinOp, class Criterion, class Comm>
static std::unique_ptr<PrecBase>
create(std::string prefix, LinOp const& linOp, Criterion const& criterion, SmootherArgs<Smoother> const& smootherArgs, Comm const& comm)
create(std::string prefix, LinOp const& linOp, Criterion const& criterion, [[maybe_unused]] SmootherArgs<Smoother> const& smootherArgs, Comm const& comm)
{
DUNE_UNUSED_PARAMETER(smootherArgs);
std::string solver = Parameters::get<std::string>(prefix + "->krylov solver").value_or("default");
std::size_t maxLevelKrylovSteps = 3;
......@@ -332,9 +329,8 @@ namespace AMDiS
}
std::unique_ptr<Interface>
createImpl1(SolverCategory cat, M const& mat, Dune::Amg::SequentialInformation const& comm) const
createImpl1([[maybe_unused]] SolverCategory cat, M const& mat, Dune::Amg::SequentialInformation const& comm) const
{
DUNE_UNUSED_PARAMETER(cat);
assert(cat == SolverCategory::sequential);
using LinOp = Dune::MatrixAdapter<M,X,Y>;
LinOp* linOpPtr = new LinOp(mat);
......
......@@ -61,9 +61,8 @@ namespace AMDiS
using Super::Super; // inheriting constructor
std::unique_ptr<typename Traits::Prec>
create(typename Traits::M const& mat, typename Traits::Comm const& comm) const override
create(typename Traits::M const& mat, [[maybe_unused]] typename Traits::Comm const& comm) const override
{
DUNE_UNUSED_PARAMETER(comm);
return std::make_unique<Precon>(mat, this->iter_, this->w_);
}
};
......@@ -78,10 +77,8 @@ namespace AMDiS
using Super::Super; // inheriting constructor
std::unique_ptr<typename Traits::Prec>
create(typename Traits::M const& mat, typename Traits::Comm const& comm) const override
create([[maybe_unused]] typename Traits::M const& mat, [[maybe_unused]] typename Traits::Comm const& comm) const override
{
DUNE_UNUSED_PARAMETER(mat);
DUNE_UNUSED_PARAMETER(comm);
using Precon = Dune::Richardson<X, Y>;
return std::make_unique<Precon>(this->w_);
}
......@@ -97,9 +94,8 @@ namespace AMDiS
using Super::Super; // inheriting constructor
std::unique_ptr<typename Traits::Prec>
create(typename Traits::M const& mat, typename Traits::Comm const& comm) const override
create(typename Traits::M const& mat, [[maybe_unused]] typename Traits::Comm const& comm) const override
{
DUNE_UNUSED_PARAMETER(comm);
using Precon = Dune::SeqILDL<M, X, Y>;
return std::make_unique<Precon>(mat, this->w_);
}
......
......@@ -123,7 +123,7 @@ namespace AMDiS
mtl::HypreParVector x(in); // use b as initial guess
mtl::HypreParVector b(in);
DUNE_UNUSED int error = HYPRE_BoomerAMGSolve(solver_, matrix_, b, x);
[[maybe_unused]] int error = HYPRE_BoomerAMGSolve(solver_, matrix_, b, x);
assert(error != 0);
// write output back to MTL vector
......@@ -137,7 +137,7 @@ namespace AMDiS
mtl::HypreParVector x(in); // use b as initial guess
mtl::HypreParVector b(in);
DUNE_UNUSED int error = HYPRE_BoomerAMGSolveT(solver_, matrix_, b, x);
[[maybe_unused]] int error = HYPRE_BoomerAMGSolveT(solver_, matrix_, b, x);
assert(error != 0);
// write output back to MTL vector
......
......@@ -95,10 +95,9 @@ namespace AMDiS
}
/// Implements \ref RunnerInterface::solve()
int solve(M const& A, X& x, Y const& b, SolverInfo& solverInfo) override
int solve([[maybe_unused]] M const& A, X& x, Y const& b, SolverInfo& solverInfo) override
{
assert(initialized_);
DUNE_UNUSED_PARAMETER(A);
KSPSolve(ksp_, b, x);
......
......@@ -87,9 +87,8 @@ namespace AMDiS
private:
template <class MessageBuffer, class Entity, int cd>
void scatterImpl(MessageBuffer& buff, Entity const& e, std::size_t n, int_t<cd>)
void scatterImpl(MessageBuffer& buff, Entity const& e, [[maybe_unused]] std::size_t n, int_t<cd>)
{
DUNE_UNUSED_PARAMETER(n); // n == 1
assert(n == 1);
int rank = 0;
......@@ -102,9 +101,8 @@ namespace AMDiS
}
template <class MessageBuffer, class Entity>
void scatterImpl(MessageBuffer& buff, Entity const& e, std::size_t n, int_t<0>)
void scatterImpl(MessageBuffer& buff, Entity const& e, [[maybe_unused]] std::size_t n, int_t<0>)
{
DUNE_UNUSED_PARAMETER(n); // n == 1
assert(n == 1);
int rank = 0;
......@@ -223,9 +221,8 @@ namespace AMDiS
}
template <class MessageBuffer, class Entity, int cd>
void scatterImpl(MessageBuffer& buff, Entity const& e, std::size_t n, int_t<cd>)
void scatterImpl(MessageBuffer& buff, Entity const& e, [[maybe_unused]] std::size_t n, int_t<cd>)
{
DUNE_UNUSED_PARAMETER(n); // n == 1
assert(n == 1);
int rank = 0;
......@@ -259,4 +256,3 @@ namespace AMDiS
#endif
} // end namespace AMDiS
......@@ -93,12 +93,12 @@ int main(int argc, char** argv)
auto gv = u.basis().gridView();
DUNE_UNUSED auto int1 = integrate(op1, gv, 5);
DUNE_UNUSED auto int2 = integrate(op2, gv, 5);
DUNE_UNUSED auto int3 = integrate(op3, gv);
DUNE_UNUSED auto int4 = integrate(op4, gv, 5);
DUNE_UNUSED auto int5 = integrate(op5, gv, 5);
DUNE_UNUSED auto int6 = integrate(op6, gv, 5);
[[maybe_unused]] auto int1 = integrate(op1, gv, 5);
[[maybe_unused]] auto int2 = integrate(op2, gv, 5);
[[maybe_unused]] auto int3 = integrate(op3, gv);
[[maybe_unused]] auto int4 = integrate(op4, gv, 5);
[[maybe_unused]] auto int5 = integrate(op5, gv, 5);
[[maybe_unused]] auto int6 = integrate(op6, gv, 5);
return 0;
}
......@@ -29,7 +29,7 @@ void checkBasisIds(const Basis& basis)
auto id = idSet.id(i);
cache.insert(id);
DUNE_UNUSED auto pt = idSet.partitionType(i);
[[maybe_unused]] auto pt = idSet.partitionType(i);
}
idSet.unbind();
......
......@@ -34,8 +34,7 @@ int main()
AMDIS_TEST_EQ(numNodeIndices, numDofs);
std::size_t num = 0;
for (std::size_t dof : nodeIndices(localView)) {
DUNE_UNUSED_PARAMETER(dof);
for ([[maybe_unused]] std::size_t dof : nodeIndices(localView)) {
num++;
}
AMDIS_TEST_EQ(num, numDofs);
......@@ -50,8 +49,7 @@ int main()
std::size_t numVelNodeIndices = nodeIndexCount(localView, v_node);
AMDIS_TEST_EQ(numVelNodeIndices, numVelDofs);
num = 0;
for (std::size_t dof : nodeIndices(localView, v_node)) {
DUNE_UNUSED_PARAMETER(dof);
for ([[maybe_unused]] std::size_t dof : nodeIndices(localView, v_node)) {
num++;
}
AMDIS_TEST_EQ(num, numVelDofs);
......@@ -62,8 +60,7 @@ int main()
std::size_t numPNodeIndices = nodeIndexCount(localView, p_node);
AMDIS_TEST_EQ(numPNodeIndices, numPDofs);
num = 0;
for (std::size_t dof : nodeIndices(localView, p_node)) {
DUNE_UNUSED_PARAMETER(dof);
for ([[maybe_unused]] std::size_t dof : nodeIndices(localView, p_node)) {
num++;
}
AMDIS_TEST_EQ(num, numPDofs);
......
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