From 780368c807599e9dcc226c84cfdf2763af6e78d4 Mon Sep 17 00:00:00 2001 From: Lisa Julia Nebel <lisa_julia.nebel@tu-dresden.de> Date: Tue, 19 Jan 2021 08:52:03 +0100 Subject: [PATCH] Only support dune-functions >=2.7 Remove all compiler macros checking the dune-functions version --- dune.module | 2 +- dune/gfe/cosseratvtkwriter.hh | 4 - dune/gfe/linearalgebra.hh | 173 +-------------------------- dune/gfe/localprojectedfefunction.hh | 18 --- dune/gfe/mixedgfeassembler.hh | 52 +------- dune/gfe/periodic1dpq1nodalbasis.hh | 103 ---------------- dune/gfe/vtkfile.hh | 43 ------- 7 files changed, 6 insertions(+), 389 deletions(-) diff --git a/dune.module b/dune.module index 9eb6dbfb..35e749e0 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-grid dune-uggrid dune-istl dune-localfunctions dune-functions (>=2.7) dune-solvers dune-fufem dune-elasticity 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/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/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]); } -- GitLab