Commit 1ddb062b authored by Ansgar Burchardt's avatar Ansgar Burchardt

Merge branch 'cherry-pick-bdf37616' into 'releases/2.5'

Merge branch 'feature/deprecate-method-evaluate' into 'master'

Deprecate the method LocalBasis::evaluate

... on all LocalBasis implementations that have it.  The method as been
superseded by 'partial'.  'partial' will allow to make the type-erased
interface much simpler, because it does not have member template
arguments.

This addresses the first part of #2 .

See merge request !32

See merge request !33
parents 3c63f1c2 e7f18173
Pipeline #1450 passed with stage
in 85 minutes and 23 seconds
......@@ -5,6 +5,7 @@
#include <array>
#include <dune/common/deprecated.hh>
#include <dune/common/function.hh>
#include <dune/localfunctions/common/localbasis.hh>
......@@ -110,7 +111,9 @@ namespace Dune
//
// Unfortunately not all compilers can determine Traits::diffOrder from
// the type of the argument directions
DUNE_NO_DEPRECATED_BEGIN
impl_.template evaluate<Traits::diffOrder>(directions, in, out);
DUNE_NO_DEPRECATED_END
}
protected:
......
......@@ -6,6 +6,7 @@
#include <array>
#include <numeric>
#include <dune/common/deprecated.hh>
#include <dune/common/fmatrix.hh>
#include <dune/localfunctions/common/localbasis.hh>
......@@ -98,7 +99,8 @@ namespace Dune
//! \brief Evaluate all shape functions
template<unsigned int k>
inline void evaluate (const typename std::array<int,k>& directions,
inline void DUNE_DEPRECATED_MSG("Use method 'partial' instead!")
evaluate (const typename std::array<int,k>& directions,
const typename Traits::DomainType& in,
std::vector<typename Traits::RangeType>& out) const
{
......
......@@ -6,6 +6,7 @@
#include <numeric>
#include <dune/common/fmatrix.hh>
#include <dune/common/deprecated.hh>
#include <dune/localfunctions/common/localbasis.hh>
......@@ -180,7 +181,9 @@ namespace Dune
{
std::array<int,1> directions;
directions[0] = std::find(order.begin(), order.end(), 1)-order.begin();
DUNE_NO_DEPRECATED_BEGIN
evaluate<1>(directions, in, out);
DUNE_NO_DEPRECATED_END
break;
}
case 2:
......@@ -197,7 +200,9 @@ namespace Dune
}
}
DUNE_NO_DEPRECATED_BEGIN
evaluate<2>(directions, in, out);
DUNE_NO_DEPRECATED_END
break;
}
default:
......@@ -207,7 +212,8 @@ namespace Dune
//! \brief Evaluate higher derivatives of all shape functions
template<unsigned int dOrder> //order of derivative
inline void evaluate(const std::array<int,dOrder>& directions, //direction of derivative
inline void DUNE_DEPRECATED_MSG("Use method 'partial' instead!")
evaluate(const std::array<int,dOrder>& directions, //direction of derivative
const typename Traits::DomainType& in, //position
std::vector<typename Traits::RangeType>& out) const //return value
{
......
......@@ -6,6 +6,7 @@
#include <numeric>
#include <dune/common/deprecated.hh>
#include <dune/common/fvector.hh>
#include <dune/common/fmatrix.hh>
#include <dune/common/power.hh>
......@@ -178,7 +179,8 @@ namespace Dune
* \param [out] out The return value
*/
template<int diffOrder>
inline void evaluate(
inline void DUNE_DEPRECATED_MSG("Use method 'partial' instead!")
evaluate(
const std::array<int,1>& direction,
const typename Traits::DomainType& in,
std::vector<typename Traits::RangeType>& out) const
......
......@@ -8,6 +8,7 @@
#include <numeric>
#include <dune/common/fmatrix.hh>
#include <dune/common/deprecated.hh>
#include "../common/localbasis.hh"
......@@ -246,7 +247,9 @@ namespace Dune
inline void evaluateFunction (const typename Traits::DomainType& in,
std::vector<typename Traits::RangeType>& out) const
{
DUNE_NO_DEPRECATED_BEGIN
evaluate<0>(std::array<int, 0>(), in, out);
DUNE_NO_DEPRECATED_END
}
/** \brief Evaluate partial derivatives of any order of all shape functions
......@@ -269,7 +272,9 @@ namespace Dune
{
std::array<int,1> directions;
directions[0] = std::find(order.begin(), order.end(), 1)-order.begin();
DUNE_NO_DEPRECATED_BEGIN
evaluate<1>(directions, in, out);
DUNE_NO_DEPRECATED_END
break;
}
case 2:
......@@ -286,7 +291,9 @@ namespace Dune
}
}
DUNE_NO_DEPRECATED_BEGIN
evaluate<2>(directions, in, out);
DUNE_NO_DEPRECATED_END
break;
}
default:
......@@ -297,7 +304,8 @@ namespace Dune
//! return given derivative of all components
template<unsigned int k>
inline void evaluate (const std::array<int,k>& directions,
inline void DUNE_DEPRECATED_MSG("Use method 'partial' instead!")
evaluate (const std::array<int,k>& directions,
const typename Traits::DomainType& in,
std::vector<typename Traits::RangeType>& out) const
{
......
......@@ -16,6 +16,7 @@
#include <typeinfo>
#include <dune/common/classname.hh>
#include <dune/common/deprecated.hh>
#include <dune/geometry/quadraturerules.hh>
#include <dune/geometry/referenceelements.hh>
......@@ -379,7 +380,9 @@ struct TestEvaluate<1>
// Get the shape function derivatives there using the 'evaluate' method
std::vector<typename LB::Traits::RangeType> firstDerivatives;
DUNE_NO_DEPRECATED_BEGIN
fe.localBasis().template evaluate<1>(direction, testPoint, firstDerivatives);
DUNE_NO_DEPRECATED_END
if (firstDerivatives.size() != fe.localBasis().size())
{
std::cout << "Bug in evaluate() for finite element type "
......@@ -536,7 +539,9 @@ struct TestEvaluate<2>
// Get the shape function derivatives there using the 'evaluate' method
std::vector<Range> secondDerivative;
DUNE_NO_DEPRECATED_BEGIN
fe.localBasis().template evaluate<2>(directions, testPoint, secondDerivative);
DUNE_NO_DEPRECATED_END
if (secondDerivative.size() != fe.localBasis().size())
{
std::cout << "Bug in evaluate<2>() for finite element type "
......
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