<div dir="ltr"><div><div><div><div><div><div>Dear Dune<br><br></div>I am trying to figure out the way iterator ranges are used for walking through the grid entities. I am using uggrid in 2d.<br></div><div>For eg using vertex iterator for Dune::Partitions::interior goes through whereas the same for Dune::partitions::border throws error as below. Similar errors appear for for accessing edges for Dune::Partitions::interior and Dune::Partitions::interiorBorder. Could you please comment on what I am doing wrong.<br></div></div></div><br></div><div>The error for following lines in my code:<br><br>    for (auto&& e : vertices(view,Dune::Partitions::border))<br>    {<br>        std::cout << e.geometry().center() << std::endl;<br>    }<br><br></div><div>is as below:<br></div><div><br><br>In file included from /home/gcd3/dune/core-2.4.0/install/include/dune/grid/common/rangegenerators.hh:9:0,<br>                 from /home/gcd3/dune/core-2.4.0/install/include/dune/grid/common/gridview.hh:11,<br>                 from /home/gcd3/dune/core-2.4.0/install/include/dune/grid/common/grid.hh:27,<br>                 from /home/gcd3/dune/core-2.4.0/install/include/dune/grid/common/gridfactory.hh:19,<br>                 from /home/gcd3/dune/core-2.4.0/install/include/dune/grid/io/file/gmshreader.hh:24,<br>                 from /home/gcd3/codes/vem/dune-part/src/dune-part.cc:8:<br>/home/gcd3/dune/core-2.4.0/install/include/dune/grid/common/partitionset.hh: In instantiation of ‘struct Dune::{anonymous}::derive_partition_iterator_type<2u>’:<br>/home/gcd3/dune/core-2.4.0/install/include/dune/grid/common/rangegenerators.hh:780:3:   required by substitution of ‘template<class GV, int codim, unsigned int partitions> Dune::IteratorRange<typename GV::Codim<codim>::Partition<Dune::{anonymous}::derive_partition_iterator_type<partitions>::value>::Iterator> Dune::entities(const GV&, Dune::Codim<codim>, Dune::PartitionSet<partitions>) [with GV = Dune::GridView<Dune::UGGridLeafGridViewTraits<const Dune::UGGrid<2>, (Dune::PartitionIteratorType)4u> >; int codim = 2; unsigned int partitions = 2u]’<br>/home/gcd3/dune/core-2.4.0/install/include/dune/grid/common/rangegenerators.hh:832:84:   required by substitution of ‘template<class GV, int dim, unsigned int partitions> decltype (Dune::entities(gv, Dune::Codim<(GV:: dimension - dim)>(), Dune::PartitionSet<partitions>())) Dune::entities(const GV&, Dune::Dim<dim>, Dune::PartitionSet<partitions>) [with GV = Dune::GridView<Dune::UGGridLeafGridViewTraits<const Dune::UGGrid<2>, (Dune::PartitionIteratorType)4u> >; int dim = 0; unsigned int partitions = 2u]’<br>/home/gcd3/dune/core-2.4.0/install/include/dune/grid/common/rangegenerators.hh:890:64:   required by substitution of ‘template<class GV, unsigned int partitions> decltype (Dune::entities(gv, Dune::Dim<0>(), Dune::PartitionSet<partitions>())) Dune::vertices(const GV&, Dune::PartitionSet<partitions>) [with GV = Dune::GridView<Dune::UGGridLeafGridViewTraits<const Dune::UGGrid<2>, (Dune::PartitionIteratorType)4u> >; unsigned int partitions = 2u]’<br>/home/gcd3/codes/vem/dune-part/src/MeshContainer.hh:138:56:   required from ‘bool test(GridType&) [with GridType = Dune::UGGrid<2>]’<br>/home/gcd3/codes/vem/dune-part/src/dune-part.cc:115:13:   required from here<br>/home/gcd3/dune/core-2.4.0/install/include/dune/grid/common/partitionset.hh:24:7: error: static assertion failed: There is no partition iterator for this combination of entity partitions<br>       static_assert(AlwaysFalse<std::integral_constant<unsigned int,partitions> >::value,<br>       ^<br>In file included from /home/gcd3/codes/vem/dune-part/src/dune-part.cc:30:0:<br>/home/gcd3/codes/vem/dune-part/src/MeshContainer.hh: In instantiation of ‘bool test(GridType&) [with GridType = Dune::UGGrid<2>]’:<br>/home/gcd3/codes/vem/dune-part/src/dune-part.cc:115:13:   required from here<br>/home/gcd3/codes/vem/dune-part/src/MeshContainer.hh:138:56: error: no matching function for call to ‘vertices(const GridView&, const Border&)’<br>  for (auto&& e : vertices(view,Dune::Partitions::border))<br>                                                        ^<br>/home/gcd3/codes/vem/dune-part/src/MeshContainer.hh:138:56: note: candidates are:<br>In file included from /home/gcd3/dune/core-2.4.0/install/include/dune/grid/common/gridview.hh:11:0,<br>                 from /home/gcd3/dune/core-2.4.0/install/include/dune/grid/common/grid.hh:27,<br>                 from /home/gcd3/dune/core-2.4.0/install/include/dune/grid/common/gridfactory.hh:19,<br>                 from /home/gcd3/dune/core-2.4.0/install/include/dune/grid/io/file/gmshreader.hh:24,<br>                 from /home/gcd3/codes/vem/dune-part/src/dune-part.cc:8:<br>/home/gcd3/dune/core-2.4.0/install/include/dune/grid/common/rangegenerators.hh:889:15: note: template<class GV, unsigned int partitions> decltype (Dune::entities(gv, Dune::Dim<0>(), Dune::PartitionSet<partitions>())) Dune::vertices(const GV&, Dune::PartitionSet<partitions>)<br>   inline auto vertices(const GV& gv, PartitionSet<partitions>)<br>               ^<br>/home/gcd3/dune/core-2.4.0/install/include/dune/grid/common/rangegenerators.hh:889:15: note:   substitution of deduced template arguments resulted in errors seen above<br>/home/gcd3/dune/core-2.4.0/install/include/dune/grid/common/rangegenerators.hh:896:15: note: template<class GV> decltype (Dune::entities(gv, Dune::Dim<0>())) Dune::vertices(const GV&)<br>   inline auto vertices(const GV& gv)<br>               ^<br>/home/gcd3/dune/core-2.4.0/install/include/dune/grid/common/rangegenerators.hh:896:15: note:   template argument deduction/substitution failed:<br>In file included from /home/gcd3/codes/vem/dune-part/src/dune-part.cc:30:0:<br>/home/gcd3/codes/vem/dune-part/src/MeshContainer.hh:138:56: note:   candidate expects 1 argument, 2 provided<br>  for (auto&& e : vertices(view,Dune::Partitions::border))<br>                                                        ^<br>make[2]: *** [src/CMakeFiles/dune-part.dir/dune-part.cc.o] Error 1<br>make[1]: *** [src/CMakeFiles/dune-part.dir/all] Error 2<br>make: *** [all] Error 2<br><br></div>Thank you for your help,<br></div>Ganesh<br><div><div><br></div></div></div>