diff --git a/GeoLib/AnalyticalGeometry-impl.h b/GeoLib/AnalyticalGeometry-impl.h index a1f3dc7cae2c32316fc1df403ae02c67508b0a81..6ad53498b1970e563c9f03d3e8bf78b1f5b33ad2 100644 --- a/GeoLib/AnalyticalGeometry-impl.h +++ b/GeoLib/AnalyticalGeometry-impl.h @@ -27,7 +27,7 @@ void getNewellPlane (InputIterator pnts_begin, InputIterator pnts_end, plane_normal[2] += (pt_i[0] - pt_j[0]) * (pt_i[1] + pt_j[1]); // projection on xy - centroid += pt_j; + centroid += MathLib::Vector3(pt_j); } plane_normal.normalize(); @@ -48,7 +48,8 @@ void getNewellPlane (const std::vector<T_POINT*>& pnts, } template <class T_POINT> -std::pair<MathLib::Vector3, double> getNewellPlane (const std::vector<T_POINT>& pnts) +std::pair<MathLib::Vector3, double> getNewellPlane( + const std::vector<T_POINT>& pnts) { MathLib::Vector3 plane_normal; MathLib::Vector3 centroid; @@ -61,7 +62,7 @@ std::pair<MathLib::Vector3, double> getNewellPlane (const std::vector<T_POINT>& plane_normal[2] += (pnts[i][0] - pnts[j][0]) * (pnts[i][1] + pnts[j][1]); // projection on xy - centroid += pnts[j]; + centroid += MathLib::Vector3(pnts[j]); } plane_normal.normalize(); diff --git a/GeoLib/MinimalBoundingSphere.cpp b/GeoLib/MinimalBoundingSphere.cpp index 0fd40c5b188de171a4bbcd62e0c540a08a96393d..b29448a77d2513b564dad0a02a35bfeb20aad06d 100644 --- a/GeoLib/MinimalBoundingSphere.cpp +++ b/GeoLib/MinimalBoundingSphere.cpp @@ -72,7 +72,7 @@ MinimalBoundingSphere::MinimalBoundingSphere(MathLib::Point3d const& p, two_pnts_sphere = MinimalBoundingSphere(p, q); } _radius = two_pnts_sphere.getRadius(); - _center = two_pnts_sphere.getCenter(); + _center = MathLib::Vector3(two_pnts_sphere.getCenter()); } } @@ -103,21 +103,21 @@ MinimalBoundingSphere::MinimalBoundingSphere(MathLib::Point3d const& p, MinimalBoundingSphere const prs(p, r , s); MinimalBoundingSphere const qrs(q, r , s); _radius = pqr.getRadius(); - _center = pqr.getCenter(); + _center = MathLib::Vector3(pqr.getCenter()); if (_radius < pqs.getRadius()) { _radius = pqs.getRadius(); - _center = pqs.getCenter(); + _center = MathLib::Vector3(pqs.getCenter()); } if (_radius < prs.getRadius()) { _radius = prs.getRadius(); - _center = prs.getCenter(); + _center = MathLib::Vector3(prs.getCenter()); } if (_radius < qrs.getRadius()) { _radius = qrs.getRadius(); - _center = qrs.getCenter(); + _center = MathLib::Vector3(qrs.getCenter()); } } } @@ -128,7 +128,7 @@ MinimalBoundingSphere::MinimalBoundingSphere( { const std::vector<MathLib::Point3d*>& sphere_points(points); MinimalBoundingSphere const bounding_sphere = recurseCalculation(sphere_points, 0, sphere_points.size(), 0); - _center = bounding_sphere.getCenter(); + _center = MathLib::Vector3(bounding_sphere.getCenter()); _radius = bounding_sphere.getRadius(); } diff --git a/MathLib/Vector3.h b/MathLib/Vector3.h index 575ef025bb0900c64c16f99142064083f5845c0e..004304a8c3dbb4506ee4b716d24d59cb218592fa 100644 --- a/MathLib/Vector3.h +++ b/MathLib/Vector3.h @@ -52,7 +52,7 @@ public: /** * Construct Vector3 from TemplatePoint. */ - TemplateVector3(TemplatePoint<T,3> const& p) : + explicit TemplateVector3(TemplatePoint<T,3> const& p) : TemplatePoint<T>(p) {} diff --git a/MeshGeoToolsLib/GeoMapper.cpp b/MeshGeoToolsLib/GeoMapper.cpp index 57809f0367a0bcb59ab16f3fade7fb49c549635e..971eda9f1b30e055b4be06c104c75b6b00415aa8 100644 --- a/MeshGeoToolsLib/GeoMapper.cpp +++ b/MeshGeoToolsLib/GeoMapper.cpp @@ -420,7 +420,7 @@ static void mapPointOnSurfaceElement(MeshLib::Element const& elem, MathLib::Point3d& q) { // create plane equation: n*p = d - MathLib::Vector3 const& p(*(elem.getNode(0))); + MathLib::Vector3 const p(*(elem.getNode(0))); MathLib::Vector3 const n(MeshLib::FaceRule::getSurfaceNormal(&elem)); if (n[2] == 0.0) { // vertical plane, z coordinate is arbitrary q[2] = p[2]; diff --git a/MeshLib/MeshEditing/ProjectPointOnMesh.cpp b/MeshLib/MeshEditing/ProjectPointOnMesh.cpp index b1ab4f265b3aedc31719d2ecf7750f101b1e2703..0453a133d432bf5afb76984faf51614b2b03d29c 100644 --- a/MeshLib/MeshEditing/ProjectPointOnMesh.cpp +++ b/MeshLib/MeshEditing/ProjectPointOnMesh.cpp @@ -61,7 +61,8 @@ MeshLib::Element const* getProjectedElement( double getElevation(MeshLib::Element const& element, MeshLib::Node const& node) { - MathLib::Vector3 const v = node - *element.getNode(0); + MathLib::Vector3 const v = + MathLib::Vector3(node) - MathLib::Vector3(*element.getNode(0)); MathLib::Vector3 const n = MeshLib::FaceRule::getSurfaceNormal(&element).getNormalizedVector(); return node[2] - scalarProduct(n, v) * n[2]; diff --git a/ProcessLib/BoundaryCondition/NormalTractionBoundaryConditionLocalAssembler.h b/ProcessLib/BoundaryCondition/NormalTractionBoundaryConditionLocalAssembler.h index 76bec33b3d05eb2127e63772935160e95f747c28..8ed02b06f0136add80ca7754fc72319a1efd691f 100644 --- a/ProcessLib/BoundaryCondition/NormalTractionBoundaryConditionLocalAssembler.h +++ b/ProcessLib/BoundaryCondition/NormalTractionBoundaryConditionLocalAssembler.h @@ -86,7 +86,8 @@ public: // TODO Extend to rotated 2d meshes and line elements. if (e.getGeomType() == MeshLib::MeshElemType::LINE) { - auto v1 = (*e.getNode(1)) - (*e.getNode(0)); + auto v1 = MathLib::Vector3(*e.getNode(1)) - + MathLib::Vector3(*e.getNode(0)); element_normal[0] = -v1[1]; element_normal[1] = v1[0]; element_normal.normalize(); diff --git a/ProcessLib/LIE/Common/Utils.cpp b/ProcessLib/LIE/Common/Utils.cpp index 3866fb50c94981f6f408dbfb49bb62e238e86d3c..d6c52f604c17737b6f1ed29933118ff9fc7d6053 100644 --- a/ProcessLib/LIE/Common/Utils.cpp +++ b/ProcessLib/LIE/Common/Utils.cpp @@ -21,7 +21,8 @@ void computeNormalVector(MeshLib::Element const& e, unsigned const global_dim, if (global_dim == 2) { assert(e.getGeomType() == MeshLib::MeshElemType::LINE); - auto v1 = (*e.getNode(1)) - (*e.getNode(0)); + auto v1 = + MathLib::Vector3(*e.getNode(1)) - MathLib::Vector3(*e.getNode(0)); element_normal[0] = -v1[1]; element_normal[1] = v1[0]; element_normal[2] = 0; // not used in 2d but needed for normalization