diff --git a/libs/MeshKernel/include/MeshKernel/Mesh.hpp b/libs/MeshKernel/include/MeshKernel/Mesh.hpp index 8853e8df7..a9ddfc433 100644 --- a/libs/MeshKernel/include/MeshKernel/Mesh.hpp +++ b/libs/MeshKernel/include/MeshKernel/Mesh.hpp @@ -356,9 +356,9 @@ namespace meshkernel BoundingBox m_boundingBoxCache; ///< Caches the last bounding box used for selecting the locations // constants - static constexpr UInt m_maximumNumberOfEdgesPerNode = 12; ///< Maximum number of edges per node + static constexpr UInt m_maximumNumberOfEdgesPerNode = 16; ///< Maximum number of edges per node static constexpr UInt m_maximumNumberOfEdgesPerFace = 6; ///< Maximum number of edges per face - static constexpr UInt m_maximumNumberOfNodesPerFace = 8; ///< Maximum number of nodes per face + static constexpr UInt m_maximumNumberOfNodesPerFace = 6; ///< Maximum number of nodes per face static constexpr UInt m_maximumNumberOfConnectedNodes = m_maximumNumberOfEdgesPerNode * 4; ///< Maximum number of connected nodes static constexpr UInt m_numNodesQuads = 4; ///< Number of nodes in a quadrilateral static constexpr UInt m_numNodesInTriangle = 3; ///< Number of nodes in a triangle diff --git a/libs/MeshKernel/src/Smoother.cpp b/libs/MeshKernel/src/Smoother.cpp index 0a0173cc6..208ccba41 100644 --- a/libs/MeshKernel/src/Smoother.cpp +++ b/libs/MeshKernel/src/Smoother.cpp @@ -315,15 +315,16 @@ void Smoother::ComputeOperatorsNode(UInt currentNode) for (UInt f = 0; f < m_topologySharedFaces[currentTopology].size(); f++) { - auto edgeIndex = m_mesh->m_nodesEdges[currentNode][f]; - auto otherNode = OtherNodeOfEdge(m_mesh->m_edges[edgeIndex], currentNode); + const auto edgeIndex = m_mesh->m_nodesEdges[currentNode][f]; + const auto otherNode = OtherNodeOfEdge(m_mesh->m_edges[edgeIndex], currentNode); - auto leftFace = m_mesh->m_edgesFaces[edgeIndex][0]; + const auto leftFace = m_mesh->m_edgesFaces[edgeIndex][0]; faceLeftIndex = FindIndex(m_topologySharedFaces[currentTopology], leftFace); if (m_topologySharedFaces[currentTopology][faceLeftIndex] != leftFace) { - throw std::invalid_argument("Smoother::ComputeOperatorsNode: Face could not be found, this happens when the face is outside of the polygon."); + throw std::invalid_argument(std::string("Smoother::ComputeOperatorsNode: Face could not be found,") + + std::string("this happens when the face is outside of the polygon or maximumNumberOfEdgesPerFace is too low")); } // by construction