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
Make CellData::vertices to std::vector #10429
Conversation
const bool arbitray_mesh_provided = | ||
std::any_of(cells.begin(), cells.end(), [](const auto &cell) { | ||
return cell.vertices.size() != GeometryInfo<dim>::vertices_per_cell; | ||
}); | ||
|
||
if (arbitray_mesh_provided == false) | ||
{ | ||
internal::TriangulationImplementation::Implementation:: | ||
create_triangulation(v, cells, subcelldata, *this); | ||
} |
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.
This is the place where it is checked if a hex-only mesh has been provided.
/rebuild |
source/grid/tria.cc
Outdated
triangulation.vertices, | ||
reinterpret_cast<const unsigned int( | ||
&)[GeometryInfo<1>::vertices_per_cell]>( | ||
cells[cell_no].vertices.front())); |
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.
Let's not do this. Just copy the vertices into an array of the right size, or introduce an overload of GridTools::cell_measure
.
Same in the other places.
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.
For example, you could introduce an overload that takes an ArrayView
as argument. (Or replace the existing function -- that should work in the best of all cases without further changes.)
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 went with copying the values into a temporal array.
else | ||
{ | ||
Assert( | ||
false, |
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 it would be easier to read if you did
AssertThrow (std::any_of (...) == false, ExcMessage(...));
This way you don't need to create the variable.
It should be AssertThrow
so that things read from input files are also captured.
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 would like to keep it this way. In a follow-up PR, I might save the bool locally and in the else statement I might replace the Assert(Throw)
.
35335c4
to
deb9ed5
Compare
deb9ed5
to
7bdbc81
Compare
No description provided.