Skip to content
Snippets Groups Projects
Commit 2da6b536 authored by Santiago Ospina De Los Ríos's avatar Santiago Ospina De Los Ríos
Browse files

Merge branch 'feature/add-entity-iterator-capabilities' into 'master'

Add entity iterator capabilities

See merge request !28
parents 2b488e8b d0606cff
No related branches found
No related tags found
1 merge request!28Add entity iterator capabilities
Pipeline #38152 passed
......@@ -17,6 +17,8 @@ Changes
* Fix bug where lelve index sets where not updated after grid adaptation.
* Add entity iterator capabilities
### MultiDomainGrid 2.7
......
......@@ -32,6 +32,11 @@ namespace Capabilities {
static const bool v = hasEntity<HostGrid,codim>::v;
};
template<class HostGrid, typename MDGridTraits, int codim>
struct hasEntityIterator<MultiDomainGrid<HostGrid,MDGridTraits>, codim>
{
static const bool v = hasEntityIterator<HostGrid,codim>::v;
};
template<class HostGrid, typename MDGridTraits, int codim>
struct canCommunicate<MultiDomainGrid<HostGrid,MDGridTraits>, codim>
......@@ -103,6 +108,11 @@ namespace Capabilities {
static const bool v = hasEntity<MDGrid,codim>::v;
};
template<class MDGrid, int codim>
struct hasEntityIterator<Dune::mdgrid::subdomain::SubDomainGrid<MDGrid>, codim>
{
static const bool v = hasEntityIterator<MDGrid,codim>::v;
};
template<class MDGrid, int codim>
struct canCommunicate<Dune::mdgrid::subdomain::SubDomainGrid<MDGrid>, codim>
......
......@@ -13,6 +13,10 @@
#include <algorithm>
#include <iterator>
#if HAVE_UG
#include <dune/grid/uggrid.hh>
#endif
template<typename GV, typename DataVector>
class RankTransfer
: public Dune::CommDataHandleIF<RankTransfer<GV,DataVector>,
......@@ -210,6 +214,22 @@ int main(int argc, char** argv)
testGrid(hostgrid,"YaspGrid_2",mpihelper);
}
{
#if HAVE_UG
typedef Dune::UGGrid<2> HostGrid;
Dune::FieldVector<double,2> lower_left(0.0);
Dune::FieldVector<double,2> upper_right(1.0);
std::array<unsigned int,2> n = {{uint(N),uint(N)}};
auto gridPtr = Dune::StructuredGridFactory<HostGrid>::createCubeGrid(
lower_left,
upper_right,
n
);
gridPtr->loadBalance();
testGrid(*gridPtr,"UGGrid_2",mpihelper);
#endif
}
}
catch (Dune::Exception & e) {
std::cout << "DUNE ERROR: " << e.what() << std::endl;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment