[Dune] Use of partition iterators
Ganesh Diwan
gcdiwan83 at gmail.com
Mon Sep 14 19:10:08 CEST 2015
Dear Dune
I am trying to figure out the way iterator ranges are used for walking
through the grid entities. I am using uggrid in 2d.
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.
The error for following lines in my code:
for (auto&& e : vertices(view,Dune::Partitions::border))
{
std::cout << e.geometry().center() << std::endl;
}
is as below:
In file included from
/home/gcd3/dune/core-2.4.0/install/include/dune/grid/common/rangegenerators.hh:9:0,
from
/home/gcd3/dune/core-2.4.0/install/include/dune/grid/common/gridview.hh:11,
from
/home/gcd3/dune/core-2.4.0/install/include/dune/grid/common/grid.hh:27,
from
/home/gcd3/dune/core-2.4.0/install/include/dune/grid/common/gridfactory.hh:19,
from
/home/gcd3/dune/core-2.4.0/install/include/dune/grid/io/file/gmshreader.hh:24,
from /home/gcd3/codes/vem/dune-part/src/dune-part.cc:8:
/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>’:
/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]’
/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]’
/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]’
/home/gcd3/codes/vem/dune-part/src/MeshContainer.hh:138:56: required from
‘bool test(GridType&) [with GridType = Dune::UGGrid<2>]’
/home/gcd3/codes/vem/dune-part/src/dune-part.cc:115:13: required from here
/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
static_assert(AlwaysFalse<std::integral_constant<unsigned
int,partitions> >::value,
^
In file included from /home/gcd3/codes/vem/dune-part/src/dune-part.cc:30:0:
/home/gcd3/codes/vem/dune-part/src/MeshContainer.hh: In instantiation of
‘bool test(GridType&) [with GridType = Dune::UGGrid<2>]’:
/home/gcd3/codes/vem/dune-part/src/dune-part.cc:115:13: required from here
/home/gcd3/codes/vem/dune-part/src/MeshContainer.hh:138:56: error: no
matching function for call to ‘vertices(const GridView&, const Border&)’
for (auto&& e : vertices(view,Dune::Partitions::border))
^
/home/gcd3/codes/vem/dune-part/src/MeshContainer.hh:138:56: note:
candidates are:
In file included from
/home/gcd3/dune/core-2.4.0/install/include/dune/grid/common/gridview.hh:11:0,
from
/home/gcd3/dune/core-2.4.0/install/include/dune/grid/common/grid.hh:27,
from
/home/gcd3/dune/core-2.4.0/install/include/dune/grid/common/gridfactory.hh:19,
from
/home/gcd3/dune/core-2.4.0/install/include/dune/grid/io/file/gmshreader.hh:24,
from /home/gcd3/codes/vem/dune-part/src/dune-part.cc:8:
/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>)
inline auto vertices(const GV& gv, PartitionSet<partitions>)
^
/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
/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&)
inline auto vertices(const GV& gv)
^
/home/gcd3/dune/core-2.4.0/install/include/dune/grid/common/rangegenerators.hh:896:15:
note: template argument deduction/substitution failed:
In file included from /home/gcd3/codes/vem/dune-part/src/dune-part.cc:30:0:
/home/gcd3/codes/vem/dune-part/src/MeshContainer.hh:138:56: note:
candidate expects 1 argument, 2 provided
for (auto&& e : vertices(view,Dune::Partitions::border))
^
make[2]: *** [src/CMakeFiles/dune-part.dir/dune-part.cc.o] Error 1
make[1]: *** [src/CMakeFiles/dune-part.dir/all] Error 2
make: *** [all] Error 2
Thank you for your help,
Ganesh
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.dune-project.org/pipermail/dune/attachments/20150914/d298c5cd/attachment.htm>
More information about the Dune
mailing list