Commit b58aa023 authored by Bernd Flemisch's avatar Bernd Flemisch
Browse files

Merge branch 'fix/datahandleif-fixedsize-versioncheck' into 'master'

[dune] Fix fixedSize interface using version check

See merge request !1886
parents e5223391 87bf7955
......@@ -103,8 +103,15 @@ struct GmshGridDataHandle : public Dune::CommDataHandleIF<GmshGridDataHandle<Gri
bool contains (int dim, int codim) const
{ return codim == 0 || codim == 1; }
bool fixedSize (int dim, int codim) const
#if DUNE_VERSION_GT(DUNE_GRID,2,7)
//! returns true if size per entity of given dim and codim is a constant
bool fixedSize(int dim, int codim) const
{ return true; }
#else
//! returns true if size per entity of given dim and codim is a constant
bool fixedsize(int dim, int codim) const
{ return true; }
#endif
template<class EntityType>
std::size_t size (const EntityType& e) const
......@@ -181,8 +188,15 @@ struct GmshGridDataHandle<Dune::UGGrid<dimgrid>, GridFactory, Data>
bool contains (int dim, int codim) const
{ return codim == 0 || codim == 1; }
bool fixedSize (int dim, int codim) const
#if DUNE_VERSION_GT(DUNE_GRID,2,7)
//! returns true if size per entity of given dim and codim is a constant
bool fixedSize(int dim, int codim) const
{ return true; }
#else
//! returns true if size per entity of given dim and codim is a constant
bool fixedsize(int dim, int codim) const
{ return true; }
#endif
template<class EntityType>
std::size_t size (const EntityType& e) const
......
......@@ -32,6 +32,7 @@
#include <type_traits>
#include <functional>
#include <dune/common/version.hh>
#include <dune/common/exceptions.hh>
#include <dune/common/indices.hh>
#include <dune/grid/common/partitionset.hh>
......@@ -66,8 +67,15 @@ public:
bool contains(int dim, int cd) const
{ return cd == codim; }
bool fixedSize(int dim, int cd) const
#if DUNE_VERSION_GT(DUNE_GRID,2,7)
//! returns true if size per entity of given dim and codim is a constant
bool fixedSize(int dim, int codim) const
{ return true; }
#else
//! returns true if size per entity of given dim and codim is a constant
bool fixedsize(int dim, int codim) const
{ return true; }
#endif
template<class EntityType>
size_t size (const EntityType &e) const
......
......@@ -65,8 +65,15 @@ class ParallelISTLHelper
bool contains(int dim, int codim) const
{ return dofCodim == codim; }
#if DUNE_VERSION_GT(DUNE_GRID,2,7)
//! returns true if size per entity of given dim and codim is a constant
bool fixedSize(int dim, int codim) const
{ return true; }
#else
//! returns true if size per entity of given dim and codim is a constant
bool fixedsize(int dim, int codim) const
{ return true; }
#endif
template<class EntityType>
std::size_t size(EntityType& e) const
......@@ -91,7 +98,11 @@ class ParallelISTLHelper
public:
using DataType = typename V::block_type;
using BaseGatherScatter::contains;
#if DUNE_VERSION_GT(DUNE_GRID,2,7)
using BaseGatherScatter::fixedSize;
#else
using BaseGatherScatter::fixedsize;
#endif
using BaseGatherScatter::size;
ConsistencyBoxGatherScatter(V& container, const DofMapper& mapper)
......@@ -129,7 +140,11 @@ class ParallelISTLHelper
public:
using DataType = std::size_t;
using BaseGatherScatter::contains;
#if DUNE_VERSION_GT(DUNE_GRID,2,7)
using BaseGatherScatter::fixedSize;
#else
using BaseGatherScatter::fixedsize;
#endif
using BaseGatherScatter::size;
GhostGatherScatter(std::vector<std::size_t>& ranks, const DofMapper& mapper)
......@@ -171,7 +186,11 @@ class ParallelISTLHelper
public:
using DataType = std::size_t;
using BaseGatherScatter::contains;
#if DUNE_VERSION_GT(DUNE_GRID,2,7)
using BaseGatherScatter::fixedSize;
#else
using BaseGatherScatter::fixedsize;
#endif
using BaseGatherScatter::size;
InteriorBorderGatherScatter(std::vector<std::size_t>& ranks, const DofMapper& mapper)
......@@ -210,7 +229,11 @@ class ParallelISTLHelper
{
using DataType = int;
using BaseGatherScatter::contains;
#if DUNE_VERSION_GT(DUNE_GRID,2,7)
using BaseGatherScatter::fixedSize;
#else
using BaseGatherScatter::fixedsize;
#endif
using BaseGatherScatter::size;
NeighbourGatherScatter(const DofMapper& mapper, int rank, std::set<int>& neighbours)
......@@ -246,7 +269,11 @@ class ParallelISTLHelper
{
using DataType = int;
using BaseGatherScatter::contains;
#if DUNE_VERSION_GT(DUNE_GRID,2,7)
using BaseGatherScatter::fixedSize;
#else
using BaseGatherScatter::fixedsize;
#endif
using BaseGatherScatter::size;
SharedGatherScatter(std::vector<int>& shared, const DofMapper& mapper)
......@@ -283,7 +310,11 @@ class ParallelISTLHelper
{
using DataType = GlobalIndex;
using BaseGatherScatter::contains;
#if DUNE_VERSION_GT(DUNE_GRID,2,7)
using BaseGatherScatter::fixedSize;
#else
using BaseGatherScatter::fixedsize;
#endif
using BaseGatherScatter::size;
GlobalIndexGatherScatter(std::vector<GlobalIndex>& globalIndices, const DofMapper& mapper)
......@@ -536,11 +567,15 @@ class ParallelMatrixHelper
bool contains (int dim, int codim) const
{ return (codim == dofCodim); }
/*!
* \brief Returns true if size of data per entity of given dim and codim is a constant
*/
bool fixedSize (int dim, int codim) const
#if DUNE_VERSION_GT(DUNE_GRID,2,7)
//! returns true if size per entity of given dim and codim is a constant
bool fixedSize(int dim, int codim) const
{ return false; }
#else
//! returns true if size per entity of given dim and codim is a constant
bool fixedsize(int dim, int codim) const
{ return false; }
#endif
/*!
* \brief How many objects of type DataType have to be sent for a given entity
......@@ -633,11 +668,15 @@ class ParallelMatrixHelper
bool contains(int dim, int codim) const
{ return (codim == dofCodim); }
/*!
* \brief Returns true if size of data per entity of given dim and codim is a constant
*/
#if DUNE_VERSION_GT(DUNE_GRID,2,7)
//! returns true if size per entity of given dim and codim is a constant
bool fixedSize(int dim, int codim) const
{ return false; }
#else
//! returns true if size per entity of given dim and codim is a constant
bool fixedsize(int dim, int codim) const
{ return false; }
#endif
/*!
* \brief How many objects of type DataType have to be sent for a given entity
......
......@@ -87,9 +87,15 @@ public:
bool contains(int dim, int codim) const
{ return (codim == entityCodim); }
#if DUNE_VERSION_GT(DUNE_GRID,2,7)
//! returns true if size per entity of given dim and codim is a constant
bool fixedSize(int dim, int codim) const
{ return true; }
#else
//! returns true if size per entity of given dim and codim is a constant
bool fixedsize(int dim, int codim) const
{ return true; }
#endif
/*!
* \brief how many objects of type DataType have to be sent for a given entity
......
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