@@ -96,14 +96,12 @@ inline bool TearingEngine<DataTypes>::computeIntersectionNeighborTriangle(Coord
9696template <class DataTypes >
9797inline bool TearingEngine<DataTypes>::computeEndPointsNeighboringTriangles(Coord Pa, Coord direction, Coord& Pb, Coord& Pc)
9898{
99-
10099 bool t_b_ok = false ;
101100 bool t_c_ok = false ;
102101 // compute fracture direction perpendicular to the principal stress direction
103102 Coord fractureDirection;
104103 this ->computeFractureDirection (direction, fractureDirection);
105104
106-
107105 Real norm_fractureDirection = fractureDirection.norm ();
108106 Coord dir_b = 1.0 / norm_fractureDirection * fractureDirection;
109107
@@ -151,12 +149,6 @@ void TearingEngine<DataTypes>::algoFracturePath()
151149 Coord Pb;
152150 Coord Pc;
153151
154- if (this ->d_fractureMaxLength .getValue ())
155- this ->computeEndPoints (Pa, principalStressDirection, Pb, Pc);
156- else if (!(computeEndPointsNeighboringTriangles (Pa, principalStressDirection, Pb, Pc)))
157- return ;
158-
159-
160152 this ->m_tearingAlgo ->algoFracturePath (Pa, indexA, Pb, Pc, m_maxStressTriangleIndex, principalStressDirection, d_input_positions.getValue ());
161153 m_maxStressTriangleIndex = InvalidID;
162154
@@ -168,7 +160,7 @@ void TearingEngine<DataTypes>::algoFracturePath()
168160template <class DataTypes >
169161void TearingEngine<DataTypes>::computeFracturePath()
170162{
171- if (! this -> d_fractureMaxLength . getValue () && m_maxStressTriangleIndex != InvalidID)
163+ if (m_maxStressTriangleIndex != InvalidID)
172164 {
173165 // Recording the endpoints of the fracture segment
174166 helper::ReadAccessor< Data<VecCoord> > x (d_input_positions);
@@ -179,11 +171,20 @@ void TearingEngine<DataTypes>::computeFracturePath()
179171 Coord Pb, Pc;
180172 fractureSegmentEndpoints.clear ();
181173
182- if (computeEndPointsNeighboringTriangles (Pa, principalStressDirection, Pb, Pc))
174+ if (this ->d_fractureMaxLength .getValue () == 0.0 ) {
175+ computeEndPointsNeighboringTriangles (Pa, principalStressDirection, Pb, Pc);
176+ }
177+ else
183178 {
184- fractureSegmentEndpoints.push_back (Pb);
185- fractureSegmentEndpoints.push_back (Pc);
179+ this ->computeEndPoints (Pa, principalStressDirection, Pb, Pc);
186180 }
181+
182+ fractureSegmentEndpoints.push_back (Pb);
183+ fractureSegmentEndpoints.push_back (Pc);
184+
185+ this ->m_stepCounter ++;
186+
187+ // this->m_tearingAlgo->computeFracturePath(Pa, m_maxStressTriangleIndex, Pb, Pc);
187188 }
188189}
189190
0 commit comments