From 3b7d73548f370caa9e36815716dcad784eedd1d9 Mon Sep 17 00:00:00 2001 From: "Nebel, Lisa Julia" <lisa_julia.nebel@tu-dresden.de> Date: Tue, 19 Jan 2021 11:02:26 +0100 Subject: [PATCH] Remove support for Dune 2.6 and older --- .gitlab-ci.yml | 6 - dune.module | 2 +- dune/gfe/cosseratvtkwriter.hh | 4 - dune/gfe/geodesicfefunctionadaptor.hh | 8 -- dune/gfe/linearalgebra.hh | 173 +------------------------- dune/gfe/localprojectedfefunction.hh | 18 --- dune/gfe/mixedgfeassembler.hh | 52 +------- dune/gfe/periodic1dpq1nodalbasis.hh | 103 --------------- dune/gfe/riemannianpnsolver.cc | 25 +--- dune/gfe/riemannianpnsolver.hh | 5 - dune/gfe/riemanniantrsolver.cc | 25 +--- dune/gfe/riemanniantrsolver.hh | 5 - dune/gfe/unitvector.hh | 11 +- dune/gfe/vtkfile.hh | 43 ------- src/cosserat-continuum.cc | 25 +--- src/film-on-substrate.cc | 13 -- src/harmonicmaps.cc | 5 - test/CMakeLists.txt | 2 - test/harmonicmaptest.cc | 9 -- 19 files changed, 20 insertions(+), 514 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 4fdb50c0..2a36c525 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -28,12 +28,6 @@ before_script: &before } EOT -dune:2.6 gcc: - image: registry.dune-project.org/docker/ci/dune:2.6-debian-10-gcc-8-17 - script: duneci-standard-test - variables: - DUNECI_BRANCH: releases/2.6-1 - dune:2.7 gcc: image: registry.dune-project.org/docker/ci/dune:2.7-debian-10-gcc-8-17 before_script: diff --git a/dune.module b/dune.module index 9eb6dbfb..495e6222 100644 --- a/dune.module +++ b/dune.module @@ -7,5 +7,5 @@ Module: dune-gfe Version: svn Maintainer: oliver.sander@tu-dresden.de #depending on -Depends: dune-grid dune-uggrid dune-istl dune-localfunctions dune-functions dune-solvers dune-fufem dune-elasticity +Depends: dune-common(>=2.7) dune-grid(>=2.7) dune-uggrid dune-istl dune-localfunctions dune-geometry (>=2.7) dune-functions (>=2.7) dune-solvers dune-fufem dune-elasticity (>=2.7) Suggests: dune-foamgrid dune-parmg dune-vtk dune-curvedgeometry diff --git a/dune/gfe/cosseratvtkwriter.hh b/dune/gfe/cosseratvtkwriter.hh index ee20d468..c7012e81 100644 --- a/dune/gfe/cosseratvtkwriter.hh +++ b/dune/gfe/cosseratvtkwriter.hh @@ -404,11 +404,7 @@ public: // dump point coordinates writer.beginPoints(); -#if DUNE_VERSION_LT(DUNE_FUNCTIONS,2,7) - writer.addArray<float>("Coordinates", 3); -#else writer.addArray("Coordinates", 3, Dune::VTK::Precision::float32); -#endif writer.endPoints(); for (int i=0; i<gridView.comm().size(); i++) diff --git a/dune/gfe/geodesicfefunctionadaptor.hh b/dune/gfe/geodesicfefunctionadaptor.hh index 96366040..b80f325e 100644 --- a/dune/gfe/geodesicfefunctionadaptor.hh +++ b/dune/gfe/geodesicfefunctionadaptor.hh @@ -50,11 +50,7 @@ static void geodesicFEFunctionAdaptor(GridType& grid, std::vector<TargetSpace>& for (const auto& element : elements(grid.leafGridView())) { // Set up a local gfe function on the father element -#if DUNE_VERSION_NEWER(DUNE_GRID,2,4) size_t nFatherDofs = element.father().subEntities(dim); -#else - size_t nFatherDofs = element.father()->template count<dim>(); -#endif std::vector<TargetSpace> coefficients(nFatherDofs); for (int i=0; i<nFatherDofs; i++) @@ -67,11 +63,7 @@ static void geodesicFEFunctionAdaptor(GridType& grid, std::vector<TargetSpace>& // The embedding of this element into the father geometry const auto& geometryInFather = element.geometryInFather(); -#if DUNE_VERSION_NEWER(DUNE_GRID,2,4) size_t nDofs = element.subEntities(dim); -#else - size_t nDofs = element.template count<dim>(); -#endif for (int i=0; i<nDofs; i++) { if (dofMap.find(idSet.subId(element,i,dim)) != dofMap.end()) { diff --git a/dune/gfe/linearalgebra.hh b/dune/gfe/linearalgebra.hh index a751897f..f23d3ea9 100644 --- a/dune/gfe/linearalgebra.hh +++ b/dune/gfe/linearalgebra.hh @@ -4,180 +4,9 @@ #include <dune/common/fmatrix.hh> #include <dune/common/version.hh> -/////////////////////////////////////////////////////////////////////////////////////////// -// Various vector-space matrix methods -/////////////////////////////////////////////////////////////////////////////////////////// - -#if ADOLC_ADOUBLE_H -#if DUNE_VERSION_LT(DUNE_FUNCTIONS,2,7) -template< int m, int n, int p > -auto operator* ( const Dune::FieldMatrix< adouble, m, n > &A, const Dune::FieldMatrix< adouble, n, p > &B) - -> Dune::FieldMatrix<adouble, m, p> -{ - typedef typename Dune::FieldMatrix< adouble, m, p > :: size_type size_type; - Dune::FieldMatrix< adouble, m, p > ret; - - for( size_type i = 0; i < m; ++i ) { - - for( size_type j = 0; j < p; ++j ) { - ret[ i ][ j ] = 0.0; - for( size_type k = 0; k < n; ++k ) - ret[ i ][ j ] += A[ i ][ k ] * B[ k ][ j ]; - } - } - return ret; -} - -template< int m, int n, int p > -auto operator* ( const Dune::FieldMatrix< adouble, m, n > &A, const Dune::FieldMatrix< double, n, p > &B) - -> Dune::FieldMatrix<adouble, m, p> -{ - typedef typename Dune::FieldMatrix< adouble, m, p > :: size_type size_type; - Dune::FieldMatrix< adouble, m, p > ret; - - for( size_type i = 0; i < m; ++i ) { - - for( size_type j = 0; j < p; ++j ) { - ret[ i ][ j ] = 0.0; - for( size_type k = 0; k < n; ++k ) - ret[ i ][ j ] += A[ i ][ k ] * B[ k ][ j ]; - } - } - return ret; -} - -template< int m, int n, int p > -auto operator* ( const Dune::FieldMatrix< double, m, n > &A, const Dune::FieldMatrix< adouble, n, p > &B) - -> Dune::FieldMatrix<adouble, m, p> -{ - typedef typename Dune::FieldMatrix< adouble, m, p > :: size_type size_type; - Dune::FieldMatrix< adouble, m, p > ret; - - for( size_type i = 0; i < m; ++i ) { - - for( size_type j = 0; j < p; ++j ) { - ret[ i ][ j ] = 0.0; - for( size_type k = 0; k < n; ++k ) - ret[ i ][ j ] += A[ i ][ k ] * B[ k ][ j ]; - } - } - return ret; -} -#endif -#endif - -#if DUNE_VERSION_LT(DUNE_FUNCTIONS,2,7) -//! calculates ret = A + B -template< class K, int m, int n> -Dune::FieldMatrix<K,m,n> operator+ ( const Dune::FieldMatrix<K, m, n> &A, const Dune::FieldMatrix<K,m,n> &B) -{ - typedef typename Dune::FieldMatrix<K,m,n> :: size_type size_type; - Dune::FieldMatrix<K,m,n> ret; - - for( size_type i = 0; i < m; ++i ) - for( size_type j = 0; j < n; ++j ) - ret[i][j] = A[i][j] + B[i][j]; - - return ret; -} - -//! calculates ret = A - B -template <class T, int m, int n> -auto operator- ( const Dune::FieldMatrix< T, m, n > &A, const Dune::FieldMatrix< T, m, n > &B) - -> Dune::FieldMatrix<T, m, n> -{ - Dune::FieldMatrix<T,m,n> result; - typedef typename decltype(result)::size_type size_type; - - for( size_type i = 0; i < m; ++i ) - for( size_type j = 0; j < n; ++j ) - result[i][j] = A[i][j] - B[i][j]; - - return result; -} -#endif - -#if ADOLC_ADOUBLE_H -#if DUNE_VERSION_LT(DUNE_FUNCTIONS,2,7) -//! calculates ret = A - B -template <int m, int n> -auto operator- ( const Dune::FieldMatrix< adouble, m, n > &A, const Dune::FieldMatrix< double, m, n > &B) - -> Dune::FieldMatrix<adouble, m, n> -{ - Dune::FieldMatrix<adouble,m,n> result; - typedef typename decltype(result)::size_type size_type; - - for( size_type i = 0; i < m; ++i ) - for( size_type j = 0; j < n; ++j ) - result[i][j] = A[i][j] - B[i][j]; - - return result; -} -#endif - -//! calculates ret = s*A -template< int m, int n> -auto operator* ( const double& s, const Dune::FieldMatrix<adouble, m, n> &A) - -> Dune::FieldMatrix<adouble,m,n> -{ - typedef typename Dune::FieldMatrix<adouble,m,n> :: size_type size_type; - Dune::FieldMatrix<adouble,m,n> ret; - - for( size_type i = 0; i < m; ++i ) - for( size_type j = 0; j < n; ++j ) - ret[i][j] = s * A[i][j]; - - return ret; -} -#endif - -#if DUNE_VERSION_LT(DUNE_FUNCTIONS,2,7) -//! calculates ret = s*A -template< int m, int n> -auto operator* ( const double& s, const Dune::FieldMatrix<double, m, n> &A) - -> Dune::FieldMatrix<double,m,n> -{ - typedef typename Dune::FieldMatrix<double,m,n> :: size_type size_type; - Dune::FieldMatrix<double,m,n> ret; - - for( size_type i = 0; i < m; ++i ) - for( size_type j = 0; j < n; ++j ) - ret[i][j] = s * A[i][j]; - - return ret; -} - -//! calculates ret = A/s -template< class K, int m, int n> -Dune::FieldMatrix<K,m,n> operator/ ( const Dune::FieldMatrix<K, m, n> &A, const K& s) -{ - typedef typename Dune::FieldMatrix<K,m,n> :: size_type size_type; - Dune::FieldMatrix<K,m,n> ret; - - for( size_type i = 0; i < m; ++i ) - for( size_type j = 0; j < n; ++j ) - ret[i][j] = A[i][j] / s; - - return ret; -} - -//! calculates ret = A/s -template< class K, int m> -Dune::FieldVector<K,m> operator/ ( const Dune::FieldVector<K, m> &A, const K& s) -{ - typedef typename Dune::FieldVector<K,m> :: size_type size_type; - Dune::FieldVector<K,m> result; - - for( size_type i = 0; i < m; ++i ) - result[i] = A[i] / s; - - return result; -} -#endif - /////////////////////////////////////////////////////////////////////////////////////////// -// Various other matrix methods +// Various matrix methods /////////////////////////////////////////////////////////////////////////////////////////// namespace Dune { diff --git a/dune/gfe/localprojectedfefunction.hh b/dune/gfe/localprojectedfefunction.hh index ba538c55..20d43d5e 100644 --- a/dune/gfe/localprojectedfefunction.hh +++ b/dune/gfe/localprojectedfefunction.hh @@ -13,24 +13,6 @@ namespace Dune { -#if DUNE_VERSION_LT(DUNE_FUNCTIONS,2,7) -template< class K, int m, int n, int p > -Dune::FieldMatrix< K, m, p > operator* ( const Dune::FieldMatrix< K, m, n > &A, const Dune::FieldMatrix< K, n, p > &B) -{ - typedef typename Dune::FieldMatrix< K, m, p > :: size_type size_type; - Dune::FieldMatrix< K, m, p > ret; - - for( size_type i = 0; i < m; ++i ) { - - for( size_type j = 0; j < p; ++j ) { - ret[ i ][ j ] = K( 0 ); - for( size_type k = 0; k < n; ++k ) - ret[ i ][ j ] += A[ i ][ k ] * B[ k ][ j ]; - } - } - return ret; -} -#endif namespace GFE { /** \brief Interpolate in an embedding Euclidean space, and project back onto the Riemannian manifold diff --git a/dune/gfe/mixedgfeassembler.hh b/dune/gfe/mixedgfeassembler.hh index 2cd87af5..883af00b 100644 --- a/dune/gfe/mixedgfeassembler.hh +++ b/dune/gfe/mixedgfeassembler.hh @@ -93,29 +93,12 @@ getMatrixPattern(Dune::MatrixIndexSet& nb00, // A view on the FE basis on a single element auto localView = basis_.localView(); -#if DUNE_VERSION_LT(DUNE_FUNCTIONS,2,7) - auto localIndexSet = basis_.localIndexSet(); -#endif // Loop over grid elements for (const auto& element : elements(basis_.gridView(), Dune::Partitions::interior)) { // Bind the local FE basis view to the current element localView.bind(element); -#if DUNE_VERSION_LT(DUNE_FUNCTIONS,2,7) - localIndexSet.bind(localView); - - // Add element stiffness matrix onto the global stiffness matrix - for (size_t i=0; i<localIndexSet.size(); i++) - { - // The global index of the i-th local degree of freedom of the element 'e' - auto row = localIndexSet.index(i); - - for (size_t j=0; j<localIndexSet.size(); j++ ) - { - // The global index of the j-th local degree of freedom of the element 'e' - auto col = localIndexSet.index(j); -#else // Add element stiffness matrix onto the global stiffness matrix for (size_t i=0; i<localView.size(); i++) { @@ -126,7 +109,6 @@ getMatrixPattern(Dune::MatrixIndexSet& nb00, { // The global index of the j-th local degree of freedom of the element 'e' auto col = localView.index(j); -#endif if (row[0]==0 and col[0]==0) nb00.add(row[1],col[1]); @@ -180,18 +162,10 @@ assembleGradientAndHessian(const std::vector<TargetSpace0>& configuration0, // A view on the FE basis on a single element auto localView = basis_.localView(); -#if DUNE_VERSION_LT(DUNE_FUNCTIONS,2,7) - auto localIndexSet = basis_.localIndexSet(); -#endif - for (const auto& element : elements(basis_.gridView(), Dune::Partitions::interior)) { // Bind the local FE basis view to the current element localView.bind(element); -#if DUNE_VERSION_LT(DUNE_FUNCTIONS,2,7) - localIndexSet.bind(localView); -#endif - using namespace Dune::TypeTree::Indices; const int nDofs0 = localView.tree().child(_0,0).finiteElement().size(); @@ -214,11 +188,7 @@ assembleGradientAndHessian(const std::vector<TargetSpace0>& configuration0, auto& node = localView.tree().child(_1,0); localIndexI = node.localIndex(i-nDofs0); } -#if DUNE_VERSION_LT(DUNE_FUNCTIONS,2,7) - auto multiIndex = localIndexSet.index(localIndexI); -#else auto multiIndex = localView.index(localIndexI); -#endif //CompositeBasis number is contained in multiIndex[0], the Subspacebasis is contained in multiIndex[2] //multiIndex[1] contains the actual index if (multiIndex[0] == 0) @@ -246,11 +216,8 @@ assembleGradientAndHessian(const std::vector<TargetSpace0>& configuration0, auto& node = localView.tree().child(_1,0); localIndexRow = node.localIndex(i-nDofs0); } -#if DUNE_VERSION_LT(DUNE_FUNCTIONS,2,7) - auto row = localIndexSet.index(localIndexRow); -#else + auto row = localView.index(localIndexRow); -#endif for (int j=0; j<nDofs0+nDofs1; j++ ) { @@ -262,11 +229,8 @@ assembleGradientAndHessian(const std::vector<TargetSpace0>& configuration0, auto& node = localView.tree().child(_1,0); localIndexCol = node.localIndex(j-nDofs0); } -#if DUNE_VERSION_LT(DUNE_FUNCTIONS,2,7) - auto col = localIndexSet.index(localIndexCol); -#else + auto col = localView.index(localIndexCol); -#endif if (row[0]==0 and col[0]==0) hessian[_0][_0][row[1]][col[1]] += localStiffness_->A00_[i][j]; @@ -347,18 +311,12 @@ computeEnergy(const std::vector<TargetSpace0>& configuration0, // A view on the FE basis on a single element auto localView = basis_.localView(); -#if DUNE_VERSION_LT(DUNE_FUNCTIONS,2,7) - auto localIndexSet = basis_.localIndexSet(); -#endif // Loop over all elements for (const auto& element : elements(basis_.gridView(), Dune::Partitions::interior)) { // Bind the local FE basis view to the current element localView.bind(element); -#if DUNE_VERSION_LT(DUNE_FUNCTIONS,2,7) - localIndexSet.bind(localView); -#endif // Number of degrees of freedom on this element using namespace Dune::TypeTree::Indices; @@ -378,11 +336,9 @@ computeEnergy(const std::vector<TargetSpace0>& configuration0, auto& node = localView.tree().child(_1,0); localIndexI = node.localIndex(i-nDofs0); } -#if DUNE_VERSION_LT(DUNE_FUNCTIONS,2,7) - auto multiIndex = localIndexSet.index(localIndexI); -#else + auto multiIndex = localView.index(localIndexI); -#endif + // The CompositeBasis number is contained in multiIndex[0] // multiIndex[1] contains the actual index if (multiIndex[0] == 0) diff --git a/dune/gfe/periodic1dpq1nodalbasis.hh b/dune/gfe/periodic1dpq1nodalbasis.hh index 81a290a1..aa9f2abd 100644 --- a/dune/gfe/periodic1dpq1nodalbasis.hh +++ b/dune/gfe/periodic1dpq1nodalbasis.hh @@ -7,10 +7,6 @@ #include <dune/localfunctions/lagrange/pqkfactory.hh> -#if DUNE_VERSION_LT(DUNE_FUNCTIONS,2,7) -#include <dune/typetree/leafnode.hh> -#endif - #include <dune/functions/functionspacebases/nodes.hh> #include <dune/functions/functionspacebases/flatmultiindex.hh> #include <dune/functions/functionspacebases/defaultglobalbasis.hh> @@ -31,27 +27,14 @@ namespace Functions { // set and can be used without a global basis. // ***************************************************************************** -#if DUNE_VERSION_LT(DUNE_FUNCTIONS,2,7) -template<typename GV, typename ST, typename TP> -#else template<typename GV> -#endif class Periodic1DPQ1Node; -#if DUNE_VERSION_LT(DUNE_FUNCTIONS,2,7) -template<typename GV, class MI, class TP, class ST> -#else template<typename GV, class MI> -#endif class Periodic1DPQ1NodeIndexSet; -#if DUNE_VERSION_LT(DUNE_FUNCTIONS,2,7) -template<typename GV, class MI, class ST> -class Periodic1DPQ1NodeFactory -#else template<typename GV, class MI> class Periodic1DPQ1PreBasis -#endif { static const int dim = GV::dimension; @@ -59,39 +42,21 @@ public: //! The grid view that the FE basis is defined on using GridView = GV; -#if DUNE_VERSION_LT(DUNE_FUNCTIONS,2,7) - using size_type = ST; - - template<class TP> - using Node = Periodic1DPQ1Node<GV, size_type, TP>; - - template<class TP> - using IndexSet = Periodic1DPQ1NodeIndexSet<GV, MI, TP, ST>; -#else //! Type used for indices and size information using size_type = std::size_t; using Node = Periodic1DPQ1Node<GV>; using IndexSet = Periodic1DPQ1NodeIndexSet<GV, MI>; -#endif /** \brief Type used for global numbering of the basis vectors */ using MultiIndex = MI; //! Type used for prefixes handed to the size() method -#if DUNE_VERSION_LT(DUNE_FUNCTIONS,2,7) - using SizePrefix = Dune::ReservedVector<size_type, 2>; -#else using SizePrefix = Dune::ReservedVector<size_type, 1>; -#endif //! Constructor for a given grid view object -#if DUNE_VERSION_LT(DUNE_FUNCTIONS,2,7) - Periodic1DPQ1NodeFactory(const GridView& gv) : -#else Periodic1DPQ1PreBasis(const GridView& gv) : -#endif gridView_(gv) {} @@ -111,19 +76,6 @@ public: gridView_ = gv; } -#if DUNE_VERSION_LT(DUNE_FUNCTIONS,2,7) - template<class TP> - Node<TP> node(const TP& tp) const - { - return Node<TP>{tp}; - } - - template<class TP> - IndexSet<TP> indexSet() const - { - return IndexSet<TP>{*this}; - } -#else Node makeNode() const { return Node{}; @@ -133,7 +85,6 @@ public: { return IndexSet{*this}; } -#endif size_type size() const { @@ -167,41 +118,22 @@ public: -#if DUNE_VERSION_LT(DUNE_FUNCTIONS,2,7) -template<typename GV, typename ST, typename TP> -class Periodic1DPQ1Node : - public LeafBasisNode<ST, TP> -#else template<typename GV> class Periodic1DPQ1Node : public LeafBasisNode -#endif { static const int dim = GV::dimension; static const int maxSize = StaticPower<2,GV::dimension>::power; -#if DUNE_VERSION_LT(DUNE_FUNCTIONS,2,7) - using Base = LeafBasisNode<ST,TP>; -#endif using FiniteElementCache = typename Dune::PQkLocalFiniteElementCache<typename GV::ctype, double, dim, 1>; public: -#if DUNE_VERSION_LT(DUNE_FUNCTIONS,2,7) - using size_type = ST; - using TreePath = TP; -#else using size_type = std::size_t; -#endif using Element = typename GV::template Codim<0>::Entity; using FiniteElement = typename FiniteElementCache::FiniteElementType; -#if DUNE_VERSION_LT(DUNE_FUNCTIONS,2,7) - Periodic1DPQ1Node(const TreePath& treePath) : - Base(treePath), -#else Periodic1DPQ1Node() : -#endif finiteElement_(nullptr), element_(nullptr) {} @@ -238,45 +170,23 @@ protected: -#if DUNE_VERSION_LT(DUNE_FUNCTIONS,2,7) -template<typename GV, class MI, class TP, class ST> -#else template<typename GV, class MI> -#endif class Periodic1DPQ1NodeIndexSet { enum {dim = GV::dimension}; public: -#if DUNE_VERSION_LT(DUNE_FUNCTIONS,2,7) - using size_type = ST; -#else using size_type = std::size_t; -#endif /** \brief Type used for global numbering of the basis vectors */ using MultiIndex = MI; - -#if DUNE_VERSION_LT(DUNE_FUNCTIONS,2,7) - using NodeFactory = Periodic1DPQ1NodeFactory<GV, MI, ST>; - - using Node = typename NodeFactory::template Node<TP>; -#else using PreBasis = Periodic1DPQ1PreBasis<GV, MI>; - using Node = Periodic1DPQ1Node<GV>; -#endif - -#if DUNE_VERSION_LT(DUNE_FUNCTIONS,2,7) - Periodic1DPQ1NodeIndexSet(const NodeFactory& nodeFactory) : - nodeFactory_(&nodeFactory) -#else Periodic1DPQ1NodeIndexSet(const PreBasis& preBasis) : preBasis_(&preBasis), node_(nullptr) -#endif {} /** \brief Bind the view to a grid element @@ -308,11 +218,7 @@ public: MultiIndex index(size_type i) const { Dune::LocalKey localKey = node_->finiteElement().localCoefficients().localKey(i); -#if DUNE_VERSION_LT(DUNE_FUNCTIONS,2,7) - const auto& gridIndexSet = nodeFactory_->gridView().indexSet(); -#else const auto& gridIndexSet = preBasis_->gridView().indexSet(); -#endif const auto& element = node_->element(); //return {{ gridIndexSet.subIndex(element,localKey.subEntity(),dim) }}; @@ -327,11 +233,7 @@ public: } protected: -#if DUNE_VERSION_LT(DUNE_FUNCTIONS,2,7) - const NodeFactory* nodeFactory_; -#else const PreBasis* preBasis_; -#endif const Node* node_; }; @@ -341,13 +243,8 @@ protected: * * \tparam GV The GridView that the space is defined on */ -#if DUNE_VERSION_LT(DUNE_FUNCTIONS,2,7) -template<typename GV, class ST = std::size_t> -using Periodic1DPQ1NodalBasis = DefaultGlobalBasis<Periodic1DPQ1NodeFactory<GV, FlatMultiIndex<ST>, ST> >; -#else template<typename GV> using Periodic1DPQ1NodalBasis = DefaultGlobalBasis<Periodic1DPQ1PreBasis<GV, FlatMultiIndex<std::size_t> > >; -#endif } // end namespace Functions } // end namespace Dune diff --git a/dune/gfe/riemannianpnsolver.cc b/dune/gfe/riemannianpnsolver.cc index 1976ed3c..8e0ca8bc 100644 --- a/dune/gfe/riemannianpnsolver.cc +++ b/dune/gfe/riemannianpnsolver.cc @@ -86,22 +86,12 @@ setup(const GridType& grid, LocalMapper, LocalMapper> matrixComm(*globalMapper_, grid_->leafGridView(), localMapper, localMapper, 0); if (instrumented_) { -#if !DUNE_VERSION_LT(DUNE_GEOMETRY, 2, 7) - auto -#endif - A = std::make_shared<ScalarMatrixType>(matrixComm.reduceAdd(localA)); + auto A = std::make_shared<ScalarMatrixType>(matrixComm.reduceAdd(localA)); #else if (instrumented_) { -#if !DUNE_VERSION_LT(DUNE_GEOMETRY, 2, 7) - auto -#endif - A = std::make_shared<ScalarMatrixType>(localA); + auto A = std::make_shared<ScalarMatrixType>(localA); #endif -#if DUNE_VERSION_LT(DUNE_GEOMETRY, 2, 7) - h1SemiNorm_ = std::make_shared<H1SemiNorm<CorrectionType> >(*A); -#else h1SemiNorm_ = std::make_shared<H1SemiNorm<CorrectionType> >(A); -#endif } ////////////////////////////////////////////////////////////////// // Create the inner solver using a cholmod solver @@ -120,19 +110,12 @@ setup(const GridType& grid, operatorAssembler.assemble(massStiffness, localMassMatrix); -#if !DUNE_VERSION_LT(DUNE_GEOMETRY, 2, 7) - auto -#endif #if HAVE_MPI - massMatrix = std::make_shared<ScalarMatrixType>(matrixComm.reduceAdd(localMassMatrix)); + auto massMatrix = std::make_shared<ScalarMatrixType>(matrixComm.reduceAdd(localMassMatrix)); #else - massMatrix = std::make_shared<ScalarMatrixType>(localMassMatrix); + auto massMatrix = std::make_shared<ScalarMatrixType>(localMassMatrix); #endif -#if DUNE_VERSION_LT(DUNE_GEOMETRY, 2, 7) - l2Norm_ = std::make_shared<H1SemiNorm<CorrectionType> >(*massMatrix); -#else l2Norm_ = std::make_shared<H1SemiNorm<CorrectionType> >(massMatrix); -#endif // Write all intermediate solutions, if requested if (instrumented_ diff --git a/dune/gfe/riemannianpnsolver.hh b/dune/gfe/riemannianpnsolver.hh index 1024a72a..f802bd81 100644 --- a/dune/gfe/riemannianpnsolver.hh +++ b/dune/gfe/riemannianpnsolver.hh @@ -140,11 +140,6 @@ protected: /** \brief Store information about solver runs for unit testing */ Statistics statistics_; -#if DUNE_VERSION_LT(DUNE_GEOMETRY, 2, 7) - std::shared_ptr<Dune::BCRSMatrix<Dune::FieldMatrix<double,1,1> > > A; - std::shared_ptr<Dune::BCRSMatrix<Dune::FieldMatrix<double,1,1> > > massMatrix; -#endif - }; #include "riemannianpnsolver.cc" diff --git a/dune/gfe/riemanniantrsolver.cc b/dune/gfe/riemanniantrsolver.cc index 89a0e324..4d0bd354 100644 --- a/dune/gfe/riemanniantrsolver.cc +++ b/dune/gfe/riemanniantrsolver.cc @@ -136,21 +136,11 @@ setup(const GridType& grid, LocalMapper, LocalMapper> matrixComm(*globalMapper_, grid_->leafGridView(), localMapper, localMapper, 0); -#if !DUNE_VERSION_LT(DUNE_GEOMETRY, 2, 7) - auto -#endif - A = std::make_shared<ScalarMatrixType>(matrixComm.reduceAdd(localA)); + auto A = std::make_shared<ScalarMatrixType>(matrixComm.reduceAdd(localA)); #else -#if !DUNE_VERSION_LT(DUNE_GEOMETRY, 2, 7) - auto -#endif - A = std::make_shared<ScalarMatrixType>(localA); + auto A = std::make_shared<ScalarMatrixType>(localA); #endif -#if DUNE_VERSION_LT(DUNE_GEOMETRY, 2, 7) - h1SemiNorm_ = std::make_shared<H1SemiNorm<CorrectionType> >(*A); -#else h1SemiNorm_ = std::make_shared<H1SemiNorm<CorrectionType> >(A); -#endif innerSolver_ = std::make_shared<::LoopSolver<CorrectionType> >(mmgStep, innerIterations_, @@ -168,19 +158,12 @@ setup(const GridType& grid, operatorAssembler.assemble(massStiffness, localMassMatrix); -#if !DUNE_VERSION_LT(DUNE_GEOMETRY, 2, 7) - auto -#endif #if HAVE_MPI - massMatrix = std::make_shared<ScalarMatrixType>(matrixComm.reduceAdd(localMassMatrix)); + auto massMatrix = std::make_shared<ScalarMatrixType>(matrixComm.reduceAdd(localMassMatrix)); #else - massMatrix = std::make_shared<ScalarMatrixType>(localMassMatrix); + auto massMatrix = std::make_shared<ScalarMatrixType>(localMassMatrix); #endif -#if DUNE_VERSION_LT(DUNE_GEOMETRY, 2, 7) - l2Norm_ = std::make_shared<H1SemiNorm<CorrectionType> >(*massMatrix); -#else l2Norm_ = std::make_shared<H1SemiNorm<CorrectionType> >(massMatrix); -#endif // Write all intermediate solutions, if requested if (instrumented_ diff --git a/dune/gfe/riemanniantrsolver.hh b/dune/gfe/riemanniantrsolver.hh index 3184c86f..959bb499 100644 --- a/dune/gfe/riemanniantrsolver.hh +++ b/dune/gfe/riemanniantrsolver.hh @@ -211,11 +211,6 @@ protected: /** \brief Store information about solver runs for unit testing */ Statistics statistics_; -#if DUNE_VERSION_LT(DUNE_GEOMETRY, 2, 7) - std::shared_ptr<Dune::BCRSMatrix<Dune::FieldMatrix<double,1,1> > > A; - std::shared_ptr<Dune::BCRSMatrix<Dune::FieldMatrix<double,1,1> > > massMatrix; -#endif - }; #include "riemanniantrsolver.cc" diff --git a/dune/gfe/unitvector.hh b/dune/gfe/unitvector.hh index 83f1813c..90e49808 100644 --- a/dune/gfe/unitvector.hh +++ b/dune/gfe/unitvector.hh @@ -4,11 +4,7 @@ #include <dune/common/fvector.hh> #include <dune/common/fmatrix.hh> #include <dune/common/version.hh> -#if DUNE_VERSION_GTE(DUNE_COMMON, 2, 7) #include <dune/common/math.hh> -#else -#include <dune/common/power.hh> -#endif #include <dune/gfe/tensor3.hh> #include <dune/gfe/symmetricmatrix.hh> @@ -39,12 +35,9 @@ class UnitVector const T eps = 1e-4; if (x > 1-eps) { // acos is not differentiable, use the series expansion instead return -2 * (x-1) + 1.0/3 * (x-1)*(x-1) - 4.0/45 * (x-1)*(x-1)*(x-1); - } else -#if DUNE_VERSION_GTE(DUNE_COMMON, 2, 7) + } else { return Dune::power(acos(x),2); -#else - return Dune::Power<2>::eval(acos(x)); -#endif + } } /** \brief Compute the derivative of arccos^2 without getting unstable for x close to 1 */ diff --git a/dune/gfe/vtkfile.hh b/dune/gfe/vtkfile.hh index eee61858..168c5ca3 100644 --- a/dune/gfe/vtkfile.hh +++ b/dune/gfe/vtkfile.hh @@ -56,34 +56,19 @@ namespace Dune { writer.beginMain(); writer.beginPointData(); -#if DUNE_VERSION_LT(DUNE_FUNCTIONS,2,7) - writer.addArray<float>("director0", 3); - writer.addArray<float>("director1", 3); - writer.addArray<float>("director2", 3); - writer.addArray<float>("zCoord", 1); -#else writer.addArray("director0", 3, VTK::Precision::float32); writer.addArray("director1", 3, VTK::Precision::float32); writer.addArray("director2", 3, VTK::Precision::float32); writer.addArray("zCoord", 1, VTK::Precision::float32); -#endif writer.endPointData(); writer.beginCellData(); -#if DUNE_VERSION_LT(DUNE_FUNCTIONS,2,7) - writer.addArray<float>("mycelldata", 1); -#else writer.addArray("mycelldata", 1, VTK::Precision::float32); -#endif writer.endCellData(); // dump point coordinates writer.beginPoints(); -#if DUNE_VERSION_LT(DUNE_FUNCTIONS,2,7) - writer.addArray<float>("Coordinates", 3); -#else writer.addArray("Coordinates", 3, VTK::Precision::float32); -#endif writer.endPoints(); for (int i=0; i<mpiHelper.size(); i++) @@ -104,11 +89,7 @@ namespace Dune { // Write vertex coordinates outFile << " <Points>" << std::endl; { // extra parenthesis to control destruction of the pointsWriter object -#if DUNE_VERSION_LT(DUNE_FUNCTIONS,2,7) - Dune::VTK::AsciiDataArrayWriter<float> pointsWriter(outFile, "Coordinates", 3, Dune::Indent(4)); -#else Dune::VTK::AsciiDataArrayWriter pointsWriter(outFile, "Coordinates", 3, Dune::Indent(4), VTK::Precision::float32); -#endif for (size_t i=0; i<points_.size(); i++) for (int j=0; j<3; j++) pointsWriter.write(points_[i][j]); @@ -118,31 +99,19 @@ namespace Dune { // Write elements outFile << " <Cells>" << std::endl; { // extra parenthesis to control destruction of the cellConnectivityWriter object -#if DUNE_VERSION_LT(DUNE_FUNCTIONS,2,7) - Dune::VTK::AsciiDataArrayWriter<int> cellConnectivityWriter(outFile, "connectivity", 1, Dune::Indent(4)); -#else Dune::VTK::AsciiDataArrayWriter cellConnectivityWriter(outFile, "connectivity", 1, Dune::Indent(4), VTK::Precision::int32); -#endif for (size_t i=0; i<cellConnectivity_.size(); i++) cellConnectivityWriter.write(cellConnectivity_[i]); } { // extra parenthesis to control destruction of the writer object -#if DUNE_VERSION_LT(DUNE_FUNCTIONS,2,7) - Dune::VTK::AsciiDataArrayWriter<int> cellOffsetsWriter(outFile, "offsets", 1, Dune::Indent(4)); -#else Dune::VTK::AsciiDataArrayWriter cellOffsetsWriter(outFile, "offsets", 1, Dune::Indent(4), VTK::Precision::int32); -#endif for (size_t i=0; i<cellOffsets_.size(); i++) cellOffsetsWriter.write(cellOffsets_[i]); } { // extra parenthesis to control destruction of the writer object -#if DUNE_VERSION_LT(DUNE_FUNCTIONS,2,7) - Dune::VTK::AsciiDataArrayWriter<unsigned int> cellTypesWriter(outFile, "types", 1, Dune::Indent(4)); -#else Dune::VTK::AsciiDataArrayWriter cellTypesWriter(outFile, "types", 1, Dune::Indent(4), VTK::Precision::uint32); -#endif for (size_t i=0; i<cellTypes_.size(); i++) cellTypesWriter.write(cellTypes_[i]); } @@ -156,11 +125,7 @@ namespace Dune { // Z coordinate for better visualization of wrinkles { // extra parenthesis to control destruction of the writer object -#if DUNE_VERSION_LT(DUNE_FUNCTIONS,2,7) - Dune::VTK::AsciiDataArrayWriter<float> zCoordWriter(outFile, "zCoord", 1, Dune::Indent(4)); -#else Dune::VTK::AsciiDataArrayWriter zCoordWriter(outFile, "zCoord", 1, Dune::Indent(4), VTK::Precision::float32); -#endif for (size_t i=0; i<zCoord_.size(); i++) zCoordWriter.write(zCoord_[i]); } @@ -168,11 +133,7 @@ namespace Dune { // The three director fields for (size_t i=0; i<3; i++) { -#if DUNE_VERSION_LT(DUNE_FUNCTIONS,2,7) - Dune::VTK::AsciiDataArrayWriter<float> directorWriter(outFile, "director" + std::to_string(i), 3, Dune::Indent(4)); -#else Dune::VTK::AsciiDataArrayWriter directorWriter(outFile, "director" + std::to_string(i), 3, Dune::Indent(4), VTK::Precision::float32); -#endif for (size_t j=0; j<directors_[i].size(); j++) for (int k=0; k<3; k++) directorWriter.write(directors_[i][j][k]); @@ -188,11 +149,7 @@ namespace Dune { { outFile << " <CellData>" << std::endl; { // extra parenthesis to control destruction of the writer object -#if DUNE_VERSION_LT(DUNE_FUNCTIONS,2,7) - Dune::VTK::AsciiDataArrayWriter<float> cellDataWriter(outFile, "mycelldata", 1, Dune::Indent(4)); -#else Dune::VTK::AsciiDataArrayWriter cellDataWriter(outFile, "mycelldata", 1, Dune::Indent(4), VTK::Precision::float32); -#endif for (size_t i=0; i<cellData_.size(); i++) cellDataWriter.write(cellData_[i]); } diff --git a/src/cosserat-continuum.cc b/src/cosserat-continuum.cc index a34e1774..fb68dbcd 100644 --- a/src/cosserat-continuum.cc +++ b/src/cosserat-continuum.cc @@ -32,7 +32,6 @@ #include <dune/fufem/boundarypatch.hh> #include <dune/fufem/functiontools/boundarydofs.hh> -#include <dune/fufem/functionspacebases/dunefunctionsbasis.hh> #include <dune/fufem/dunepython.hh> #include <dune/solvers/solvers/iterativesolver.hh> @@ -203,18 +202,9 @@ int main (int argc, char *argv[]) try DeformationFEBasis deformationFEBasis(gridView); OrientationFEBasis orientationFEBasis(gridView); - // Construct fufem-style function space bases to ease the transition to dune-functions - typedef DuneFunctionsBasis<DeformationFEBasis> FufemDeformationFEBasis; - FufemDeformationFEBasis fufemDeformationFEBasis(deformationFEBasis); - - typedef DuneFunctionsBasis<OrientationFEBasis> FufemOrientationFEBasis; - FufemOrientationFEBasis fufemOrientationFEBasis(orientationFEBasis); #else typedef Dune::Functions::LagrangeBasis<typename GridType::LeafGridView, displacementOrder> FEBasis; FEBasis feBasis(gridView); - - typedef DuneFunctionsBasis<FEBasis> FufemFEBasis; - FufemFEBasis fufemFeBasis(feBasis); #endif // ///////////////////////////////////////// @@ -252,10 +242,10 @@ int main (int argc, char *argv[]) try #ifdef MIXED_SPACE BitSetVector<1> deformationDirichletNodes(deformationFEBasis.size(), false); - constructBoundaryDofs(dirichletBoundary,fufemDeformationFEBasis,deformationDirichletNodes); + constructBoundaryDofs(dirichletBoundary,deformationFEBasis,deformationDirichletNodes); BitSetVector<1> neumannNodes(deformationFEBasis.size(), false); - constructBoundaryDofs(neumannBoundary,fufemDeformationFEBasis,neumannNodes); + constructBoundaryDofs(neumannBoundary,deformationFEBasis,neumannNodes); BitSetVector<3> deformationDirichletDofs(deformationFEBasis.size(), false); for (size_t i=0; i<deformationFEBasis.size(); i++) @@ -264,7 +254,7 @@ int main (int argc, char *argv[]) try deformationDirichletDofs[i][j] = true; BitSetVector<1> orientationDirichletNodes(orientationFEBasis.size(), false); - constructBoundaryDofs(dirichletBoundary,fufemOrientationFEBasis,orientationDirichletNodes); + constructBoundaryDofs(dirichletBoundary,orientationFEBasis,orientationDirichletNodes); BitSetVector<3> orientationDirichletDofs(orientationFEBasis.size(), false); for (size_t i=0; i<orientationFEBasis.size(); i++) @@ -273,18 +263,11 @@ int main (int argc, char *argv[]) try orientationDirichletDofs[i][j] = true; #else BitSetVector<1> dirichletNodes(feBasis.size(), false); -#if DUNE_VERSION_LT(DUNE_GEOMETRY, 2, 7) - constructBoundaryDofs(dirichletBoundary,fufemFeBasis,dirichletNodes); -#else constructBoundaryDofs(dirichletBoundary,feBasis,dirichletNodes); -#endif BitSetVector<1> neumannNodes(feBasis.size(), false); -#if DUNE_VERSION_LT(DUNE_GEOMETRY, 2, 7) - constructBoundaryDofs(neumannBoundary,fufemFeBasis,neumannNodes); -#else constructBoundaryDofs(neumannBoundary,feBasis,neumannNodes); -#endif + BitSetVector<blocksize> dirichletDofs(feBasis.size(), false); for (size_t i=0; i<feBasis.size(); i++) diff --git a/src/film-on-substrate.cc b/src/film-on-substrate.cc index 883b37eb..7ff5945e 100644 --- a/src/film-on-substrate.cc +++ b/src/film-on-substrate.cc @@ -80,19 +80,6 @@ const int stressFreeDataOrder = 2; static_assert(displacementOrder==rotationOrder, "displacement and rotation order do not match!"); #endif -#if DUNE_VERSION_LT(DUNE_COMMON, 2, 7) -template<> -struct Dune::MathematicalConstants<adouble> -{ - static const adouble pi () - { - using std::acos; - static const adouble pi = acos( adouble( -1 ) ); - return pi; - } -}; -#endif - //differentiation method typedef adouble ValueType; diff --git a/src/harmonicmaps.cc b/src/harmonicmaps.cc index ee6abd62..a5f0c3a4 100644 --- a/src/harmonicmaps.cc +++ b/src/harmonicmaps.cc @@ -232,12 +232,7 @@ int main (int argc, char *argv[]) BitSetVector<blocksize> dirichletNodes(feBasis.size(), false); -#if DUNE_VERSION_LT(DUNE_GEOMETRY, 2, 7) - DuneFunctionsBasis<FEBasis> fufemBasis(feBasis); - constructBoundaryDofs(dirichletBoundary,fufemBasis,dirichletNodes); -#else constructBoundaryDofs(dirichletBoundary,feBasis,dirichletNodes); -#endif // ////////////////////////// // Initial iterate diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 042be43e..91c1f248 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -25,12 +25,10 @@ dune_add_test(SOURCES harmonicmaptest.cc TIMEOUT 600 CMAKE_GUARD MPI_FOUND) -if (${DUNE_ELASTICITY_VERSION} VERSION_GREATER_EQUAL 2.7) dune_add_test(SOURCES geodesicfeassemblerwrappertest.cc MPI_RANKS 1 4 TIMEOUT 600 CMAKE_GUARD MPI_FOUND) -endif() # Copy the example grid used for testing into the build dir file(COPY grids/irregular-square.msh DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/grids) diff --git a/test/harmonicmaptest.cc b/test/harmonicmaptest.cc index adc1467b..11282720 100644 --- a/test/harmonicmaptest.cc +++ b/test/harmonicmaptest.cc @@ -63,11 +63,7 @@ int main (int argc, char *argv[]) // /////////////////////////////////////// using GridType = UGGrid<dim>; -#if DUNE_VERSION_LT(DUNE_GEOMETRY, 2, 7) - std::shared_ptr<GridType> grid(GmshReader<GridType>::read("grids/irregular-square.msh")); -#else std::shared_ptr<GridType> grid = GmshReader<GridType>::read("grids/irregular-square.msh"); -#endif grid->globalRefine(numLevels-1); @@ -123,12 +119,7 @@ int main (int argc, char *argv[]) BoundaryPatch<GridView> dirichletBoundary(gridView, dirichletVertices); BitSetVector<TargetSpace::TangentVector::dimension> dirichletNodes(powerBasis.size(), false); -#if DUNE_VERSION_LT(DUNE_GEOMETRY, 2, 7) - DuneFunctionsBasis<FEBasis> fufemBasis(feBasis); - constructBoundaryDofs(dirichletBoundary,fufemBasis,dirichletNodes); -#else constructBoundaryDofs(dirichletBoundary,tangentBasis,dirichletNodes); -#endif //////////////////////////// // Initial iterate -- GitLab