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
Fix GridGenerator::merge_triangulations() for simplex meshes #12979
Conversation
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'm traveling today so I might not be around to approve this later. This is fine but it would be better if we avoided the double negative.
source/grid/grid_generator.cc
Outdated
if (std::find_if(cells.begin(), cells.end(), [](const auto &cell) { | ||
return cell.vertices.size() != | ||
ReferenceCells::get_hypercube<dim>().n_vertices(); | ||
}) == cells.end()) | ||
GridTools::consistently_order_cells(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.
if (std::find_if(cells.begin(), cells.end(), [](const auto &cell) { | |
return cell.vertices.size() != | |
ReferenceCells::get_hypercube<dim>().n_vertices(); | |
}) == cells.end()) | |
GridTools::consistently_order_cells(cells); | |
if (std::all_of(cells.begin(), cells.end(), [](const auto &cell) { | |
return cell.vertices.size() == | |
ReferenceCells::get_hypercube<dim>().n_vertices(); | |
})) | |
GridTools::consistently_order_cells(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 think the condition really rather is that there is something to be done if any of the cells reference is a (generalized) hex, isn't it? Shouldn't it be
if (std::find_if(cells.begin(), cells.end(), [](const auto &cell) { | |
return cell.vertices.size() != | |
ReferenceCells::get_hypercube<dim>().n_vertices(); | |
}) == cells.end()) | |
GridTools::consistently_order_cells(cells); | |
if (std::any_of(cells.begin(), cells.end(), [](const auto &cell) { | |
return cell.vertices.size() == | |
ReferenceCells::get_hypercube<dim>().n_vertices(); | |
}) == cells.end()) | |
GridTools::consistently_order_cells(cells); |
then?
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.
The right logic is all_of
. GridTools::consistently_order_cells
only works if all cells are hypercubes. In all other cases, we store the orientation of faces/edges anyway. I have made the modification. It ready from my side!
ec0e461
to
7a17b27
Compare
/rebuild |
No description provided.