Commit c6cf5b99 authored by Christoph Rettinger's avatar Christoph Rettinger
Browse files

Added missing calls to compute mesh face normals in mesa_pd convex polyhedron

parent 27988dd7
......@@ -79,6 +79,8 @@ bool isPointInsideCylindricalBoundary(const Vec3& point,
#ifdef WALBERLA_MESAPD_CONVEX_POLYHEDRON_AVAILABLE
bool isPointInsideConvexPolyhedronBF(const Vec3& point, const mesh::TriangleMesh& mesh)
{
WALBERLA_ASSERT(mesh.has_face_normals(), "Provided mesh has no face normals! E.g., call `mesh.request_face_normals(); mesh.update_face_normals();` to add them.")
return std::none_of(mesh.faces().begin(),
mesh.faces().end(),
[&](auto fh)
......
......@@ -130,6 +130,9 @@ inline void ConvexPolyhedron::updateMassAndInertia(const real_t density) {
inline void ConvexPolyhedron::updateMeshQuantities() {
WALBERLA_CHECK_GREATER(mesh_.n_vertices(), 0, "Cannot compute mesh quantities for an empty mesh!");
mesh_.request_face_normals();
mesh_.update_face_normals();
octandVertices_[0] = supportVertex(mesh::TriangleMesh::Normal(real_t(1), real_t(1), real_t(1)), *mesh_.vertices_begin());
octandVertices_[1] = supportVertex(mesh::TriangleMesh::Normal(real_t(1), real_t(1), real_t(-1)), *mesh_.vertices_begin());
octandVertices_[2] = supportVertex(mesh::TriangleMesh::Normal(real_t(1), real_t(-1), real_t(1)), *mesh_.vertices_begin());
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment