Dear deal.II users,

I'm currently developing a way to uniquely identify a boundary face on
a mesh. My idea has been to gather global DoF indices on a face and
hash them together. However, `get_dof_indices` method of a face
accessor doesn't return any useful information, and
`FESystem::max_dofs_per_face()`, surprisingly, returns 0. See the
attachment for a minimal example. The problem persists when running on
a single process. The version of deal.II used is 9.4.0.

What am I doing wrong here? Is there a better way to globally identify
a face?

Best regards,
Alexander Kiselyov

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/16b1745d436c72a1031cf5eb3ba903ce8a6c8a15.camel%40gmail.com.
#include <deal.II/base/mpi.h>

#include <deal.II/distributed/tria.h>

#include <deal.II/dofs/dof_handler.h>
#include <deal.II/dofs/dof_renumbering.h>

#include <deal.II/fe/fe_dgq.h>
#include <deal.II/fe/fe_system.h>

#include <deal.II/grid/grid_generator.h>

#include <mpi.h>
#include <iostream>
#include <vector>


constexpr int dim = 3;


struct BoundarySolverFixture
{
  BoundarySolverFixture()
    : comm(MPI_COMM_WORLD), tria(comm), dof_handler(tria)
    , fe_system(dealii::FE_DGQ<dim>(degree), 1, dealii::FESystem(dealii::FE_DGQ<dim>(degree), dim), 1)
  {
    dealii::GridGenerator::subdivided_hyper_cube(tria, cell_num, 0., 1.);
    dof_handler.distribute_dofs(fe_system);
    dealii::DoFRenumbering::block_wise(dof_handler);
  }

  static const auto cell_num = 5;
  static const auto degree = 1;

  MPI_Comm comm;
  dealii::parallel::distributed::Triangulation<dim> tria;
  dealii::DoFHandler<dim> dof_handler;
  dealii::FESystem<dim> fe_system;
};


int main(int argc, char** argv)
{
  dealii::Utilities::MPI::MPI_InitFinalize _mpi(argc, argv, 1);

  BoundarySolverFixture fixture;

  const auto max_dofs = fixture.fe_system.max_dofs_per_face();
  std::cout << "Max dofs: " << max_dofs << std::endl;
  for (const auto& cell : fixture.dof_handler.active_cell_iterators()) {
    if (!cell->is_locally_owned())
      continue;

    for (const auto& face : cell->face_iterators()) {
      if (!face->at_boundary())
        continue;

      std::vector<dealii::types::global_dof_index> dofs((max_dofs != 0) ? max_dofs : 4);
      face->get_dof_indices(dofs);
      std::cout << "DoF indices for this face: ";
      for (const auto d : dofs)
        std::cout << ' ' << d;
      std::cout << std::endl;
    }
  }

  return 0;
}

Reply via email to