Académique Documents
Professionnel Documents
Culture Documents
Pergamon
0045-7949@5MMl221-9 .
I
Compukrs & Srwcrures Vol. 58, No. 5, pp. 99-1001. 19% Copyright 0 1995 &vier Science Ltd Printed in Great Britain. All rights reserved 0045.7949/96 h5.00 + 0.00
ANIMATION
Abstract-An interface program which makes it possible to animate finite element models of metal forming processes in an Autodesk 3D Studio environment is presented. The program converts typical finite element results files for a succession of deformation stages into an ASCII file suitable for loading into 3D Studio. The interface presented processes two-dimensional models only; it requires that the models are discretized by linear rectangular elements and dies by linear two-noded elements. Conversion of mesh objects is based on the creation of triangular three-dimensional faces structured on a set of vertices which are defined by the node positions in the finite element result file. The program is written in FORTRAN and a glossary of terms and the source listing are included. For axisymmetric cases, guidelines are provided for generating three-dimensional effects. An elaborate example of the operational procedure is given.
INTRODUCTION
In recent years computer-aided engineering (CAE) techniques have been applied increasingly with great success in metal forming research. Numerical modeling of metal forming processes using the finite element method has reduced the lead time and development costs associated with the manufacture of new components. However, in the majority of cases, the task of analyzing the results is still tedious, requiring considerable effort for the interpretation of a large number of graphical plots for various stages of deformation. Further, these plots are not always readily assimilated and important details in the process, such as dead metal zone formation and development of flaws, remain obscure even to experienced engineers. Therefore, post-processing of finite element results plays an important role and developments in post processing have paralleled the developments in computers. The performance of personal computers has reached a level which makes animation, in this environment, a realistic tool in the research of metal forming processes. Animation can be seen as the third generation of post processing after the line printer output and the graphical plot. As it imparts motion to still images, it improves the understanding of material flow and makes computer aided detection of processing failures more reliable. Animation facilities for finite element (FE) analysis are already encountered in several commercial general purpose post-processing programs, but these can only be implemented on workstations.
Given this background, the main objective of the reported work is to provide an interface which allows FE users to animate solutions in a personal computer environment by applying a professional animation program. The feasibility and flexibility of the solution, together with the high quality of the animation, emphasizes the advantages of this approach. The interface program reads input data which are arranged in two different families with respect to the file structure. The first family relates to the description of the FE mesh object and provides a list of the material node numbers and the corresponding coordinates, which is followed by a list of the nodal connections of each element in counter clockwise order. The linear rectangular element was chosen because of its popularity, but the program can be modified to include other mesh elements without difficulty. The second family requires a discretization, in counter-clockwise order, of the contour of the dies which are defined by using two noded linear elements. The file produced by the interface program from one or several FE output files is compatible with 3D Studio by Autodesk [l], and editing of the loaded mesh objects, including the dies, is not necessary during animation. In the present form, the listing only covers animation of two-dimensional FE models. It is expected that the interface will save engineers and researchers considerable time in introducing animation into their work. Modification of its main architecture is welcome, and can be done at two different levels:
991
992
S. B. Petersen et al. A commercially available program which enables the above is 3D Studio by Autodesk. 30 Studio background Autodesk 3D Studio is a three-dimensional modeling and animation application program for personal computers. Besides the basic facilities for animation, the program enables the assignment of a variety of surface textures and colors and is able to impart a metallic appearance to the imported objects. Further, cameras and lights used for professional animation can also be added. Basically the purpose of the animation program is to create a file containing a series of calculated in-between positions and states for the FE meshes, usually only created for relatively large steps in time (to save storage disk space). Thereby a sufficient number of still-images are provided from which continuous movement of the dies and corresponding deformation of mesh objects can be generated. Representation of geometrical objects in 3D Studio environment is based on the creation of numerous faces which together display the surface of the object. Each face consists of a triangle formed from three vertices; vertices are defined as points in the Cartesian space, forming the structure on whichfaces are built. The 3D Studio animation program is able to read files with ASCII format in which the mesh objects are described by individual vertex- and facelist [l]. Generally FE results files do not have this structure; therefore it is necessary to convert the
(a) enlargement 1. the possible choice of discretization elements (the current program only supports linear, four noded rectangular elements for mesh objects and Lwo-noded linear elements for dies); (b) inclusion of thr :e-dimensional animation for axisymmetrical cases. Guidelines for the latter have been provided. However, for research ~1trposes the two-dimensional solution is sufficient. :vhereas three-dimensional animation of processes wrth axisymmetric geometries is more relevant for e4:ls:ational/training purposes.
PROGRAMMhtG i ONSIDERATIONS
Some basic requirendcn?., were taken into account in the design of the inrcr-C:z.ce. Besides being easy to use, it was decided thcl the post-processing must contain the following capabilities: (a) entire post processing should be performed on personal computers; (b) incorporation of ;nols in th: animation; (c) animation of me:,!, objects t:.<posed to remeshing; (d) animation with borh wire irame and two colored material-the latter irispirec ii:, the experimental work with plasticine; (e) eventual three-di!ncnsion:il animation should be possible by si:q:le exte .:.:.:II of the twodimensional model.
1
Fig. 1. Wire frame model with dies from investigation of the radial extrusion process [31.
993
Fig. 2. Chequered-pattern
model.
using an interface program. The animation file (.FLI or .FLC) created by 3D Studio is compatible with ANIMATOR by Autodesk and MEDIA PLAYER for WINDOWS by Microsoft. 3D Studio requires, as a minimum, a 386 processor with math co-processor and 4 Mb of RAM. Experience suggests that, for the animation of FE simulation of two-dimensional problems which contain approximately 500 elements, a more realistic choice would be a state of the art 486 processor with 16 Mb of RAM. information Two -dimensional interface program
(1) Choice between wire frame model (Fig. 1) and chequered-pattern model (Fig. 2). (2) Creation of mirror image for horizontal symmetry cases (vertical symmetry is default). Symmetry lines must be coincident with a coordinate axis. (3) Selective or sequential file reading procedure; the latter is convenient when several successive FE files corresponding to identical jumps in deformation (time) are to be processed. Initial testing and development was done with simple models, such as compression tests. Later work included more complex bulk metal forming processes, as seen in Fig. 1. The analysis was preformed using PLAST2 FE program [2] and the examples were taken from ongoing research work [3,4] in which the animation has played an important role in understanding process mechanics. One of the advantages of the presented solution is the ease with which the FE result file is processed to enable the animation; the technique is illustrated in the following example.
EXAMPLE
Since standard FE result files always include a definition of nodal points using x- and y-coordinates which is similar to the vertex definition necessary for the ASCII file, only facelist has to be created. In practical terms this means a simple conversion of the linear rectangular elements into triangular faces and obscuring the diagonals in the element/square formed by two triangles. The FORTRAN program listed in Appendix II consists of a main program with several subroutines. In subroutine INPUT, the program reads the FE results files (FEMx OUT) from the disc. Codes for the mesh model and die animation are computed in the subroutines WIRE and PATTERN depending on choice of animation model. The output file (PLAST3DS.ASC) to be read by 3D Studio is, as previously mentioned, in ASCII format. Running the interface program will give the following options:
Considering that the majority of users may not have knowledge of animation techniques, an extensive example of the whole operational procedure is provided in order to ease the introduction to animation. Terms and commands specific for 3D Studio
994
S. B. Petersen et al.
total frames = A x (no.FEM
files - 1) (1)
where 15 < A < 30 will result in space for the calculation of 14-29 intermediate positions and states in between two loaded FE mesh objects. (5) Enter TRACKinfo, which provides a global view for planning the animation, by picking the initial mesh in the front (X/Y) view. Add morph? keys at every Ath frame leaving A -1 empty frames between two morph keys. The default parent object is the initial mesh object. Fig. 3. Flow diagram for files utilized during preparation of an animation scene. Using KEYinfo pick the first morph key. Once inside KEYinfo increase Key # number by one. To change the morph to object click the morph window and choose the mesh object which succeeds the initial mesh object. Proceed in this way to morph all the remaining mesh objects to the initial mesh object. If horizontal symmetry was not chosen during the interface procedure, add position keys at frames previously provided with a morph key. Press the position button and change the parent object to the one which follows the initial mesh object. Write down the x and y position. Proceed to next parent object until all positions of parent objects have been identified. Change parent object to the initial mesh object and increase Key number by one. Input the previously observed x and y position of the object to be morphed at this frame (position key). Repeat the procedure until all object positions have been assigned. This rearrangement is necessary as 3D Studio allocates a definition point for each object at the average point of the objects x and y extremity coordinates. Otherwise random movement of an asymmetrical object can occur during animation due to changes of the definition point. After exiting TRACKinfo, everything is ready for the creation (rendering) of the animation file. (6) Repeat step 5 for each moving die. (7) Choose renderer/render and pick the front (X/Y) view to make the renderer menu appear. To create the animation file use rendering to disk. Having chosen the output file name the rendering begins. Clearly the time necessary for rendering the animation file will depend on the complexity of the FE model and on the number of files supplied for the range of deformation to be animated. For the presented case, animation of 150 frames took approximately 45 min to process using the proposed hardware.
Three-dimensional interface program
will be used; to enhance understanding, these are written in italics. In Fig. 1, a model consisting of a two-dimensional axisymmetric geometry is shown. Originally, only one quarter of the model containing 420 elements was analyzed. Further, three physical constraints (tools) were specified; a mandrel, a container and a punch. The animation procedure, for which a flow diagram is provided in Fig. 3, is as follows: (1) Create FE output files (FEMx.OUT) with format as an Appendix III for successive 10% deformation, in order to provide sufficient intermediate positions and states of the mesh object (e.g. one output file for each additional 10% height reduction in a simple compression test). (2) Run PLAST3DS and select animation model. Horizontal symmetry was assumed in this example and the files were read sequentially to save time. Note that occasionally when a large number of FE output files has been processed into the same PLAST3DSASC file, the memory capacity can be exceeded for loading into 3D Studio. If this is the case split PLAST3DSASC into two files by reprocessing the FE output files. (3) Start up 3D Studio and loud PLAST3DS.ASC while in 30 Editor mode; it is mandatory to save the information immediately in binary .3DS format. If several PLAST3DS.ASC exist, begin by making individual transformation to .3DS format and subsequently merge the files into the first .3DS file. (4) Change from program to keyframer mode in which the animation will be made. Choose the X/Y (front) view. Before beginning the animation it is necessary to hide all objects, apart from the initial (including dies). Do display/hide/by name and choose all other objects than the initial. Under time/total frames set the total number of frames (still images) appropriately using:
t Morphing is a term taken from metamorphosis, which means to change physical shape or form-usually through supernatural means [2].
If required, the two-dimensional interface program may be enhanced to include three-dimensional animation of axisymmetric geometries. Among several possible strategies authors suggest the cheese
995
Fig. 4. Three-dimensional
model solution illustrated in Fig. 4, where a single image from a three-dimensional animation of the case presented in Figs 1 and 2 is shown. This solution allows the viewer to observe the material flow and
development of external, as well as eventual internal geometries, simultaneously. Information about the operational sequence can also be obtained. In practical terms, such an extension in the animation requires programming modifications in the subroutines WIRE and PATTERN. One programming policy is to create two cutsurfaces and subsequently build the necessary surfaces between these to make the model look solid. The algorithm to create the cut-surface parallel to the X-Y plane is included in the listing of the two-dimensional program. The new cut surface, which is located at a given angle in the X-Z plane, can be defined by rotating the first cut-surface. To form the surfaces between the two cuts, it is recommended to create a set of vertex frames from the boundary nodes of the original FE mesh. Equally distributed between the two cut surfaces, in terms of rotation, the vertex frames will form, two by two, the structure on which the three-dimensional faces are to be built. The same procedure is applied for the dies.
CONCLUSIONS
two-dimensional models using linear rectangular elements; the same scheme can be extended to other elements and to three-dimensional models. The resulting animation is of high quality; further enhancements can be achieved through the use of graphical boards and display terminals with high resolution. In comparison to FE animation produced using commercially-available software which runs on workstations, the proposed solution has the major advantage of being cheap to implement, with no reduction in the quality of the animation. Since the work described above was developed in a personal computer environment, the animation results files with standard industry formats .FLC and .FLI can be incorporated in the multimedia packages available for these computers and used either in research or for education/training purposes.
REFERENCES
The software described has been proven to be computationally efficient for interfacing FE results files of metal forming processes with the Autodesk 3D Studio animation program; the program is easy to implement and use. The listing refers only to
Barata Marques, Numerical and experimental simulation of cold forging processes. XIiI Seminririo Nacional de Forjamento, UFRGS, Porto Alegre Brazil (1993). 3. M. Arentoft, S. B. Petersen, J. M. C. Rodrigues, P. A. F. Martins. R. Balendra and T. Wanheim. Review of the research on the iniection foraing of tubular materials. J. Mater. Proc. Tech. 52, 4cG71 (1995). 4. S. B. Petersen. J. M. C. Rodriaues and P. A. F. Martins. Extended formability limits -for tubular components through combined injection forming/upsetting-a finite element analysis. J. Engng Manuf. 209, 107-l 14 (1995).
996
APPENDIX A:
The first set
S. B. Petersen et
GLORRARY OF PROGRAM VARIABLES
29 M 31 32 C 33 c 34 c 35 c 36 C 37 :. c 39 c MC 41 42 13 c 44 c 15 c 46 17 c 4a c 49 c 50 51 52 C 53 c 51 c 55 MC 57 c MC 59 64 61 c 62 C 63 C 61 65 C 66 c 67 C 68 69 70 71 72 13 71 75 76 77 70 79 80 C a1 c a2 c 83 a4 a5 c 86 C a7 c
al.
of variables establish current array dimensioning. Users may change some of these variables to match the size of their FE model and the memory available in the computer. number of nodal points in the FEnumber number number one die of elements in the FE-model of dies in the FE-model. of nodal points allowed for in the FE-model.
--------_~__~~_~____________I________________________ NAImmAn --__~__~~~~~_~__~___~~~~_____~_______________________________ WRITS (6,lOOO) *** choose arhtion IiWS (6400) RKAD (54 IwimL *** Stap if 0 IF (In0DRL.E!l.O)SFOP *** Inquire horizontal qnetry RITE (6,3@30) WAD (5,*) InOizII *** Stop if 0 IF (IRORIZ.Bp.0) SlVP *** Chose file reading procedure lode1
MPOIN
The second set of variables stores the geometrical information of both the animation and FE model. Attention must be focused on variable NFACES; due to limitations in 3D Studio, this value should never exceed 64.000. number of dies in the considered FE result file. NDIES NDPOI number of nodal points describing the considered die. number of elements in the considered FE result NELEM file. number of nodal points in the considered FE NPOIN result file. NVERTEXnumber of generated vertexes for an object. NFACES number of generated faces for an object.
The last set of variables groups some of the more important remaining variables. COORD coordinates x and y of each nodal point in the FE result file. LNODS connections for each linear rectangular element in the FE result file. die definition stored in array form. DIEDF COLOR stores the color code of the previously examined elements of the FE-mesh.
1 2
1 2
CALLDIWW (WOIN,MLBII,H0IE,NDFQI) IF (Ilt3DRL.Bp.l) TRE4 CALL HIRE (HFOIN,llliLXN,WIRS,l!DFOI, ~,IJIODS,RDPOI,DIEDF,llDIi$ IFPKc,IRORIX) RLSBIP(IlmDSL.R4.2) TRRn CALLPAYTKPJI (HPOIll,HJL%,HDIRS,wwOI, CWRD,LWO~,RDPOI,DIRDF,UDIRS, IFPRE,IRORIz,COLOR) EL% SrnP RNDIF *** The Prcqran stopped norwlly WRITE (6,WQ) READ *** Input/output data formats I/ I STUDIO ( RNTER=erit)
APPENDIX B: mxuu
COMPUTER
PROGRAM
INTERFACE,//,
PusT3rs (A-R,oq
WT (Ill, 1 7X,SKLECT AnIMTIcSlmDsL,/, 2 3 6 7 7X, 1. wire franc w&l 7X, 2. Pattern lode1 7X,fOR STOPAlUAYs: O,/, 7X. W,/, (2D),//, )
3D
STUDIO
INTERFACE FOR
97 98 99 1M)
HETAL PIUITE
PORllIWG ANALYSIS
BLBWEUT
FllIS PRUGRAH CREATES ASCII PO@lAT ScBlRS FRC4YW-DIWlSIUlAL AXIS-CAL FMTS W IKMLS TO BS ARIHATSD USING AJTGiWS3D STODIO. Rote: This version only wpports 4 node elements.
Ci!OICR : 101 3@30 FOEAT ( 1 7x, m YO0u:w RExmTAL SYwTRY,/, 10: 103 2 7X. 1. iw.l 104 3 71; 2. YRS,/, 105 I 71, CROICR : 106 4OOO FOIWT 107 1 7X,SELKT FILE UUDIBGFWEDUW,/, 108 2 7X, 1. Selective,/, 109 3 7X, 2. Sequential,/, 110 I 7X. CmxCS : 111 5Km miaus (I/, 112 1 71, ASCII FILK : 113 3 71, SOWS rmLY CWTKD,/, : I 71, IX DIRKORY ilk
) PLAST3l&ASC,/, c:\3w\Dl&RS,
PRESSWXR YQ BXIT
: )
991
WRITE (12,310O) w ii0 Imu=l,wpoIS Ivmnx=Imu-l aapDT =cccw,~rn~n~ CoolMz =acm(2,ImuI) WRITE (12,32fM) IVERTEX,CCORDX,O3ORDI K4lTItUlE ** 2nd quedrant In 120 ImIJl=1,nmIN Iv~x=nmIwImIn-l acmx =-l.+aci+iql,ImIn) CoDpDz=awz,Imn) hRITE(12,3200) IVEp.TlX,KORDX,CCORDI COnrIlmB *et If borirontel synetry 200 line
m 130 ImIN=l,nmIw IvmTux=2enmIStImIn-l CtmRDx =-l.*a0m(l,Imxn) aaw =-l.a4tD(2,ImIIq WRITE (12,320o) I~,cooRDX,CCORDI OMFIIIUE *** 41th quadrant
m 140 ImIw=l,wFoIn
IVERTex=3*IlmI*ImIN-l CooRDx=awRD(l,ImIS) mORDa=-i.ao~~(2,ImIn) VllITE(12,3Mo) ~,mOPDX,C CQl?miDK 03UFINLQ *** Face list *** 1st quadrant WRITE (12,4OC@) m 210 IEL~~I=~,YBLW IFACE =IEl#l IFACE2 =liIILMtIBLBI-1 IvEIiTaX1=IJ0lql,Is)-l IVEli?BX2=LKWIE(2,IM)-1 IVEIifEX3=IKU(3,ISLH)-1 IvmTEx4=lJ0Is(4,IELRI)-1 WRITE (12,IlW) IFACKl,IvBR?EXl,IY2,IvERT~X3 YRITE(12,003) IFACE2,UERTKX3,IMRnX4,IIIpRTBX1 CONTINUE *** 2nd quedraat m 220 IELX4l=1,YELM IFACE =24KMtIELBkl IFACR2 =3WLBltIgLBI-1 IvXRmxl=mRtum(l,Iwl)-1 IVERm2=mIRtuoDs(2,Im)-1 IVmmx3~Int~(3,Im)-1 IVmx4=lmnltuoDs(4,Im)-1 VRle (12,410o) I?m,~,Ixl,ImBx4 HRIVE(12,410o) IPACK2,IVBTRX4,IWRTH3,IV~X2 amVIlmm *** If borirontal qmetq IF (IEGW.BQ.1) COXO 300
l **
line
3rd quadrant
998
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
S. B. Petersen et al.
IVERTEX4=2*NmINt~(4,IELFJl)-1 WRITE (12,4100) IFACRl,IVERTEXl,IVERTEXZ,IVERTEX3 WRITE (12,410o) IPACR2,IVERTEX3,IVERTBX4,IVERTEXl CCHTIHUE ** lth quadrant 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 431 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 MxlRDZ =-1.*DIRDF(JDIES,IPIOl) URITE(12,320O) IVERTEX,CC0RDx,C%%DZ IVRRTEXIPIO-lt7*N WRITE (12,320O) IVERTEX,COORDX,COORDZ CONTINUE CONTINUE *** Face list it* lst (DIES)
230 C c c
240 300 C C C
W 240 IELEII=l,NELM IPACE =6*NELB(rIELF#-1 IPACE -7*NELRUtIELEW-1 IVERTEX1=3*WPOIN%!iODS( l,IELW)-1 IVERTEX2=3*NmINtL(2,IELBl)-1 IVERTEX3=3*NIQINtLNODS(3,IELEIl)-1 IVERTEX4=3*NmINMODSnons(l,IeLBI)-1 WRITE (12,410o) IPACCB1,IVRRTEX2,IVERTRTEXl,IVKRTEX4 WRITE 112.41001 IPACE2.IVRRTEX4.IVERTEX3.IVRRTEX2 CGilTIWUE CONTINUE *** DIES W 500 JDIES=l,NDIES LDIF.S=1000*JDIFSiIPILE WRITE (12,240O) LDIES NPlwKrnI(JDIRS)
340 400 c c c c c
quadrant
C C C c c
*** Sizing the model (DIES) *** Vertical synnetry line only NVERTEX=4*NFN NFACES =Z*NFTU
410 C c C
WRITE (12,400O) w 410 JDrnI=l,NFTO IFACEl =JDmI-1 IvwrRxl=~mI-1 IVERTEXZ-JDmI IVERTEX3=NPKHJDmI IF (JDmI.EQ.HpTo) TEEN IVERTEXZ-0 IVERTEX3=NeTO EHDIF WRITE (12,420O) IFACE1,IVERTEX1,IVEREX2,IVERTEX3 CCiiTINUE
c c C
c c c c C c
(DIES)
420 c c C c c C
W 420 JDmI=l,NFTO IFACEl =RTlOtJDmI-1 IVERTEX1=2*NPIC+JDmI-1 IVERTEX2=2*1CFlCtJDkC! IVRRTEX3=3*NPTO+JDmI IF (JUmI.BQ.wpTo) TERN IVERTEX2=2*NPN IVRRTEX3=3*NPN ERDIF WRITE (12,420O) IFACEl,IVRRTEX1,IVWTEX2,IVERTEX3 CGYTINUE *** If horizontal synwtry line IF (IEORIZ.EQ.1) GOPI500 *** 3rd quadrant w 430 JDrnI=l,NFN IFACEl =2*NPlMJDmI-1 IVERTEXl=l*NF?OtJDmI-1 IVERTEX2=4*WI IVERTEX3=5*RPIOtJDmI IF (JomI.eQ.wm) TRW IVRRTEXZ=I*NPIO IVF.RTEX3=5*NFM FJIDIF WRITE (12,420O) IFACEl,IVERTEXl,IVERTEX2,IVRRTEX3 CMTINUE
310 L C
IVERTEX=O IQ 310 IPTO=l,NPm IFml =2*1Pm IVERTEX=IPm-1 CCORDX =DIEDF(JDIES,IPMl-1) mORDZ=DIRDF(JDIES,IPml) WRITE (12,320O) IVEIiTEX,CWRUX,COORDZ IVERTEX=IPN-1tNFN WRITE (12,320O) IVERTEX,COORDX,aX)RDZ CuiiwUE
430 c c c
***4th
quadrant
320 c c C c c C
Dl 320 IPm=1,NFlu IPml =2*1Pm IVERTEX=IFKI-lrZ*W KORDX=-l.~DIEUP(JDIES,IPl-1) c(oRDZ =DIRDF(JDIEs,IpTo1) WRITE (12,3Mo) IVBRTEX,co3RDX,CCORDZ IVERTEX=IFlO-1+3*NP WRITE (12,320O) IVRRTEX,COORDX,CC0RDZ CONTINUE *** If horizontal syuetry IF (IUORIZ.EQ.l) GOTO 400 line
440 500 6M1 C C C C C c C c c 1wo 1100 12wl 1300 c ZMX) 2100 2xN) 2300
W 440 JDmI=l,NPTU IFACEI =3*NPlC+JDmI-1 IVERTEX1=6*NPK%IDmI-1 IVERTEX2=6*NPTOtJDmI IVERTEX3=7*NFIOIJDmI IF (JDmI.EQ.HpM)) TREN IVERTEX2=6*NPN IVERTEX3=7*NPN MDIF WRITE (12,420O) IFACEl,IVERTEXl,IVERTEX2,IVERTEX3 O3HTINUE CCUTINUE CONTINUE *** Read next selective file
IF (IFPR~C.EQ.~)wm loo *** Close output file CLOSE (12) *** Input/output data fonats rnlwT (/,7X, FOMAT 7X, mFJUT ( 7X, m#tAT 7X, IHWT FILE FEN?.CUT ) START FILE NUHBER FQl?.CNT j END FILE HlMRR FEU?.OUT FILE STEP )
w 330 IPm=1,wm IPSO1 =2*1F?O IVERTEX=IPIO-lt4t CCORDX =-l.*DIRDF(JDIES,IPNl-1) KORDZ=-l.*DIRDF(JDIFS,IFlQl) WRITE (12,320o) IVERTEX,COORDX,CWRDZ IVERTEX=IPlO-ltS*NFlYJ WRITE (12,320o) IVRRlEX,CMIRDX,CZ CONTINUE **t Ith quadrant w 340 IPm=l,NPm IFml -2IPm IVEAEX=IFIO-lt6HFN CUORDX =DIEDF(JDIES,IFIOl-1)
1;
PORlUT (AUBIENT LIGBTCOLOR: R&l CRBBY=l BLUE-l) MmAT (/,liAwD U&J&T: FEll,Il,) POWUT (/,NAHRD OglRC?: FB,Il,) FORHAT (/,'UMED OEJECT:"W',IJ,'"')
999
487 3100 FiMAT (VMTBX LlST:) 488 3200 FOFJW(VBRTBX,II, X: J12.4, 409 1 J12.4)
y: O.oMx), a: An:
c IOOU FOMT (PA0 LIST:) 4100 FQidUT(FACB ,II,: A: ,II, 8: ,I(, 1 1 EC: 1 CA: O,/, 2 HATERIAL: WITS YIRBFFANE) 4200 FORNAT (FACE ,II,: A: ,I(, B: ,I(, 1 1 CA: l,/, 2 NATFRIAL:BLUEYIRBFRME)
C: ,I(,
an:1 Bc:
C: ,II,
498 c 499 5GQ 501 502 503 504 5.95 506 M7 c 508 509 C 510 c 511 C
RE!rDM BND
WRITE (12,310O) W 110 ImIN=l,llPDIN IVBRTEX-ImIN-1 ClxwDx~(1,IrnIlI) CWRDZ=aoRD(2,IFoIH) hWTE (12,32C@) IvBRTEX,UXlRDX,CWDZ CONTINUE
1 2
SULlROUTINE PATTBRN (WaIW,UBLWlDIBs,HDPOI, CWRD,LNW,IDPOI,DIBDF,llDIRS, IFPRCC,IBoRI~,CUIJ3il) IWPLICIT WJBLEPRECISION (A-W-2) _______________________________________________ _~~~~_~~~~~__ -THISSUWUTINE BUILDS A PAITBRN WDEL __________________________ __________-_ ___________-----_-------
DINBNSION aXIRD( 2,NFUIN) ,WKIDS(I,NELBI), 512 513 1 ND~I(~!DIRS),DIBDF(HDIES,(~~~WJ~I)), 514 2 COLIIR(NBLBI) CRARACTER FILEWT*25 515 516 C file 517 c 518 c FILWUT=C:\3DS2\INAGBS\//PUST3DS.hSC 519 OPEN (UliIT=l2,PILE=PILKYJT,STAlQS=UNWW) 520 WRITE (12,2OKI) 521 522 C *** Initialization for file reading procedure 523 C 524 C CQNTINUE 525 100 526 C *** Selective file reading 527 C 528 C IF (IFPRCC.EQ.l) TEEN 529 WRITE (6,lOOO) 530 READ (5,*) IFILE 531 IF (IFILE.BQ.0) TEEN 532 CLQSE (12) 533 RETURN 534 BNDIF 535 ISFILE =IFILE 536 IEFILE =IPILE 537 IFILE.STP=IFILE 538 539 c *** Sequential file reading 540 c 541 c ELSEIF(IFPRW.EQ.2) TREN 542 URITE(6,llW) 543 READ (5,) ISFILE 544 WRITE (6,120o) 545 READ (S,*) IEFILE 546 WRITE (6,130o) 547 READ (5,*) IPILESTP 548 FJIDIF 549 550 c *** Reading input 551 c 552 c M 300 IFILE=ISFILE,IEFILE,IFILeSTP 553 CALLIWJT (IFILB,!&QIIW,llBLH, 554 1 nmIw,nBLE4l,wDIBs,HDmI,NDIBs, 555 2 556 CCW,MDS,NDmI,DIFDF) 557 c *** Writing output 558 c 559 c IF (IFILE.LE.9) TEEN 560 YRITE(12,2100) IFILE 561 ELSEIF(IFILR.LE.99) TBEli 562 RTtITR (12,220o) IFILE 563 ELSE 564 565 WTE (12,230O) IFILE R4lDIF 566 567 c *** Siziq the lode1 568 c 569 c *** Vertical syuetry line only 570 c 571 c NWTEX=2*WPOIN 572 NFACES =I*NBLPII 573 574 c
W 120 ImIN=1,IIpoIN IVERTEX=NPOINtImIH-1 aoRDx =-l.*ozoRD(l,ImIn) COORDZ =ww2,ImIn) WRITE (12,3xX)) IVBRTEX,WRDX,COOE(DE @UCINlM *** If horizontal syaaatry line IF (1EORIMQ.l) GOKJ MO
Do 130 IrnIN=l,HmIW IVBRTEx=2*llmIHImIn-1 m~t~x =-3 .*ozm(l,ImIr) CWJRJX =-l.wlRD(2,IWIll) WRITE (12 32v3) IV5zX Cc#Jx oY3mi
amPJE
w 140 ImIn=l,nmIn Iv~x=3wo~tImIw-l acmx =kwRD(l,ImIn) aaRDa =-l.Kcc%D(2,ImIl) WRITE (12,3200) IVBR?EX,CWDX,COORDE CtXlTIiiUB @JNTINUE *** Face list WRITE (12,tCW~) *** 1% qa&aat
IVBRTEX3=LJW(3,IEWl)-1 IW.TEXI=IJ#%I4.IELBII)-1
*** Building chegwred pattern IF (IELMQ.1) Gom 205 m 203 JBLBI=l,IELE# ISlL4PJ=O D3 202 IWDB=1,4 w 201 JlwDE=1,4 IF (uoDs(IrooE,IELw).ep.Lwow(Jroos,JE~)) TEEN ISBARX=ISuREt1 RNDIF CWTIiiUE COWTHUs IF (ISJlARB.GB.2) TBKN CuUlR(IBLBI)~uJR(JELBl)*(-1.) GDTO 205 BWDIF KdiTINUE CiWfINUB IF (coLoR(1BLtOl).B~.1.) TBBY RITE (12,4100) IFACB~,I~BRTKX~,IVER?B~~,IVBR~BX~ WRITE (12,41&l) IFACB2,IVERTBX3,IVRRTXX4,IVBR?BX1 BLSBIF(COIOR(IBLIGl).UJ.-1.)m .____ .._ .___. -.... --. WITL; ,12,42w) IFACE~,IWRTBX~,IVBRTBX~,IVBRTBX~
1000
666 667 668 669 670 671 672 673 674 675 676 677 671 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724
S. B. Petersen
WRITE (12,4200) IPACE2,IVERTEX3,IVBRTEX4,IVERTEX1 EI(DIF COWTINUE 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 174
et al.
4MKl WI&AT(FACE LIST:) 4100 PoRluT (FACE ,II,: A: .II. B: <II. 1 AB: 1 PC: 1 CA: l,/, 2 HATERIAL: WRITEMATTE) 42W FQFHAT (FACE .14.: A: .I(. B: .I(. 1 hB: 1 Bc: 1 a: 1;,/, 2 RTERIAL: RED MATTE) C ReTURN END
C: .II.
210 C C C
C: .II.
220 C C C C C C
Do 220 IELEN=l,NELM IPACE =2*NELRItIELEl4-1 IPACCE2 =3*NELWtIELlM-1 IVERTEXl=l(wIN+LMDS(1,IELBl4)-1 IVERTEX2=NFOINtWIODS(2,IELa+o-1 lVRRTEx3=NmwloDS( 3,IFJxl4)-1 IPESTEX~=NPO~U+LW~DS(~,I~IMI-~ coLoR(IELB()=-l.+COlOR(IELEli) IP (03LOR(IELKl4).EQ.l.)TBW WRITE (12,41CQ) IFACCB1,IVKRTBX2,IVERTEXl,IVERTEX4 WRITE (12,410O) IFACE2,IVBRTEXP,IVBRFEX3,IVER?EX2 ELSEIF(CUlOR(IBL~).BQ.-1.) TBEN WRITE (12,42W) IFACE1,IVERTEX2,IVBRTEXl,IVERTEX4 WRITE (12,420O) IPACE2,IVKRTEX4,IVKRTEXJ,IVERTEX2 ENDIP CCNTINUE *** If horizontal symmetryline IF (IBORIZ.EQ.l) GOTO 300 *** 3rd quadrant W 230 IELt%=l,NELER IPACE =4*NELBHtIRLW-1 IPACE =5*NELWtIELBI-1 IVBRTEX1=2%OINtLNOD5(l,IELB!4)-1 IVERTEX2=2~NF0INtLNODS(2,IELW)_1 Iv~EX3=2~wPoIwtl(3,1~~~-1 IVERTEX4=2*NPOINtW(4,IEL~)-1 COlM(IRLet)=-l.t(IELBl4) IF (coLoR(IE~ew).EQ.l.j Tmi WRITE (12,410O) IFACE1,IVERTEXl,IVERTEX2,IVERTEX3 WRITE (12,410O) IFACCE2,IVERTEX3,IVERTRX4,IVERTEXl ELSEIF(COLOP.(IELW).t!Q.-1.)TBFAI WRITE (12,420O) IFACCE1,IVERTEX1,IVERTEX2,IVERTEX3 WRITE (12,420O) IPACE2,IVERTEX3,IVEREX4,IVERTEX1 ENDIF CONTINUE *** Ith quadrant D3 240 IELEH=l,NELEII IPACE =6*NELBltIELEH-1 IFACE =7*NELEWtIELEH-1 IVFRTEX1=3*NlQINtLNoDS(l,IELEU)-1 IVERTEX2=3*HWINtLWODS(2,IELM)_1 IVeRTEX3=3*NFQINtLNoDSoDs(s,reLw)-1 IVERTEX4=3*NFUINtLNODS( 4,IELEH)-1 COUIR(IELWI=-l.*COUIRlIELWI IF (&LOR(IkLD4).EQ.l.~ TEEN WRITE (12,410O) IFACEl,IVKRTEX2,IVERTEX1,IVERTEX4 WRITE (12,410O) IPACE2,IVF.RTEX4,IVERTEX3,IVERTEX2 ELSEIF(CULOR(IELEH).EQ.-1.) TREN WRITE (12,420O) IFACE1,IVERTEX2,IVERTEX1,IVERTEX4 WRITE (12,4200) IFACE2,IVERTEX4,IVERTTeX),IVERTEX2 ENDIF mcIN!lE CONTINUE *** Read next selective file
1 2 C c
SUBRWTINE INPUT (IFILE,NFOIN,NBLBI, HFOIN,HBW,HDIRS,l4DF0I,NDIES, CCORD,LlK0S,NDIQI,DIEDF) IHPLICIT WUBLE PRECISION (A-&O-a) ________________________~~~~~~_________----~~~~~______-------~ THISSUBROUTINE READS TIIEINPiJT DATA FILES ________________________-------________-----_--_______--------
775 c 776 C
230 c C c
777 DIHENSION CMRD(2,HWIN),LllODS(r,llEL04), 778 1 NDWI(WDIES),DIEDF(HDIES,(7t2~HDWI)) 779 c CRARACTER TITLE*80 780 CBAMCTER FILEAUX*l2,FILEIN*25,NSTP1*1,NSTP2*2,NSTP3*3 781 782 C *** Input file 783 c 784 c IF (IPILE.LE.9) TBEN 785 WRITE (NSTPl,(Il)) IFILE 786 FILEAUX=FEU//NSTPl//.//GKS 787 ELSEIF(IPILE.LE.99) TREN 788 WRITE (NSTPZ,(IZ)) IFILE 789 PILF,AUX=Pt%//NSTP2//.//GKS 790 ELSE 791 WRITE(NSTP3,(13)) IFILE 792 FILEAUX=FE4//NSTP3//.//GKS 793 ENDIF 794 795 c FILKIN=C:\ACAD\PLAF2D\//FILEAUX 796 OPEll(!l!4IT=11,FILE=FILEI!4,STATUS=@LB,ERR=4OO) 797 798 c READ (ll,(AaO)) TITLE 799 READ (11,) NFQIN a00 801 C *** Read coordinates 802 c a03 c W loo IFOIN=l,I(POIN a04 READ (Il.*) JPoIN,C~RP(l,JwIN),cooRorz,Jwrwl a05 CUKTlNUE a06 loo 807 C READ (11,) NELEH 808 so9 c *** Read topolcqy 810 c 811 C I0 200 IKLW=l,NELEW 812 RRAD (ll,*) JELBI,WODS(l,JBLEl4),MDS(2,JELW), al3 814 1 LIKIDS(~,JBLBII),LIKIDS(I,JELBI) al5 2oo 816 c 817 c 818 c 819 820 C a21 a22 823 a24 c 825 a26 827 a28 3w a29 c 830 c 831 c a32 a33 c 834 c a35 c 836 a37 a38 c a39 c 840 c a41 400 a42 ski a44 c 845 c a46 c a47 1OW 03NTINUE *** Read dies READ (ll,*) NDIES
725 726 727 728 729 730 731 732 733 734 135 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756
2W 3w c C c c C c
Do 300 IDIES=l,NDIES RHD (ll,*) JDIES,NDFOI(JDIFS) Nm=NDmI(JDIaS) w 300 IFiG=1.Nm 1PIo1=2*1PI+J RPD (ll,*) DIEDF(JDIBS,IFlOl-1),DIKDF(JDIES,IPIOl) CONTIINE *** close current GKSfile CMSE (UNIT=ll) t*t Reading of file complete
CLOSE (12) c *** Input/output data for&s c c FtN?.WT : INWT FILE 1wO FMT (/,7X, STAR! FILKNUMBKR FH?.VJT : 11w FCMT ( 7X, END FILE NUHBER FBw?.oDT: 1200 FCRJIAT ( 7X, : FILE STBP 13MI F%MT ( 7X, C FoRMAT (AKBIBNT LIGETCOLOR: RBD=lGREW=1 BLOE=li 2wo 2100 f#MF (/,NAHBDCIUBCT:FB,Il,) WWUT (/,NMBD CBTEC?:FBH,I2,) 2Mo 23cQ FoMAT (/,liMED OBIBCT:FpII,I3,) c ,I(, FACE: ',II) 3ooO FOFMT(TRI-IIKSR, VBRTICRS: ml0 FOWIAT (VBHRX LIST:) FWNAT (VERTEX,II, X: ,F12.4, 32w I Y: O.oMx), a: ,F12.4) C
) 'I ) )
WRITE (6,200O) PILFMX Cum (121 STOP *** output data fonat FOIUUT
1001
APPENDIX C:
INPUT FILE
NO. OF DIES NO. OF WODAL POINTS DIE NO. 1 X-POSITION (WODE 1) Y-WSITIOW(IIODE 1) X-POSITION (MDE 2)
DIE NO. 2