In addition to that, I’d suggest you use the GridTools::Cache::get_vertex_to_cell_map class, which builds the map once, and stores it for future reference. This one uses GridTools::vertex_to_cell_map, which builds the map with one pass, instead of looping over all cells.
Indeed, if you want to call this only for one vertex, your choice is better. But if you need this for several vertices, I’d build the map once, and then use the map all subsequent times. https://www.dealii.org/current/doxygen/deal.II/classGridTools_1_1Cache.html#a1e51292fbaeae9d7d3fcec2f9eb6a8dd Best, Luca. > On 4 May 2021, at 22:35, Wolfgang Bangerth <[email protected]> wrote: > > On 5/4/21 12:15 PM, Simon Wiesheier wrote: >> I looked up the Implementation of the mentioned function. Basically the >> function loops over all active cells and compares those global vertices with >> the one passed as second argument, so far so good. >> But is there a similar function which accepts a cell_iterator (the given >> vertex is located on that cell) so that inside the function body only the >> neigbor and the neighbor's neighbor are possible cells on which the given >> vertex can be located? >> So I'd like to tell the function where it should begin its "search", in >> order to avoid looping over all cells (worst case). >> There is a function which is doing this for a patch of neighbor_cells >> (element-patch), but I didn't find a function for the problem description >> from above. >> Is such a function not yet implemented or is there already one available? > > I don't think so, but it shouldn't be very hard to add an argument to the > function that by default is simply a default-constructed cell iterator > indicating "no initial guess given" but if not at its default value indicates > to start search on this cell and its neighbors. > > Best > W. > > -- > ------------------------------------------------------------------------ > Wolfgang Bangerth email: [email protected] > 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 [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/dealii/47cadef0-3287-db4f-27e4-a4923757374a%40colostate.edu. -- 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/EE1CEADB-D4D8-4E2F-8263-1F21416AF1AF%40gmail.com.
