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 <deal.II/grid/tria.h>
#include <deal.II/dofs/dof_handler.h>
#include <deal.II/grid/grid_generator.h>
#include <deal.II/grid/grid_tools.h>
using namespace dealii;
template<int dim>
class Test{
public:
Test(Triangulation<dim> *tria) : triangulation(triangulation), dof_handler(*tria){}
void run(){
typename DoFHandler<dim>::active_cell_iterator cell;
for (cell = dof_handler.begin_active(); cell != dof_handler.end(); ++cell){
std::vector<typename DoFHandler<dim>::active_cell_iterator> neighbors;
GridTools::get_active_neighbors(cell, neighbors);
}
}
private:
Triangulation<dim>* triangulation;
DoFHandler<dim> 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<dim>::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.