Hi,
I think it's just the documentation that can be slightly improved here.
The function get_active_child_cells has a similar signature but it has
this note in its documentation:
* @note Since in C++ the MeshType template argument can not be deduced from
* a function call, you will have to specify it after the function name, as
* for example in
* @code
* GridTools::get_active_child_cells > (cell)
* @endcode
*/
template
std::vector
get_active_child_cells(const typename MeshType::cell_iterator &cell);
The same note should maybe be added to get_active_neighbors for clarity.
Best,
Simon
On Thursday, November 28, 2019 at 10:03:17 AM UTC+1, Andreas Kyritsakis
wrote:
>
> Hello,
>
> This is to report what I think is a bug in
> GridTools::get_active_neighbors().
>
> The following code should compile but it does not.
>
> #include
> #include
> #include
> #include
> using namespace dealii;
>
> template
> class Test{
> public:
> Test(Triangulation *tria) : triangulation(triangulation),
> dof_handler(*tria){}
>
> void run(){
> typename DoFHandler::active_cell_iterator cell;
>
> for (cell = dof_handler.begin_active(); cell != dof_handler.end();
> ++cell){
> std::vector::active_cell_iterator>
> neighbors;
> GridTools::get_active_neighbors(cell, neighbors);
> }
> }
> private:
> Triangulation* triangulation;
> DoFHandler dof_handler;
> };
>
> int main(){
> Triangulation<2> triangulation;
> GridGenerator::hyper_cube(triangulation, -1, 1);
> Test<2> test(&triangulation);
> test.run();
> }
>
> I think somehow the compiler cannot resolve the generic type
> MeshType::active_cell_iterator into the specific one
> DoFHandler::active_cell_iterator, although from what I understand in
> the documentation it should. Probably some template specification missing
> somewhere, but I can't find it.
>
> In my code I fixed it easily by copying the function directly to my own
> files and specifying appropriately, but I think it would be nice to report
> the bug.
>
> Cheers,
> Andreas
>
--
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see
https://groups.google.com/d/forum/dealii?hl=en
---
You received this message because you are subscribed to the Google Groups
"deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to dealii+unsubscr...@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/dealii/0a78a60f-89d1-4c6a-9ba3-724d7112c355%40googlegroups.com.