Commit e2125884 authored by Christoph Grüninger's avatar Christoph Grüninger
Browse files

Deprecate Dumux::IsIndexable in favor of Dune::IsIndexable

parent 6d2f3454
......@@ -38,6 +38,10 @@ functions `bind` or `bindElement` have been called (i.e. the local geometry is i
interfaces are currently not used (except in the unit tests) but will be required
by the assembler in future Dumux versions.
### Deprecated properties/classes/functions/files, to be removed after 3.4:
- __Type traits__: `Dumux::IsIndexable<T, I>` is deprecated, use `Dune::IsIndexable<T, I>`directly.
Differences Between DuMu<sup>x</sup> 3.3 and DuMu<sup>x</sup> 3.2
=============================================
......
......@@ -27,6 +27,7 @@
#include <cmath>
#include <type_traits>
#include <dune/common/typetraits.hh>
#include <dune/geometry/quadraturerules.hh>
#include <dune/common/concept.hh>
......@@ -37,7 +38,6 @@
#include <dumux/common/doubleexpintegrator.hh>
#include <dumux/discretization/evalsolution.hh>
#include <dumux/discretization/elementsolution.hh>
#include <dumux/common/typetraits/typetraits.hh>
namespace Dumux {
......@@ -59,7 +59,7 @@ static constexpr bool hasLocalFunction()
{ return Dune::models<HasLocalFunction, F>(); }
template<class Error,
typename std::enable_if_t<IsIndexable<Error>::value, int> = 0>
typename std::enable_if_t<Dune::IsIndexable<Error>::value, int> = 0>
Error sqrtNorm(const Error& error)
{
using std::sqrt;
......@@ -70,7 +70,7 @@ Error sqrtNorm(const Error& error)
}
template<class Error,
typename std::enable_if_t<!IsIndexable<Error>::value, int> = 0>
typename std::enable_if_t<!Dune::IsIndexable<Error>::value, int> = 0>
Error sqrtNorm(const Error& error)
{
using std::sqrt;
......
......@@ -38,9 +38,12 @@ namespace Dumux {
/*! \brief We define our own is_indexable type in order
* to avoid several version checks throughout dumux.
* This should be deleted when the deprecation phase is over.
*
* \deprecated Use <code>Dune::IsIndexable<T, I></code> instead. Will
* be removed after DuMux 3.4.
*/
template<typename T, typename I = std::size_t>
using IsIndexable = typename Dune::IsIndexable<T, I>;
using IsIndexable [[deprecated("Use Dune::IsIndexable<T, I> instead")]] = typename Dune::IsIndexable<T, I>;
} // end namespace Dumux
#endif
......@@ -27,12 +27,13 @@
#include <string>
#include <memory>
#include <dune/common/typetraits.hh>
#include <dune/grid/common/mcmgmapper.hh>
#include <dune/grid/io/file/vtk/common.hh>
#include <dune/grid/io/file/vtk/function.hh>
#include <dumux/io/vtkprecision.hh>
#include <dumux/common/typetraits/typetraits.hh>
namespace Dumux::Vtk {
......@@ -41,9 +42,9 @@ namespace Detail {
template<class Field>
double accessEntry(const Field& f, [[maybe_unused]] int mycomp, [[maybe_unused]] int i)
{
if constexpr (IsIndexable<std::decay_t<decltype(std::declval<Field>()[0])>>{})
if constexpr (Dune::IsIndexable<std::decay_t<decltype(std::declval<Field>()[0])>>{})
{
if constexpr (IsIndexable<std::decay_t<decltype(std::declval<Field>()[0][0])>>{})
if constexpr (Dune::IsIndexable<std::decay_t<decltype(std::declval<Field>()[0][0])>>{})
DUNE_THROW(Dune::InvalidStateException, "Invalid field type");
else
return f[i][mycomp];
......@@ -233,9 +234,9 @@ private:
//! access to the field
double accessEntry_([[maybe_unused]] int mycomp, [[maybe_unused]] int eIdx, [[maybe_unused]] int cornerIdx) const
{
if constexpr (IsIndexable<decltype(std::declval<F>()[0])>{})
if constexpr (Dune::IsIndexable<decltype(std::declval<F>()[0])>{})
{
if constexpr (IsIndexable<decltype(std::declval<F>()[0][0])>{})
if constexpr (Dune::IsIndexable<decltype(std::declval<F>()[0][0])>{})
return field_[eIdx][cornerIdx][mycomp];
else
return field_[eIdx][cornerIdx];
......
......@@ -42,7 +42,6 @@
#include <dune/grid/common/partitionset.hh>
#include <dumux/common/parameters.hh>
#include <dumux/common/typetraits/typetraits.hh>
#include <dumux/io/format.hh>
#include <dumux/discretization/method.hh>
......@@ -269,7 +268,7 @@ private:
template<class Vector>
std::size_t getNumberOfComponents_(const Vector& v)
{
if constexpr (IsIndexable<decltype(std::declval<Vector>()[0])>::value)
if constexpr (Dune::IsIndexable<decltype(std::declval<Vector>()[0])>::value)
return v[0].size();
else
return 1;
......
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