Commit 518dbbcf authored by Praetorius, Simon's avatar Praetorius, Simon
Browse files

Merge branch 'feature/class_template_argument_deduction' into 'master'

Remove check for class template argument deduction

See merge request !179
parents 6a11937a 3ff5756b
......@@ -180,7 +180,7 @@ namespace AMDiS
};
#if DUNE_HAVE_CXX_CLASS_TEMPLATE_ARGUMENT_DEDUCTION
// deduction guides
template <class RB, class CB>
BiLinearForm(RB&&, CB&&)
-> BiLinearForm<Underlying_t<RB>, Underlying_t<CB>>;
......@@ -188,7 +188,7 @@ namespace AMDiS
template <class RB>
BiLinearForm(RB&&)
-> BiLinearForm<Underlying_t<RB>, Underlying_t<RB>>;
#endif
template <class T = double, class RB, class CB>
auto makeBiLinearForm(RB&& rowBasis, CB&& colBasis)
......
......@@ -218,11 +218,12 @@ namespace AMDiS
std::shared_ptr<GlobalBasis const> basis_;
};
#if DUNE_HAVE_CXX_CLASS_TEMPLATE_ARGUMENT_DEDUCTION
// deduction guides
template <class GB>
DOFVector(GB&& basis, DataTransferOperation op = DataTransferOperation::INTERPOLATE)
-> DOFVector<ParallelGlobalBasis<typename Underlying_t<GB>::PreBasis>>;
#endif
/// \brief Create a DOFVector from a basis.
/**
......
......@@ -117,11 +117,11 @@ namespace AMDiS
};
#if DUNE_HAVE_CXX_CLASS_TEMPLATE_ARGUMENT_DEDUCTION
// deduction guide
template <class GB>
LinearForm(GB&& basis)
-> LinearForm<Underlying_t<GB>>;
#endif
template <class T = double, class GB>
auto makeLinearForm(GB&& basis)
......
......@@ -401,13 +401,12 @@ namespace AMDiS
};
#if DUNE_HAVE_CXX_CLASS_TEMPLATE_ARGUMENT_DEDUCTION
// Deduction guide for GridFunctionMarker class
template <class Grid, class GF>
GridFunctionMarker(std::string const& name, std::shared_ptr<Grid> const& grid, GF&& gf)
-> GridFunctionMarker<Grid,
TYPEOF( makeGridFunction(FWD(gf), grid->leafGridView()) )>;
#endif
// Generator function for GridFunctionMarker class
template <class Grid, class PreGridFct>
......
......@@ -86,8 +86,7 @@ namespace AMDiS
};
#if DUNE_HAVE_CXX_CLASS_TEMPLATE_ARGUMENT_DEDUCTION
// Deduction rule
// Deduction guides
template <class Traits>
ProblemInstat(std::string const& name, ProblemStat<Traits>& prob)
-> ProblemInstat<Traits>;
......@@ -95,7 +94,7 @@ namespace AMDiS
template <class Traits>
ProblemInstat(std::string const& name, ProblemStat<Traits>& prob, ProblemStatBase& initialProb)
-> ProblemInstat<Traits>;
#endif
// Generator for ProblemInstat with given ProblemStat
template <class Traits>
......
......@@ -516,12 +516,11 @@ namespace AMDiS
};
#if DUNE_HAVE_CXX_CLASS_TEMPLATE_ARGUMENT_DEDUCTION
// Deduction rule
// Deduction guide
template <class Grid, class GlobalBasis>
ProblemStat(std::string const& name, Grid& grid, GlobalBasis& globalBasis)
-> ProblemStat<DefaultProblemTraits<GlobalBasis>>;
#endif
// Generator for ProblemStat with given Grid and GlobalBasis
template <class Grid, class GlobalBasis>
......
......@@ -31,11 +31,12 @@ namespace AMDiS
template <class Coeff, class GB, class TreePath = Dune::TypeTree::HybridTreePath<>>
class DiscreteFunction;
#if DUNE_HAVE_CXX_CLASS_TEMPLATE_ARGUMENT_DEDUCTION
// deduction guide
template <class Coeff, class GB, class TreePath = RootTreePath>
DiscreteFunction(Coeff&, GB const&, TreePath = {})
-> DiscreteFunction<Coeff, GB, TreePath_t<TreePath>>;
#endif
/// A Generator for a mutable \ref DiscreteFunction
template <class Coeff, class GB, class Path = RootTreePath,
......
......@@ -89,10 +89,8 @@ int main(int argc, char** argv)
auto vec4 = makeDOFVector<double>(basis);
test_dofvector(vec4);
#if DUNE_HAVE_CXX_CLASS_TEMPLATE_ARGUMENT_DEDUCTION
DOFVector vec5(basis);
test_dofvector(vec5);
#endif
}
// test automatic updates
......
......@@ -62,10 +62,9 @@ int main(int argc, char** argv)
auto const& U_c = *prob.solutionVector();
auto& U_m = *prob.solutionVector();
#if DUNE_HAVE_CXX_CLASS_TEMPLATE_ARGUMENT_DEDUCTION
DiscreteFunction u0_c(U_c.coefficients(), *U_c.basis());
DiscreteFunction u0_m(U_m.coefficients(), *U_m.basis());
#endif
auto u1_c = makeDiscreteFunction(U_c);
auto u1_m = makeDiscreteFunction(U_m);
......
......@@ -38,11 +38,8 @@ int main(int argc, char** argv)
return { 1.0 / (0.1 + std::min(distance(x0, x), distance(x1, x))) };
};
#if DUNE_HAVE_CXX_CLASS_TEMPLATE_ARGUMENT_DEDUCTION
GridFunctionMarker marker("mymarker", prob.grid(), markerFunc);
#else
auto marker = makeGridFunctionMarker("mymarker", prob.grid(), markerFunc);
#endif
auto marker2 = makeGridFunctionMarker("mymarker", prob.grid(), markerFunc);
prob.addMarker(marker);
......
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