Thanks for all answers! I've got a similar question:
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? Best Simon luca.heltai <[email protected]> schrieb am Mo., 3. Mai 2021, 09:47: > Dear Simon, > > one solution you have is to pass a *Triangulation*, and then generate the > dof cell accessors using the constructor > > typename DoFHandler<dim>::cell_iterator cell1(*tria_iterator, dh1); > typename DoFHandler<dim>::cell_iterator cell2(*tria_iterator, dh2); > > > Best, > Luca. > > > On 30 Apr 2021, at 18:37, Simon Wiesheier <[email protected]> > wrote: > > > > Hello Wolfgang, > > > > I actually have a Time Measurement in my code implemented. > > For my current computations the difference (one call vs two calls per > vertex) is neglible. But my model will become much bigger and therefore I'd > like to avoid unnecessary calls to that function. > > > > Since I can pass only one dof_handler to that function, I guess there is > no "obvious" way to make only one call, is it? > > > > -Simon > > > > Wolfgang Bangerth <[email protected]> schrieb am Fr., 30. Apr. > 2021, 18:16: > > On 4/30/21 10:13 AM, Simon wrote: > > > > > > auto cells_ref = > GridTools::find_cells_adjacent_to_vertex(dof_handler_ref, > > > /*vertex*/); > > > auto cells_tmp = > GridTools::find_cells_adjacent_to_vertex(dof_handler_tmp, > > > /*vertex*/); > > > > > > I am not sure how "expensive" this function actually is. I have to > call this > > > function for all vertices of my triangulation, so currently I call it > > > "2*n_vertices()" times. > > > > > > I´d like to call this function only once for a given vertex, i.e. > > > "n_vertices()"times. > > > Is there a way to realize this in combination with two different > dof_handlers? > > > > There are probably ways to work around this, but I'd like to repeat a > point > > Bruno made the other day on this very mailing list: > > > > "Unless you have measured that this is a bottleneck in you code, you > should > > use what's the more readable. If there is a difference between these two > > codes, it would need to be in a hot loop to matter. My advice is to > write easy > > to understand code and once you have made sure that the code works, then > use a > > profiler to find the bottleneck and optimize the code." > > > > I think this is good advice! > > > > 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/966f38ec-5ce2-f879-c9c4-2df21ab1110b%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/CAM50jEtCWSTAhzEi7uPmgvkC94DMGJnP43AAhOuJw_97KCVT7g%40mail.gmail.com > . > > -- > 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/361A39F3-3974-4B3E-B467-369FDC5902BE%40gmail.com > . > -- 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/CAM50jEvkd6mUwULLHGfS%3DwvSAtUtfACW5bO%3D0DZRQKch6PQXvw%40mail.gmail.com.
