Skip to content
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

Merged
merged 1 commit into from Jun 1, 2020

Conversation

peterrum
Copy link
Member

@peterrum peterrum commented May 31, 2020

No description provided.

Comment on lines +10503 to +10525
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);
}
Copy link
Member Author

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.

@peterrum
Copy link
Member Author

/rebuild

triangulation.vertices,
reinterpret_cast<const unsigned int(
&)[GeometryInfo<1>::vertices_per_cell]>(
cells[cell_no].vertices.front()));
Copy link
Member

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.

Copy link
Member

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.)

Copy link
Member Author

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,
Copy link
Member

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.

Copy link
Member Author

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).

@bangerth bangerth merged commit 230523e into dealii:master Jun 1, 2020
Triangulation generalizations automation moved this from In progress to Done Jun 1, 2020
@peterrum peterrum mentioned this pull request Jun 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

None yet

2 participants