Page 317 - The Combined Finite-Discrete Element Method
P. 317
300 ALGORITHM IMPLEMENTATION
.............continued from previous listing..............
else if(niners==nspoin) /* polygon inside triangle */
{ nbpoin=nspoin;
for(i=0;i<nbpoin;i++)
{ ub[i]=us[i]; vb[i]=vs[i];
}}
else /* intersection points polygon triangle */
{ nbpoin=0;
for(i=0;i<nspoin;i++)
{ if(inners[i]==3)
{ ub[nbpoin]=us[i]; vb[nbpoin]=vs[i]; nbpoin++;
}}
for(i=0;i<3;i++) /* grab inner C-points */
{ if(innerc[i]==nspoin)
{ ub[nbpoin]=uc[i]; vb[nbpoin]=vc[i]; nbpoin++;
}}
.............. continued in the next listing...........
Listing 10.14 Calculation of B-points when an S-polygon is inside a C-triangle.
S 3
C 3
B 5
B 1
C 1 B 4
B 2
S 2
S 1 B 3 C 2
Figure 10.2 Intersection of the target sub-tetrahedron with the base of the contactor
sub-tetrahedron.
C-points also form a triangle. The intersection between these two triangles is a set of
points called B-points. B-points form a convex polygon called a B-polygon. As shown
in Listing 10.15, first the intersection between the edges of the B-polygon and C-triangle
are found, i.e. B-points. These points do not necessarily form a polygon, thus they are
put into a sequence (sorted) as shown in Figure 10.2.
Once the coordinates of B-points are known, penetration (i.e. contact overlap at B-
points) is calculated as shown in Listing 10.16. From penetration, the contact force
potential at the B-points is evaluated.
The result so far is the interaction polygon (B-polygon) between the target sub-
tetrahedron and one of the surfaces of the target tetrahedron. Contact potential at the
B-points is known. As the contact potential over target sub-tetrahedron is a linear function