13 #ifndef __deal2__mesh_worker_loop_h
14 #define __deal2__mesh_worker_loop_h
29 template <
class Accessor>
55 template<
class ITERATOR,
class ENDITERATOR,
class CELLINFO,
class FACEINFO,
class LOCALWORKER>
56 void loop(ITERATOR begin, ENDITERATOR end,
57 CELLINFO& cellinfo, FACEINFO& bdryinfo,
58 FACEINFO& faceinfo, FACEINFO& subfaceinfo, FACEINFO& ngbrinfo,
59 LOCALWORKER& localworker,
60 bool cells_first =
true)
63 begin->get_triangulation()).clear_user_flags();
66 for (ITERATOR cell = begin; cell != end; ++cell)
73 cellinfo.reinit(cell);
74 localworker.cell(cellinfo);
78 if (localworker.interior_fluxes || localworker.boundary_fluxes)
79 for (
unsigned int face_no=0; face_no < GeometryInfo<ITERATOR::AccessorType::Container::dimension>::faces_per_cell; ++face_no)
81 typename ITERATOR::AccessorType::Container::face_iterator face = cell->face(face_no);
83 if (face->user_flag_set ())
continue;
85 if (cell->at_boundary(face_no))
87 if (localworker.boundary_fluxes)
89 bdryinfo.reinit(cell, face, face_no);
90 localworker.bdry(bdryinfo);
93 else if (localworker.interior_fluxes)
95 if (face->user_flag_set ())
continue;
96 face->set_user_flag ();
98 typename ITERATOR::AccessorType::Container::cell_iterator
99 neighbor = cell->neighbor(face_no);
111 if (neighbor->level() < cell->level())
113 Assert(!cell->has_children(), ExcInternalError());
114 Assert(!neighbor->has_children(), ExcInternalError());
116 std::pair<unsigned int, unsigned int> neighbor_face_no
117 = cell->neighbor_of_coarser_neighbor(face_no);
118 typename ITERATOR::AccessorType::Container::face_iterator nface
119 = neighbor->face(neighbor_face_no.first);
120 faceinfo.reinit(cell, face, face_no);
121 subfaceinfo.reinit(neighbor, nface, neighbor_face_no.first, neighbor_face_no.second);
126 localworker.face(faceinfo, subfaceinfo);
143 unsigned int neighbor_face_no = cell->neighbor_of_neighbor(face_no);
144 Assert (neighbor->face(neighbor_face_no) == face, ExcInternalError());
146 faceinfo.reinit(cell, face, face_no);
147 ngbrinfo.reinit(neighbor, neighbor->face(neighbor_face_no),
150 localworker.face(faceinfo, ngbrinfo);
151 neighbor->face(neighbor_face_no)->set_user_flag ();
160 cellinfo.reinit(cell);
161 localworker.cell(cellinfo);
171 template<
int dim,
class ITERATOR,
class ENDITERATOR,
class LOCALWORKER>
174 LOCALWORKER& localworker,
175 bool cells_first =
true)
179 localworker, cells_first);