:

## Mesh2D triangular

Maple 14

Dear all,

Find here a part of my precedent post "2D finite element method" which represent a worksheet for 2D triangular Mesh.A part of the mesh can rotate with regard to the other by modifying theta.

restart: with(geometry): with(plots):

ms := 8: n := 6: mr := 5: theta := (1/180)*(23*Pi):

wrs := (1/1000)*<30.8, 33, 36, 39, 40, 43, 46, 49, 53.25>:

wrr := (1/1000)*<20,23,26,28,30,30.8>:

wt := (1/180)*Pi*<0,10,20,30,40,50,60>:

for i to ms+1 do for j to n+1 do nods[i, j] := j+(i-1)*(n+1): l := nods[i, j]: xss[l] := evalf(wrs[i]*cos(wt[j])): yss[l] := evalf(wrs[i]*sin(wt[j])) end do: end do:

for i to ms do for j to n do k := 2*(nods[i, j]-i)+1; isks[1, k] := nods[i, j]; isks[2, k] := nods[i+1, j]; isks[3, k] := nods[i+1, j+1]; k := k+1; isks[1, k] := nods[i, j]; isks[2, k] := nods[i+1, j+1]; isks[3, k] := nods[i, j+1] end do: end do:

nsgs := (ms+1)*(n+1): nks := 2*ms*n: nkr := 2*mr*n: nsgr := (mr+1)*(n+1):

for i to mr+1 do for j to n+1 do nodr[i, j] := nsgs+j+(i-1)*(n+1); l := nodr[i, j]; xsr[l] := evalf(wrr[i]*cos(wt[j]+theta)); ysr[l] := evalf(wrr[i]*sin(wt[j]+theta)) end do: end do:

for i to mr do for j to n do k := 2*(nodr[i, j]-i-nsgs)+1+nks; iskr[1, k] := nodr[i, j]; iskr[2, k] := nodr[i+1, j]; iskr[3, k] := nodr[i+1, j+1]; k := k+1; iskr[1, k] := nodr[i, j]; iskr[2, k] := nodr[i+1, j+1]; iskr[3, k] := nodr[i, j+1] end do: end do:

for k to nks do inod1 := isks[1, k]; inod2 := isks[2, k]; inod3 := isks[3, k]; triangle(Ts || k, [point(A || inod1, xss[inod1], yss[inod1]), point(A || inod2, xss[inod2], yss[inod2]), point(A || inod3, xss[inod3], yss[inod3])]) end do:

D1 := draw([seq(Ts || k, k = 1 .. nks)]):

for k from 1+nks to nks+nkr do inod1 := iskr[1, k]; inod2 := iskr[2, k]; inod3 := iskr[3, k]; triangle(Tr || k, [point(A || inod1, xsr[inod1], ysr[inod1]), point(A || inod2, xsr[inod2], ysr[inod2]), point(A || inod3, xsr[inod3], ysr[inod3])]) end do:

for k from 1+nks to nks+nkr do inod1 := iskr[1, k]; inod2 := iskr[2, k]; inod3 := iskr[3, k]; triangle(Tr || k, [point(A || inod1, xsr[inod1], ysr[inod1]), point(A || inod2, xsr[inod2], ysr[inod2]), point(A || inod3, xsr[inod3], ysr[inod3])]): end do:

D2 := draw([seq(Tr || k, k = 1+nks .. nks+nkr)]):

display(D1, D2);

﻿