fdrmrc / Polydeal

C++ implementation of Polygonal Discontinuous Galerkin method within the deal.II Finite Element library.
https://fdrmrc.github.io/Polydeal/
Other
0 stars 0 forks source link

Avoid unnecessary queries to n_faces() #45

Closed fdrmrc closed 1 year ago

fdrmrc commented 1 year ago

I was impressed by the large times we had during the assembly so I quickly profiled with Kcachegrind. Here's the call-graph with the current master:

n_faceswrong

The function n_faces() (the function which checks the number of faces for an agglomerate) was accidentally called multiple times during the neighbor_of_agglomerated_neighbor(). With this fix the number of calls to n_faces() is now equal to the number of calls to neighbor_of_agglomerated_neighbor (i.e. 780 in the next picture).

This also highlights other costly calls.

pr_n_faces

@luca-heltai

luca-heltai commented 1 year ago

The tests are not passing.

fdrmrc commented 1 year ago

The failure is related to the function that builds the agglomerated mesh through the Rtree. That one is not yet in the deal.II master. Let me revert the test for the time being, I'll write the missing functionality as an utility.

fdrmrc commented 1 year ago

Last commit exploits hash tables to store the slaves of each agglomeration. This is used intensively in get_slaves_of_idx(master_cell)