30 #include <MeshKernel/AveragingInterpolation.hpp>
31 #include <MeshKernel/Parameters.hpp>
32 #include <MeshKernel/Polygons.hpp>
33 #include <MeshKernel/Utilities/RTreeBase.hpp>
77 enum class FaceLocation
98 std::unique_ptr<MeshInterpolation> interpolant,
107 std::unique_ptr<MeshInterpolation> interpolant,
109 bool useNodalRefinement);
132 [[nodiscard]] std::unique_ptr<UndoAction>
Compute();
136 void FindBrotherEdges();
140 void ComputeNodeMaskAtPolygonPerimeter();
143 void ComputeRefinementMasksFromSamples();
146 void ComputeRefinementMaskFromEdgeSize();
149 void ComputeRefinementMasksForRefinementLevels(
UInt face,
150 size_t& numberOfEdgesToRefine,
151 std::vector<UInt>& edgeToRefine)
const;
154 void ComputeRefinementMasksForWaveCourant(
UInt face,
155 size_t& numberOfEdgesToRefine,
156 std::vector<UInt>& edgeToRefine);
159 void ComputeRefinementMasksForRidgeDetection(
UInt face,
160 size_t& numberOfEdgesToRefine,
161 std::vector<UInt>& edgeToRefine)
const;
166 void ComputeRefinementMasksFromSamples(
UInt face);
169 void ComputeEdgesRefinementMask();
173 void FindHangingNodes(
UInt face);
177 UInt CountHangingNodes()
const;
181 UInt CountHangingEdges()
const;
186 UInt CountEdgesToRefine(
UInt face)
const;
189 [[nodiscard]]
UInt DeleteIsolatedHangingnodes();
195 std::unique_ptr<meshkernel::UndoAction> ConnectHangingNodes();
198 void SmoothRefinementMasks();
201 void ComputeIfFaceShouldBeSplit();
204 std::unique_ptr<meshkernel::UndoAction> RefineFacesBySplittingEdges();
210 bool IsEdgeToBeRefinedBasedFaceLocationTypeAndCourantCriteria(
UInt edge, FaceLocation faceLocationType)
const;
216 bool IsRefineNeededBasedOnCourantCriteria(
UInt edge,
double depthValues)
const;
219 void ComputeFaceLocationTypes();
222 void ComputeEdgeBelowMinSizeAfterRefinement();
224 std::unique_ptr<RTreeBase> m_samplesRTree;
226 std::vector<int> m_faceMask;
227 std::vector<int> m_edgeMask;
228 std::vector<bool> m_isEdgeBelowMinSizeAfterRefinement;
229 std::vector<int> m_nodeMask;
230 std::vector<UInt> m_brotherEdges;
233 std::vector<bool> m_isHangingNodeCache;
234 std::vector<bool> m_isHangingEdgeCache;
235 std::vector<Point> m_polygonNodesCache;
236 std::vector<UInt> m_localNodeIndicesCache;
237 std::vector<UInt> m_globalEdgeIndicesCache;
238 std::vector<UInt> m_refineEdgeCache;
239 std::vector<FaceLocation> m_faceLocationType;
242 bool m_directionalRefinement =
false;
245 std::unique_ptr<MeshInterpolation> m_interpolant;
248 bool m_useNodalRefinement =
false;
249 const double m_mergingDistance = 0.001;
250 bool m_isRefinementBasedOnSamples =
false;