Skip to content

Commit

Permalink
Above 6 edges it is not a face, it is an island (#228 | GRIDEDIT-650)
Browse files Browse the repository at this point in the history
  • Loading branch information
lucacarniato authored Sep 25, 2023
1 parent 68de608 commit 95642bd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
4 changes: 2 additions & 2 deletions libs/MeshKernel/include/MeshKernel/Mesh.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 5 additions & 4 deletions libs/MeshKernel/src/Smoother.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 95642bd

Please sign in to comment.