Tuesday, 31 March 2009

DIsplay elements / polar setup, PAFEC




Copy the Python code into an interpreter, execute it. Copy the output to a NODES
section. First the display, then, an uncoupled BE, over a circular region, raised slightly from
z=0.


c cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
c DISPLAY
c cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
c Python script for node generation.
c from math import *
c def n():
c r, o, n0 = 0.025, [0, 0, 2E-3], 100 # radius, origin, 0th node.
c for i in xrange(360 + 1):
c x = o[0] + r * cos(0.5 * i * 2 * pi / 360)
c y = o[1] + 0
c z = o[2] + r * sin(0.5 * i * 2 * pi / 360)
c print n0 + i, x, y, z
c print n0 + i + 1, o[0] + r / 2, o[1], o[2]
c print n0 + i + 2, o[0] + r / 2, o[1], o[2] + r / 2
c print n0 + i + 3, o[0] + 0 / 2, o[1], o[2] + r / 2
c print n0 + i + 4, o[0] - r / 2, o[1], o[2] + r / 2
c print n0 + i + 5, o[0] - r / 2, o[1], o[2]
c print n0 + i + 6, o[0], o[1], o[2]
c print

c for i in xrange(360 + 1):
c x = o[0] + 0
c y = o[1] + r * cos(0.5 * i * 2 * pi / 360)
c z = o[2] + r * sin(0.5 * i * 2 * pi / 360)
c print 400 + n0 + i, x, y, z
c print 400 + n0 + i + 1, o[0], o[1] + r / 2, o[2]
c print 400 + n0 + i + 2, o[0], o[1] + r / 2, o[2] + r / 2
c print 400 + n0 + i + 3, o[0], o[1] + 0 / 2, o[2] + r / 2
c print 400 + n0 + i + 4, o[0], o[1] - r / 2, o[2] + r / 2
c print 400 + n0 + i + 5, o[0], o[1] - r / 2, o[2]
c print 400 + n0 + i + 6, o[0], o[1], o[2]
c print

c for i in xrange(360 + 1):
c x = o[0] + r * cos(0.5 * i * 2 * pi / 360)
c y = o[1] + r * sin(0.5 * i * 2 * pi / 360)
c z = o[2] + 0
c print 800 + n0 + i, x, y, z
c print 800 + n0 + i + 1, o[0] + r / 2, o[1], o[2]
c print 800 + n0 + i + 2, o[0] + r / 2, o[1] + r / 2, o[2]
c print 800 + n0 + i + 3, o[0] + 0 / 2, o[1] + r / 2, o[2]
c print 800 + n0 + i + 4, o[0] - r / 2, o[1] + r / 2, o[2]
c print 800 + n0 + i + 5, o[0] - r / 2, o[1], o[2]
c print 800 + n0 + i + 6, o[0], o[1], o[2]


PAFBLOCKS
BLOCK GROUP ELEMENT.TYPE PROP N1 N2 TOPO
1 1 24720 11 <'dm'> <'dm'> 462 190 461 100 0 0 145
2 1 24720 11 <'dm'> <'dm'> 280 190 463 462 235
3 1 24720 11 <'dm'> <'dm'> 370 280 464 463 325
4 1 24720 11 <'dm'> <'dm'> 370 464 460 465 0 415
5 1 24720 11 <'dm'> <'dm'> 463 462 466 461
6 1 24720 11 <'dm'> <'dm'> 464 463 465 466

7 2 24720 11 <'dm'> <'dm'> <462+400> <190+400> <461+400> <100+400> 0 0 <145+400>
8 2 24720 11 <'dm'> <'dm'> <280+400> <190+400> <463+400> <462+400> <235+400>
9 2 24720 11 <'dm'> <'dm'> <370+400> <280+400> <464+400> <463+400> <325+400>
10 2 24720 11 <'dm'> <'dm'> <370+400> <464+400> <460+400> <465+400> 0 <415+400>
11 2 24720 11 <'dm'> <'dm'> <463+400> <462+400> <466+400> <461+400>
12 2 24720 11 <'dm'> <'dm'> <464+400> <463+400> <465+400> <466+400>

c 13 3 24720 11 <'xm'> <'xm'> <462+800> <190+800> <461+800> <100+800> 0 0 <145+800>
c 14 3 24720 11 <'xm'> <'xm'> <280+800> <190+800> <463+800> <462+800> <235+800>
c 15 3 24720 11 <'xm'> <'xm'> <370+800> <280+800> <464+800> <463+800> <325+800>
c 16 3 24720 11 <'xm'> <'xm'> <370+800> <464+800> <460+800> <465+800> 0 <415+800>
c 17 3 24720 11 <'xm'> <'xm'> <463+800> <462+800> <466+800> <461+800>
c 18 3 24720 11 <'xm'> <'xm'> <464+800> <463+800> <465+800> <466+800>

c cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
c BE
c cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
c r, z0 = 4.75E-3, 1E-3
c def n2():
c for i in xrange(17):
c print i+1, r * cos (i/16. * 2 * pi), r * sin (i/16. * 2 * pi), z0
c print 17, r/2, 0, z0
c print 18, r/2, r/2, z0
c print 19, 0, r/2, z0
c print 20, -r/2, r/2, z0
c print 21, -r/2, 0, z0
c print 22, -r/2, -r/2, z0
c print 23, 0, -r/2, z0
c print 24, r/2, -r/2, z0
c print 25, 0, 0, z0
c for i in xrange(31, 46 + 1):
c print i, r * cos ((i - 31) / 16. * 2 * pi), r * sin ((i - 31) / 16. * 2 * pi), 0



PAFBLOCKS
BOUNDARY.ELEMENT = 1000
GROUP ELEMENT.TYPE PROP N1 N2 TOPO
c top face
4 24620 11 <'xm'> <'xm'> 18 3 17 1 0 0 2
4 24620 11 <'xm'> <'xm'> 5 3 19 18 4
4 24620 11 <'xm'> <'xm'> 7 5 20 19 6
4 24620 11 <'xm'> <'xm'> 7 20 9 21 0 8
4 24620 11 <'xm'> <'xm'> 9 21 11 22 0 10
4 24620 11 <'xm'> <'xm'> 22 23 11 13 0 0 0 12
4 24620 11 <'xm'> <'xm'> 23 24 13 15 0 0 0 14
4 24620 11 <'xm'> <'xm'> 17 1 24 15 0 0 16
4 24620 11 <'xm'> <'xm'> 19 18 25 17
4 24620 11 <'xm'> <'xm'> 20 19 21 25
4 24620 11 <'xm'> <'xm'> 21 25 22 23
4 24620 11 <'xm'> <'xm'> 25 17 23 24
c side face
4 24620 11 <'xm'> 1 1 3 31 33 2 0 0 32
4 24620 11 <'xm'> 1 <1+1*2> <3+1*2> <31+1*2> <33+1*2> <2+1*2> 0 0 <32+1*2>
4 24620 11 <'xm'> 1 <1+2*2> <3+2*2> <31+2*2> <33+2*2> <2+2*2> 0 0 <32+2*2>
4 24620 11 <'xm'> 1 <1+3*2> <3+3*2> <31+3*2> <33+3*2> <2+3*2> 0 0 <32+3*2>
4 24620 11 <'xm'> 1 <1+4*2> <3+4*2> <31+4*2> <33+4*2> <2+4*2> 0 0 <32+4*2>
4 24620 11 <'xm'> 1 <1+5*2> <3+5*2> <31+5*2> <33+5*2> <2+5*2> 0 0 <32+5*2>
4 24620 11 <'xm'> 1 <1+6*2> <3+6*2> <31+6*2> <33+6*2> <2+6*2> 0 0 <32+6*2>
4 24620 11 <'xm'> 1 <1+7*2> 1 <31+7*2> 31 <2+7*2> 0 0 <32+7*2>






An alternative approach is to get PAFEC to generate the
nodes, and use triangles.



c polar extraction. Define three nodes, for arc definition. 1 node per dgree.
NODES
NODE AXIS X Y
300 3 0.018 0 c on axis.
345 3 0.018 45
390 3 0.018 90 c 90 degrees off axis
391 3 0.000 0 c on axis, 0 radius, for display elements.
ARC.NODES
LIST.OF.NODES.ON.ARC
300 301 302 303 304 305 306 307 308 309
* 310 311 312 313 314 315 316 317 318 319
* 320 321 322 323 324 325 326 327 328 329
* 330 331 332 333 334 335 336 337 338 339
* 340 341 342 343 344 345 346 347 348 349
* 350 351 352 353 354 355 356 357 358 359
* 360 361 362 363 364 365 366 367 368 369
* 370 371 372 373 374 375 376 377 378 379
* 380 381 382 383 384 385 386 387 388 389
* 390

c observation elements.
PAFBLOCKS
BLOCK TYPE GROUP ELEMENT PROP N1 N2 N3 TOPO
56 2 7 24710 13 15 15 15 391 300 390 0 345

No comments:

Post a Comment