Page 321 - The Combined Finite-Discrete Element Method
P. 321
304 ALGORITHM IMPLEMENTATION
.........continued from previous listing.............
/* resultant at T-points */
tmp=((ut[1]-ut[0])*(vt[2]-vt[0])-(vt[1]-vt[0])*(ut[2]-ut[0]));
inext=-1;
if(ABS(tmp)<RP1*theigh)
{ inext=0; tmp=ABS(ut[1]-ut[0])+ABS(vt[1]-vt[0]);
for(i=0;i<3;i++)
{ j=i+1;
if(j>2)j=0;
if(tmp>(ABS(ut[j]-ut[i])+ABS(vt[j]-vt[i])))
{ tmp=ABS(ut[j]-ut[i])+ABS(vt[j]-vt[i]); inext=i;
}}
j=inext+1;
if(j>2)j=0;
if(ABS(zt[j])>ABS(zt[inext]))inext=j;
j=inext+1; if(j>2)j=0; k=j+1; if(k>2)k=0;
tmp=(ut[k]-ut[j])*(vt[3]-vt[j])-(vt[k]-vt[j])*(ut[3]-ut[j]);
}
for(jnext=0;jnext<3;jnext++)
{ i=jnext;
j=i+1;
if(j>2)j=0;
k=j+1;
if(k>2)k=0;
if(i==inext)i=3; if(j==inext)j=3; if(k==inext)k=3;
ft[k]=forco*
(((ut[j]-ut[i])*(vforc-vt[i])-(vt[j]-vt[i])*(uforc-ut[i]))/tmp);
}
ft[3]=RP25*ft[3];
for(i=0;i<3;i++)
{ ft[i]=ft[i]+ft[3];
}
Listing 10.19 Calculating resultant force at T-points, i.e. nodes of the target tetrahedron.
in detail in Chapter 3. Arrays are sorted by repeated swapping of couples of numbers that
match the swapping criteria.
10.6 NBS CONTACT DETECTION ALGORITHM IN 3D
The list of local variables used for the NBS contact detection algorithm in 3D is shown in
Listing 10.23. The input for the NBS contact detection algorithm is comprised of arrays
i1eccx, i1eccy and i1eccz. These arrays contain integerised coordinates x,y and z for
each discrete element.