Re: [deal.II] GridTools::find_cells_adjacent_to_vertex: how to avoid multiple calling ?

2021-05-05 Thread Simon Wiesheier
Thanks to both of you! The implementation of a own function was the best solution to my issue. In there I basically ask the neighbor-cells and again those neighbors if the given vertex is located on that cells. My function is a bit faster than your suggestion Luca, but not that much.

Re: [deal.II] GridTools::find_cells_adjacent_to_vertex: how to avoid multiple calling ?

2021-05-05 Thread luca.heltai
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

Re: [deal.II] GridTools::find_cells_adjacent_to_vertex: how to avoid multiple calling ?

2021-05-04 Thread Wolfgang Bangerth
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

Re: [deal.II] GridTools::find_cells_adjacent_to_vertex: how to avoid multiple calling ?

2021-05-04 Thread Simon Wiesheier
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

Re: [deal.II] GridTools::find_cells_adjacent_to_vertex: how to avoid multiple calling ?

2021-05-03 Thread luca.heltai
Dear Simon, one solution you have is to pass a *Triangulation*, and then generate the dof cell accessors using the constructor typename DoFHandler::cell_iterator cell1(*tria_iterator, dh1); typename DoFHandler::cell_iterator cell2(*tria_iterator, dh2); Best, Luca. > On 30 Apr 2021, at

Re: [deal.II] GridTools::find_cells_adjacent_to_vertex: how to avoid multiple calling ?

2021-05-02 Thread Simon Wiesheier
Hi Jean-Paul, your suggestion worked fine, thanks a lot! Best Simon Am Sa., 1. Mai 2021 um 07:20 Uhr schrieb Jean-Paul Pelteret < jppelte...@gmail.com>: > Hi Simon, > > You could call GridTools:: find_cells_adjacent_to_vertex() with the > triangulation instead of a DoFHandler, and then just

Re: [deal.II] GridTools::find_cells_adjacent_to_vertex: how to avoid multiple calling ?

2021-04-30 Thread Jean-Paul Pelteret
Hi Simon, You could call GridTools:: find_cells_adjacent_to_vertex() with the triangulation instead of a DoFHandler, and then just convert the returned iterators to the type used by each DoFHandler using the method outlined here:

Re: [deal.II] GridTools::find_cells_adjacent_to_vertex: how to avoid multiple calling ?

2021-04-30 Thread Simon Wiesheier
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

Re: [deal.II] GridTools::find_cells_adjacent_to_vertex: how to avoid multiple calling ?

2021-04-30 Thread Wolfgang Bangerth
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

[deal.II] GridTools::find_cells_adjacent_to_vertex: how to avoid multiple calling ?

2021-04-30 Thread Simon
Dear all, the mentioned function is exactly doing the right thing for me, i.e. returning an vector of iterators to all cells, which share this vertex. After calling this function I will loop over these cells and compute certain things ... My problem is that I have to work with two different