From d3f65d03c4c3b491235c999aa6d36baf419e7a2f Mon Sep 17 00:00:00 2001 From: Christian Godenschwager <christian.godenschwager@fau.de> Date: Wed, 10 Jan 2018 17:11:44 +0000 Subject: [PATCH] Fixed GCC 7 issues in mesh module --- src/mesh/DistanceComputations.h | 10 +++++++++- tests/mesh/NumericIntegrationTest.cpp | 9 +++++---- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/src/mesh/DistanceComputations.h b/src/mesh/DistanceComputations.h index c8ec8a769..6df23c078 100644 --- a/src/mesh/DistanceComputations.h +++ b/src/mesh/DistanceComputations.h @@ -42,6 +42,14 @@ struct DistanceProperties typedef typename MeshType::Scalar Scalar; typedef math::Matrix3<Scalar> Matrix; + // Dummy constructor to suppress GCC 7 warnings + DistanceProperties() : e0(real_t(0)), e1(real_t(0)), e2(real_t(0)), + e1_normal(real_t(0)), e2_normal(real_t(0)), + e1_normalized(real_t(0)), e2_normalized(real_t(0)), e0_normalized(real_t(0)), + e0l(real_t(0)), e1l(real_t(0)), e2l(real_t(0)), + translation(real_t(0)) + {} + Vec2 e0, e1, e2; Vec2 e1_normal, e2_normal; Vec2 e1_normalized, e2_normalized, e0_normalized; @@ -978,4 +986,4 @@ void TriangleDistance<MeshType>::filterTrianglesForAABB( const BoundingBox & aab } } // namespace mesh -} // namespace walberla \ No newline at end of file +} // namespace walberla diff --git a/tests/mesh/NumericIntegrationTest.cpp b/tests/mesh/NumericIntegrationTest.cpp index 8d8122172..7bbbc6f0b 100644 --- a/tests/mesh/NumericIntegrationTest.cpp +++ b/tests/mesh/NumericIntegrationTest.cpp @@ -93,9 +93,10 @@ Matrix3<real_t> inertiaTensorNumeric( const ContainmentT & body, const AABB & aa { if(body.contains( ContainmentT::toPoint( *it ) )) { - const real_t & x = (*it)[0]; - const real_t & y = (*it)[1]; - const real_t & z = (*it)[2]; + const Vector3<real_t> p = *it; + const real_t & x = p[0]; + const real_t & y = p[1]; + const real_t & z = p[2]; intertiaTensor[0] += y*y + z*z; intertiaTensor[1] += -x*y; @@ -193,4 +194,4 @@ int main( int argc, char * argv[] ) int main( int argc, char * argv[] ) { return walberla::mesh::main( argc, argv ); -} \ No newline at end of file +} -- GitLab