New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Triangulation: implement global_*_cell_index_partitioner() #14270
Triangulation: implement global_*_cell_index_partitioner() #14270
Conversation
include/deal.II/grid/tria.h
Outdated
@@ -1615,6 +1616,22 @@ class Triangulation : public Subscriptor | |||
virtual MPI_Comm | |||
get_communicator() const; | |||
|
|||
/** | |||
* Return partitioner for the global indices of the cells on the active |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know we have this text also in the derived class, but I believe we typically use the style
* Return partitioner for the global indices of the cells on the active | |
* Return the partitioner for the global indices of the cells on the active |
See also the documentation of the function set_mesh_smoothing
below. (On the other hand, the one immediately preceding this does not use the article, so I am a bit split.)
source/grid/tria.cc
Outdated
const std::weak_ptr<const Utilities::MPI::Partitioner> | ||
Triangulation<dim, spacedim>::global_active_cell_index_partitioner() const | ||
{ | ||
return std::make_shared<const Utilities::MPI::Partitioner>(n_active_cells()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess we never use this inside loops and rather only in basic circumstances? While the setup of an MPI_COMM_SELF
partitioner should be cheap, it is not that cheap that we would like to do it millions of times.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see how this can work - won't the object always get deleted immediately since weak_ptr
won't keep it alive? For example, if I do
#include <memory>
#include <iostream>
std::weak_ptr<int>
get_42()
{
return std::make_shared<int>(42);
}
int main()
{
auto v = get_42();
std::cout << "expired() = " << v.expired() << std::endl;
}
then the output is expired() = 1
.
97fe4dd
to
c8bc1b8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like this also now works in 1D - nice!
/rebuild |
... so that one does not have to cast the
Triangulation
object toparallel::TriangulationBase
.CellAccessor
has the necessary information independent of type of mesh.