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

Properly Lagrange functions as deprecated.

Otherwise no deprecation warnings are emitted.
parent 3c50cf47
# Master (will become release 2.9)
## Deprecations and removals
- Deprecated many of the Lagrange headers, use
`lagrange(cube|prism|pyramid|simplex).hh` instead.
# Release 2.8
* Passing functions that support `f.evaluate(x,y)` to `interpolate()`
......
......@@ -5,6 +5,8 @@
#include <dune/localfunctions/lagrange/lagrangesimplex.hh>
#warning This header is deprecated
namespace Dune
{
......@@ -16,7 +18,9 @@ namespace Dune
\deprecated This class is obsolete. Please use LagrangeSimplexLocalFiniteElement instead!
*/
template<class D, class R, int dim>
using P1LocalFiniteElement = LagrangeSimplexLocalFiniteElement<D,R,dim,1>;
using P1LocalFiniteElement
[[deprecated("use LagrangeSimplexLocalFiniteElement instead")]]
= LagrangeSimplexLocalFiniteElement<D,R,dim,1>;
}
......
......@@ -5,6 +5,8 @@
#include <dune/localfunctions/lagrange/lagrangesimplex.hh>
#warning This header is deprecated
namespace Dune
{
......@@ -13,7 +15,9 @@ namespace Dune
\deprecated This class is obsolete. Please use LagrangeSimplexLocalFiniteElement instead!
*/
template<class D, class R, int d>
using P2LocalFiniteElement = LagrangeSimplexLocalFiniteElement<D,R,d,2>;
using P2LocalFiniteElement
[[deprecated("use LagrangeSimplexLocalFiniteElement instead")]]
= LagrangeSimplexLocalFiniteElement<D,R,d,2>;
}
......
......@@ -5,6 +5,8 @@
#include <dune/localfunctions/lagrange/lagrangesimplex.hh>
#warning This header is deprecated
namespace Dune
{
......@@ -16,7 +18,9 @@ namespace Dune
* \deprecated This class is obsolete. Please use LagrangeSimplexLocalFiniteElement instead!
*/
template<class D, class R>
using P23DLocalFiniteElement = LagrangeSimplexLocalFiniteElement<D,R,3,2>;
using P23DLocalFiniteElement
[[deprecated("use LagrangeSimplexLocalFiniteElement instead")]]
= LagrangeSimplexLocalFiniteElement<D,R,3,2>;
}
......
......@@ -6,7 +6,7 @@
#include<dune/localfunctions/lagrange/lagrangesimplex.hh>
#warning This header deprecated
#warning This header is deprecated
namespace Dune
{
......
......@@ -11,6 +11,8 @@
#include <dune/localfunctions/common/localtoglobaladaptors.hh>
#include <dune/localfunctions/lagrange/lagrangesimplex.hh>
#warning This header is deprecated
namespace Dune
{
......@@ -19,7 +21,9 @@ namespace Dune
\deprecated This class is obsolete. Please use LagrangeSimplexLocalFiniteElement instead!
*/
template<class D, class R, unsigned int k>
using Pk1DLocalFiniteElement = LagrangeSimplexLocalFiniteElement<D,R,1,k>;
using Pk1DLocalFiniteElement
[[deprecated("use LagrangeSimplexLocalFiniteElement instead")]]
= LagrangeSimplexLocalFiniteElement<D,R,1,k>;
//! Langrange finite element of arbitrary order on triangles
......
......@@ -11,6 +11,8 @@
#include <dune/localfunctions/common/localtoglobaladaptors.hh>
#include <dune/localfunctions/lagrange/lagrangesimplex.hh>
#warning This header is deprecated
namespace Dune
{
......@@ -19,7 +21,9 @@ namespace Dune
\deprecated This class is obsolete. Please use LagrangeSimplexLocalFiniteElement instead!
*/
template<class D, class R, unsigned int k>
using Pk2DLocalFiniteElement = LagrangeSimplexLocalFiniteElement<D,R,2,k>;
using Pk2DLocalFiniteElement
[[deprecated("use LagrangeSimplexLocalFiniteElement instead")]]
= LagrangeSimplexLocalFiniteElement<D,R,2,k>;
//! Langrange finite element of arbitrary order on triangles
......
......@@ -5,6 +5,8 @@
#include <dune/localfunctions/lagrange/lagrangesimplex.hh>
#warning This header is deprecated
namespace Dune
{
......@@ -13,7 +15,9 @@ namespace Dune
\deprecated This class is obsolete. Please use LagrangeSimplexLocalFiniteElement instead!
*/
template<class D, class R, unsigned int k>
using Pk3DLocalFiniteElement = LagrangeSimplexLocalFiniteElement<D,R,3,k>;
using Pk3DLocalFiniteElement
[[deprecated("use LagrangeSimplexLocalFiniteElement instead")]]
= LagrangeSimplexLocalFiniteElement<D,R,3,k>;
}
......
......@@ -5,6 +5,8 @@
#include <dune/localfunctions/lagrange/lagrangeprism.hh>
#warning This header is deprecated
namespace Dune
{
......@@ -13,7 +15,9 @@ namespace Dune
* \deprecated Please use LagrangePrismLocalFiniteElement<D,R,2> instead!
*/
template<class D, class R>
using PrismP1LocalFiniteElement = LagrangePrismLocalFiniteElement<D,R,1>;
using PrismP1LocalFiniteElement
[[deprecated("use LagrangePrismLocalFiniteElement instead")]]
= LagrangePrismLocalFiniteElement<D,R,1>;
}
......
......@@ -5,6 +5,8 @@
#include <dune/localfunctions/lagrange/lagrangeprism.hh>
#warning This header is deprecated
namespace Dune
{
......@@ -13,7 +15,9 @@ namespace Dune
* \deprecated Please use LagrangePrismLocalFiniteElement<D,R,2> instead!
*/
template<class D, class R>
using PrismP2LocalFiniteElement = LagrangePrismLocalFiniteElement<D,R,2>;
using PrismP2LocalFiniteElement
[[deprecated("use LagrangePrismLocalFiniteElement instead")]]
= LagrangePrismLocalFiniteElement<D,R,2>;
}
......
......@@ -6,6 +6,8 @@
#include <dune/localfunctions/lagrange/lagrangepyramid.hh>
#warning This header is deprecated
namespace Dune
{
......@@ -14,7 +16,9 @@ namespace Dune
* \deprecated Please use LagrangePyramidLocalFiniteElement<D,R,1> instead!
*/
template<class D, class R>
using PyramidP1LocalFiniteElement = LagrangePyramidLocalFiniteElement<D,R,1>;
using PyramidP1LocalFiniteElement
[[deprecated("use LagrangePyramidLocalFiniteElement instead")]]
= LagrangePyramidLocalFiniteElement<D,R,1>;
}
......
......@@ -5,6 +5,8 @@
#include <dune/localfunctions/lagrange/lagrangepyramid.hh>
#warning This header is deprecated
namespace Dune
{
......@@ -13,7 +15,9 @@ namespace Dune
* \deprecated Please use LagrangePyramidLocalFiniteElement<D,R,2> instead!
*/
template<class D, class R>
using PyramidP2LocalFiniteElement = LagrangePyramidLocalFiniteElement<D,R,2>;
using PyramidP2LocalFiniteElement
[[deprecated("use LagrangePyramidLocalFiniteElement instead")]]
= LagrangePyramidLocalFiniteElement<D,R,2>;
}
......
......@@ -10,6 +10,8 @@
#include <dune/localfunctions/common/localtoglobaladaptors.hh>
#include <dune/localfunctions/lagrange/lagrangecube.hh>
#warning This header is deprecated
namespace Dune
{
......@@ -20,95 +22,11 @@ namespace Dune
\deprecated This class is deprecated! Please use LagrangeCubeLocalFiniteElement instead.
*/
// The test test-q1.cc triggers compiler bugs in gcc-6 and earlier when Q1LocalFiniteElement
// is simply redefined as LagrangeCubeLocalFiniteElement: it grabs more and more main memory,
// and eventually stalls the machine. Since I didn't find the real cause for this let's just
// keep the relevant parts of Q1LocalFiniteElement until we can retire the problematic gcc versions.
#if !defined __GNUC__ || __GNUC__ > 6
template<class D, class R, int dim>
using Q1LocalFiniteElement = LagrangeCubeLocalFiniteElement<D,R,dim,1>;
#else
template <int dim>
class Q1LocalCoefficients
{
public:
//! \brief Standard constructor
Q1LocalCoefficients () : li(1<<dim)
{
for (std::size_t i=0; i<(1<<dim); i++)
li[i] = LocalKey(i,dim,0);
}
//! number of coefficients
std::size_t size () const
{
return 1<<dim;
}
//! get i'th index
const LocalKey& localKey (std::size_t i) const
{
return li[i];
}
private:
std::vector<LocalKey> li;
};
template<class D, class R, int dim>
class Q1LocalFiniteElement
{
public:
// user-defined default constructor is required for clang 3.8,
// see https://gitlab.dune-project.org/core/dune-localfunctions/merge_requests/60
/** default constructor */
Q1LocalFiniteElement() {}
/** \todo Please doc me !
*/
typedef LocalFiniteElementTraits<Impl::LagrangeCubeLocalBasis<D,R,dim,1>,Q1LocalCoefficients<dim>,
Impl::LagrangeCubeLocalInterpolation<Impl::LagrangeCubeLocalBasis<D,R,dim,1> > > Traits;
using Q1LocalFiniteElement
[[deprecated("use LagrangeCubeLocalFiniteElement instead")]]
= LagrangeCubeLocalFiniteElement<D,R,dim,1>;
/** \todo Please doc me !
*/
const typename Traits::LocalBasisType& localBasis () const
{
return basis;
}
/** \todo Please doc me !
*/
const typename Traits::LocalCoefficientsType& localCoefficients () const
{
return coefficients;
}
/** \todo Please doc me !
*/
const typename Traits::LocalInterpolationType& localInterpolation () const
{
return interpolation;
}
/** \brief Number of shape functions in this finite element */
unsigned int size () const
{
return basis.size();
}
/** \todo Please doc me !
*/
static constexpr GeometryType type ()
{
return GeometryTypes::cube(dim);
}
private:
Impl::LagrangeCubeLocalBasis<D,R,dim,1> basis;
Q1LocalCoefficients<dim> coefficients;
Impl::LagrangeCubeLocalInterpolation<Impl::LagrangeCubeLocalBasis<D,R,dim,1> > interpolation;
};
#endif
//! Factory for global-valued Q1 elements
/**
......@@ -119,27 +37,15 @@ namespace Dune
template<class Geometry, class RF>
class Q1FiniteElementFactory :
public ScalarLocalToGlobalFiniteElementAdaptorFactory<
#if !defined __GNUC__ || __GNUC__ > 6
LagrangeCubeLocalFiniteElement<
typename Geometry::ctype, RF, Geometry::mydimension, 1
>,
#else
Q1LocalFiniteElement<
typename Geometry::ctype, RF, Geometry::mydimension
>,
#endif
Geometry
>
{
#if !defined __GNUC__ || __GNUC__ > 6
typedef LagrangeCubeLocalFiniteElement<
typename Geometry::ctype, RF, Geometry::mydimension, 1
> LFE;
#else
typedef Q1LocalFiniteElement<
typename Geometry::ctype, RF, Geometry::mydimension
> LFE;
#endif
typedef ScalarLocalToGlobalFiniteElementAdaptorFactory<LFE, Geometry> Base;
static const LFE lfe;
......
......@@ -6,6 +6,8 @@
#include <dune/localfunctions/lagrange/lagrangecube.hh>
#warning This header is deprecated
namespace Dune
{
/** \brief General Lagrange finite element for cubes with arbitrary dimension and polynomial order
......@@ -19,7 +21,9 @@ namespace Dune
* \deprecated This class is deprecated! Please use LagrangeCubeLocalFiniteElement instead.
*/
template<class D, class R, int d, int k>
using QkLocalFiniteElement = LagrangeCubeLocalFiniteElement<D,R,d,k>;
using QkLocalFiniteElement
[[deprecated("use LagrangeCubeLocalFiniteElement instead")]]
= LagrangeCubeLocalFiniteElement<D,R,d,k>;
}
......
Supports Markdown
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