Skip to content
Snippets Groups Projects

Remove dependency to deprecated code

Merged Christoph Grüninger requested to merge feature/remove-dependency-to-deprecated-code into master
3 files
+ 4
129
Compare changes
  • Side-by-side
  • Inline
Files
3
@@ -13,18 +13,9 @@
#include <unordered_map>
#include <functional>
#include <dune/common/deprecated.hh>
#include <dune/common/version.hh>
// TODO remove header and macro after release Dune 2.8
#define DUNE_FUNCTION_HH_SILENCE_DEPRECATION // silence deprecation warning from <dune/common/function.hh>
#include <dune/common/function.hh>
#include <dune/common/fvector.hh>
#include <dune/common/hash.hh>
#if DUNE_VERSION_EQUAL(DUNE_COMMON, 2, 7)
#include <dune/common/to_unique_ptr.hh>
#endif
#include <dune/grid/common/gridfactory.hh>
#include <dune/foamgrid/foamgrid.hh>
@@ -41,15 +32,7 @@ template <int dimgrid, int dimworld, class ct>
public:
#if DUNE_VERSION_LT(DUNE_COMMON, 2, 7)
using GridPtrType = FoamGrid<dimgrid, dimworld, ctype>*;
#elif DUNE_VERSION_LT(DUNE_COMMON, 2, 8)
using GridPtrType = ToUniquePtr<FoamGrid<dimgrid, dimworld, ctype>>;
#else
using GridPtrType = std::unique_ptr<FoamGrid<dimgrid, dimworld,ctype>>;
#endif
public:
using GridPtrType = std::unique_ptr<FoamGrid<dimgrid, dimworld,ctype>>;
/** \brief Default constructor */
GridFactoryBase()
@@ -208,37 +191,6 @@ template <int dimworld, class ct>
);
}
// disable the deprecated interface when using Dune > 2.8
#if DUNE_VERSION_LTE(DUNE_COMMON, 2, 8)
DUNE_NO_DEPRECATED_BEGIN
/** \brief Insert a parametrized element into the coarse grid
\param type The GeometryType of the new element
\param vertices The vertices of the new element, using the DUNE numbering
\param elementParametrization A function prescribing the shape of this element
*/
[[deprecated("Signature with VirtualFunction is deprecated and will be removed after Dune 2.8. Use signature with std::function.")]]
void insertElement(const GeometryType& type,
const std::vector<unsigned int>& vertices,
const std::shared_ptr<VirtualFunction<FieldVector<ctype,dimgrid>,FieldVector<ctype,dimworld> > >& elementParametrization) override
{
assert(type.isLine());
EntityImp<1> newElement(this->vertexArray_[vertices[0]],
this->vertexArray_[vertices[1]],
0, // level
this->grid_->getNextFreeId());
// save the pointer to the element parametrization
newElement.elementParametrization_ =
[elementParametrization](const FieldVector<ctype,dimgrid>& x){
FieldVector<ctype,dimworld> y;
elementParametrization->evaluate(x, y);
return y;
};
std::get<dimgrid>(this->grid_->entityImps_[0]).push_back(newElement);
}
DUNE_NO_DEPRECATED_END
#endif
/** \brief Insert a parametrized element into the coarse grid
\param type The GeometryType of the new element
\param vertices The vertices of the new element, using the DUNE numbering
@@ -247,9 +199,7 @@ DUNE_NO_DEPRECATED_END
void insertElement(const GeometryType& type,
const std::vector<unsigned int>& vertices,
std::function<FieldVector<ctype,dimworld>(FieldVector<ctype,dimgrid>)> elementParametrization)
#if DUNE_VERSION_GT(DUNE_COMMON, 2, 7)
override
#endif
{
assert(type.isLine());
EntityImp<1> newElement(this->vertexArray_[vertices[0]],
@@ -406,37 +356,6 @@ template <int dimworld, class ct>
std::get<dimgrid>(this->grid_->entityImps_[0]).push_back(newElement);
}
// disable the deprecated interface when using Dune > 2.8
#if DUNE_VERSION_LTE(DUNE_COMMON, 2, 8)
DUNE_NO_DEPRECATED_BEGIN
/** \brief Insert a parametrized element into the coarse grid
\param type The GeometryType of the new element
\param vertices The vertices of the new element, using the DUNE numbering
\param elementParametrization A function prescribing the shape of this element
*/
[[deprecated("Signature with VirtualFunction is deprecated and will be removed after Dune 2.8. Use signature with std::function.")]]
void insertElement(const GeometryType& type,
const std::vector<unsigned int>& vertices,
const std::shared_ptr<VirtualFunction<FieldVector<ctype,dimgrid>,FieldVector<ctype,dimworld> > >& elementParametrization) override
{
assert(type.isTriangle());
EntityImp<dimgrid> newElement(/*level=*/0, this->grid_->getNextFreeId());
newElement.vertex_[0] = this->vertexArray_[vertices[0]];
newElement.vertex_[1] = this->vertexArray_[vertices[1]];
newElement.vertex_[2] = this->vertexArray_[vertices[2]];
// save the pointer to the element parametrization
newElement.elementParametrization_ =
[elementParametrization](const FieldVector<ctype,dimgrid>& x){
FieldVector<ctype,dimworld> y;
elementParametrization->evaluate(x, y);
return y;
};
std::get<dimgrid>(this->grid_->entityImps_[0]).push_back(newElement);
}
DUNE_NO_DEPRECATED_END
#endif
/** \brief Insert a parametrized element into the coarse grid
\param type The GeometryType of the new element
\param vertices The vertices of the new element, using the DUNE numbering
@@ -445,9 +364,7 @@ DUNE_NO_DEPRECATED_END
void insertElement(const GeometryType& type,
const std::vector<unsigned int>& vertices,
std::function<FieldVector<ctype,dimworld>(FieldVector<ctype,dimgrid>)> elementParametrization)
#if DUNE_VERSION_GT(DUNE_COMMON, 2, 7)
override
#endif
{
assert(type.isTriangle());
EntityImp<dimgrid> newElement(/*level=*/0, this->grid_->getNextFreeId());
Loading