On 3/19/19 4:17 AM, luca.heltai wrote: > what would you think of a function in GridTools like > > GridTools::propagate_internal_manifold_ids(tria, disambiguation_function) > > that would loop over all cells, loop over all faces, check if the neighbor > manifold id is the same of this cell, and > i) the two ids are the same: assign the same id to the face (calling > cell->face(f)->set_all_manifold_ids()) > ii) the two ids are different: set the id of the face to the return value of > the disambiguation_function(id1, id2) > > disambiguation_function could be of type > > std::function<types::manifold_id(const manifold_id &id1, const manifold_id > &id2)> > > and its default implementation could be > > std::function<types::manifold_id(const manifold_id &id1, const manifold_id > &id2)> = [](const manifold_id &id1, const manifold_id &id2){return > std::min(id1, id2);}
You'd have to do the same for edges in 3d, where the situation is more difficult because there may be an arbitrary number of adjacent cells. So maybe the function should take a std::set<manifold_id>? I think that the min of ids is a rather arbitrary choice. Why not just return invalid_manifold_id if the two ids are different? (Which could then be interpreted as not setting anything for that face/edge -- or maybe that's what should be set, I don't know.) Best W. -- ------------------------------------------------------------------------ Wolfgang Bangerth email: bange...@colostate.edu www: http://www.math.colostate.edu/~bangerth/ -- 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. For more options, visit https://groups.google.com/d/optout.