From 3514329ac639d97bf9a7730e6fb69128f224b3c1 Mon Sep 17 00:00:00 2001 From: yangw Date: Wed, 20 Nov 2024 13:29:45 +0800 Subject: [PATCH] [src]Add input Parameter Validation Check. [src]Modify the starting point of the fracture path to startVertexId. --- src/Tearing/TearingScenarioEngine.inl | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Tearing/TearingScenarioEngine.inl b/src/Tearing/TearingScenarioEngine.inl index 18fce34..4e157cc 100644 --- a/src/Tearing/TearingScenarioEngine.inl +++ b/src/Tearing/TearingScenarioEngine.inl @@ -116,7 +116,7 @@ void TearingScenarioEngine::computeEndPoints( Real norm_dir = dir.norm(); Pb = Pa + alpha/norm_dir * dir; - Pc = Pa - alpha /norm_dir * dir; + Pc = Pa;// -alpha / norm_dir * dir; } template @@ -129,6 +129,12 @@ void TearingScenarioEngine::algoFracturePath() helper::ReadAccessor< Data > x(this->d_input_positions); m_Pa = x[indexA]; + if (indexA < 0 || indexA >= x.size()) + { + msg_error() << "Invalid Input: startVertexId."; + return; + } + //Coord Pb, Pc; computeEndPoints(m_Pa, dir, m_Pb, m_Pc);