On 11/27/23 14:52, Lance Zhang wrote:

May I know how to find the neighbor of a cell?

Here is one part of my code:
----------------------------------------------------------------------------------------------------------------------
for (const auto &cell : solid_3d.get_dof_handler().active_cell_iterators()
{
     const unsigned int cell_index = cell->active_cell_index();

     // Loop over all degrees of freedom on the current cell
     for (unsigned int i = 0; i < dofs_per_cell.dofs_per_cell; ++i)
     {
         // Loop over all neighboring cells
         for (const auto &neighbor : Find_neighbors?)){

You can write this as
  for (unsigned int f=0; f<cell->n_faces(); ++f)
  {
    DoFHandler::cell_iterator neighbor = cell->neighbor(f);
    ...
  }

Best
 W.

--
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/ef1fdaad-0bde-4478-8054-74df1a572c5f%40colostate.edu.

Reply via email to