Commit 9791f45d authored by Praetorius, Simon's avatar Praetorius, Simon
Browse files

workaround for communicators in blocked bases, use SequentialCommunication if not flat MultiIndex

parent e11f58ce
......@@ -23,12 +23,13 @@
#include <dune/typetree/treepath.hh>
#include <amdis/common/Concepts.hpp>
#include <amdis/common/TypeTraits.hpp>
#include <amdis/linearalgebra/Traits.hpp>
#include <amdis/AdaptiveGrid.hpp>
#include <amdis/Observer.hpp>
#include <amdis/Output.hpp>
#include <amdis/common/Concepts.hpp>
#include <amdis/common/TypeTraits.hpp>
#include <amdis/linearalgebra/Traits.hpp>
#include <amdis/typetree/MultiIndex.hpp>
#if DUNE_VERSION_LT(DUNE_FUNCTIONS,2,7)
#include <dune/functions/functionspacebases/defaultlocalindexset.hh>
......@@ -65,7 +66,9 @@ namespace AMDiS
using LocalView = Dune::Functions::DefaultLocalView<Self>;
/// Type of the communicator
using Comm = typename BackendTraits<Self>::Comm;
using Comm = std::conditional_t<Traits::IsFlatIndex<typename Super::MultiIndex>::value,
typename BackendTraits<Self>::Comm,
SequentialCommunication>;
struct DummyImpl {};
using ADH = Dune::AdaptDataHandle<Grid, DummyImpl>;
......
......@@ -5,6 +5,21 @@
namespace AMDiS
{
namespace Traits
{
template <class T>
struct IsFlatIndex
: std::is_integral<T> {};
template <class I>
struct IsFlatIndex<Dune::Functions::FlatMultiIndex<I> >
: std::true_type {};
template <class I>
struct IsFlatIndex<Dune::ReservedVector<I, 1> >
: std::true_type {};
}
inline std::size_t flatMultiIndex(std::size_t idx)
{
return idx;
......
Markdown is supported
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