• No results found

An interpretive finite element problem oriented language for hydraulic engineering

N/A
N/A
Protected

Academic year: 2020

Share "An interpretive finite element problem oriented language for hydraulic engineering"

Copied!
248
0
0

Loading.... (view fulltext now)

Full text

(1)University of Southampton Research Repository ePrints Soton. Copyright © and Moral Rights for this thesis are retained by the author and/or other copyright owners. A copy can be downloaded for personal non-commercial research or study, without prior permission or charge. This thesis cannot be reproduced or quoted extensively from without first obtaining permission in writing from the copyright holder/s. The content must not be changed in any way or sold commercially in any format or medium without the formal permission of the copyright holders.. When referring to this work, full bibliographic details including the author, title, awarding institution and date of the thesis must be given e.g. AUTHOR (year of submission) "Full thesis title", University of Southampton, name of the University School or Department, PhD Thesis, pagination. http://eprints.soton.ac.uk.

(2) An Interpretive Finite Element Problem Oriented Language For Hydraulic Engineering. A Thesis Presented for the Degree of Doctor of Philosophy of the University of Southampton in the Faculty of Engineering and Applied Science. by. JAMES MATTHEW imOUXXf. September 1976.

(3) UNIVERSITY OF SOUTHAMPTX%I ABSTRACT K&OULTY OF ENGINEERING AND AfSHLIED SCIENCE CIVIL ENGINEERING Doctor of Philosophy ]ONT]EBj?RIZril/E ITINfTlS EHjEMEBTT ]?R)BI]EM CMRIE3WIED LajsGtiAGE i%3R tTfDiiALnjK: EnwcziifEigRjagG b%r JNames fiatjihaf IWelsscxn. This. thesis describes the design and implementation. of a major. finite element cxsnputer system. The system recognizes a problem oriented Problem. language called FEHPOL Oriented I^guage).. to initiate. (Finite. ^lanent. Its function is. and coordinate the. Hydrodynamic. to allow the user. solutions of given partial dif-. ferential equations on two dimensional regions.. By issuing some. simple commands, models can be developed, modified, and run with complete interactive user control at each phase. Among the system's facilities which. are provided are symbolic. representation and manipulation of geometrical entities (such as curves, regions, and nodes,) and solution parameters (state variables, boundary conditions, constants).. An original mesh gene-. ration algorithm for multinoded triangular elements is included, together. with comprehensive display and. The system processes. plotting capabilities.. eight supervisor calls, mostly for passing. finite element data to and from the solution program (s). Several. examples of solved problems are given, and techniques. for programming. in FEHPCL are discussed.. In addition, a. discussion of the existing solution programs is included.. short.

(4) CONTENTS. Abstract. page. Ac knowledgements. 1. List of terms and abbreviations. 2. INWODUCTIW. 4. Chapter 1:. Chapter 2:. Chapter 3:. Chapter 4:. (1.1) Finite Element Systems. 5. (1.2) The FEHPOL Systan. 8. (1.3) The FEHPOL Language. 8. (2.1) Parsing Scheme. 11. (2.2) Error Detection and Recovery. 14. (2.3) Documentat ion. 16. (3.1) FEHPOL Programs. 20. (3.2) Defined Types. 21. (3.3) Supervisor Calls. 23. (3.4) The Symbol Pool. 26. (3.5) Machine Independence. 28. (4.1) Some FEHPOL Algorithms. 30. (4.2) The Triangular Mesh Generation Algorithm 30 (4.3) Algorithm to Generate Side Nodes. 36. (4.4) Internal Node Generation Algorithm. 36. (4.^5) Contour, Plotting Algorithm. Chapter 5:. Chapter 6:. 40. (4.6) Smooth Interpolation. 45. (5.1) FEHPOL Solution Programs. 56. (5.2) "Oie Solution Program DSPSTD (examples). 57. (5.3) "Die Solution Program NAVSTK (example). 75. (5.4) General Examples of Use of FEHPOL. 85. (6.1) Conclusions and Discussion. 107. (6.2) Enhancements and Further Development. 108.

(5) page Footnotes. 110. References. 113. Agpendix A:. The FEHPOL System Source. Appendix B:. The FEHPCL User's Manual. Appendix Gs. The Solution Program NAVSTK. Appendix D:. Adding Solution Programs to FEHPOl. Appendix E:. Expanded Introduction and Discussion of Previous Finite Element Systems.

(6) Acknowledgements. I would like to express my thanks to Dr. C. A. Brebbia. for. his suggestims and directim through each phase of the project. Thanks are also due to Dr. R\ A. Ad^y, for his frequent comments and nmny hours of discussion.. Thanks also to him for providing. a useful finite element modelling program to be used in conjunction with the FEHPCL System. To Dr. P. Partridge, C. Roach, Ms. J. Gosink, and S. Smith, many thanks for suggestions relating to the syntax of the FEHPOL language. Finally, thanks to each of the participants at the Decanber 1975 Introductory Course on Finite Elements for Fluid Flow, both for acting as 'guinea pigs' and for suggestions resulting in several desirable modificatims and additions to the system..

(7) List of Terms and Abbreviations. bandwidth. - - the maximum number of elements in any row of a matrix outside which every matrix element is.equal to zero. (Backus-Naur Form) a language for de-. BNF. scribing the grammar of any language. connectivity. a table of the node numbers which are associated with each element in the finite element mesh.. finite state automaton -. (deterministic) a five-tuple (K,VT,M,. S/Z) where K is a set of states, VT is the ir^t alphabet, M is a mapping from K x VT into K, S is the start state, and Z is the nonempty set of final states. (denoted G(Z)) a nonarpty set of pro-. grammar. duction rules with distinguished symbol Z. a program recogizing a language which. interpreter. performs the requested operations itself. symbols that appear in a graimnar, but. nonterminal syndaols. not.in the language it defines. recognizing a language.. parsing. a rule for replacing a set of symbols production rule. by a single nonterminal symbol. nodes not situated on the vertex of a. side nodes. finite element. a pictoral representation of a finite. state diagram. state automaton. -. state transition supervisor call. proceeding from one state to the next. via the mapping M(0,T) for a given FSA. a request to a supervisory system. to.

(8) perform a generalized operation (generated usually by an illegal instruction). terminal symbols. . symbols appearing in the language defined by a given grammar.. top-down parsing. a predictive reoognition process that avoids use of precedence relations to form the parse..

(9) Introduction. The aim of this thesis is to provide a detailed description of the design, implementatioi, and use of the FEHPQL System. It begins with a discussion. of the aims and requirements of an in-. teractive finite element systgn and of how the FEHPQL System has met them. Chapter T\fO discusses the actual development cluding a discussion of the parsing scheme.. strategy, in-. Chapter Three goes. into some detail about the structure of the FEHPCL System.. The. supervisor calls and symbol structure are described. The fourth chapter deals with several of the original algorithms contained in the system which have general utility. Chapter Five presents a variety of steady state dispersion, seepage,. and flow problems and their solution using the FEHPCSu. system. Examples of. FEHPCL generated. graphics and listings of. sequences of EEHPOL commands are given. The sixth chapter consists of concluding remarks and suggestiais for the further development of the system.. some.

(10) CHAPTER 1. DISCUSSION.

(11) 6 1.1. finite Element Systems While the finite element method is widely used in structural. mechanics problems, its relatively recent extension to problans in fluid dynamics has become increasingly practicable.. Some reliable. codes are in production use which, model seepage, thermal problems, estuarial hydrodynamics, and related problans.. Several more codes. are under development for such problems as wave mechanics, turbul1 ent flow, and fluid-structure interactions. The prime difficulties in using these codes lie in the batch input procedure.. Because the data is generally complex and inter-. related, problem descriptions are error prone. The rigidity of the data does not allow convenient modification of the problem and the formation of a finite element idealization vdiicfa forms an adequate approximation to the problem but also has optimal computability is rather difficult. The advantages of computer aided data preparation are readily evident, and thus the proliferation of preprocessing met the demands of the non-design oriented sector. 2 finite element systems have. been developed,. programs has Several large. particularly for use. in static stress analysis. These combine a wide. variety of solu-. tion capabilities with both pre and post-processing,. and have met. with substantial success among the engineering community. With the rapid development of distributed processing and wide range of powerful minicomputers becoming available, smaller interactive ccxnputer systems are being developed.. These often suit the. » classes of problems which are either uneconomic. the large scale. systems or vAich are primarily design oriaited, *Aere problem descriptions are the independent variable. and immediate. feedback is. essential. While interactive cong)uter aided design systems have been de-.

(12) 7 3 veloped for use with the finite element technique^ these primarily are data generation systems which use interactive graphics to help the designer define and modify his problem description.. Particu-. larly for the developing area of coastal and offshore engineering ^ a computer system is needed v^ich is able to interactively coordinate the data generatim, solution, and subsequent analysis of the design problem. Some. 4 requirements of such a system may be summarized as fol-. lows:. 1) It must be easy to use. 2) Its response time must be short enough for the designer to maintain continuity of thought. 3) It must have low core storage requirements to allow use on modern minicomputers. 4) Uie commands must allow minimum problem description without Ipss of versatility. 5) It should be able to modify designs without having to repeat the whole process from the beginning. 6) It should diagnose any errors in an easily understandable way. 7) It should be crash proof.. Characteristic of the development of computer systems for any scientific or engineering purpose is the conflict between the systems programme or software tist.. specialist and the engineer or scien-. Only by a well balanced partnership between the two groups. can an efficient and modular, yet user and problem oriented system be developed..

(13) 8. 1.2. The FEHPOL System To effectively use the existing solution codes and the engin-. eering expertise they represent to maximum benefit, the system was designed and structured in many ways similar to an ordinary operating system.. Rather than incorporating solution codes within the. basic structure of the system,.they are run 5 general and installation independent way.. under the system in a. The ccmnand language is. acting not only as an interactive data generation and display initiator but also as the job control. language for executing. element solution programs of arbitrary capabilities. available to assign and reassign job control language.. finite. Commands are. system devices as in an ordinary. In fact, coupled with the local device ser-. vice routines for a particular installaticm, the PEHPOL system may run as a stand-alone non-multitasking operating system. This design strategy separates the system's software strategy from the actual applicatiai programs, thus providing the necessary balance between systems programming techniques and engineering expertise.. In addition, it allows a very open ended development of. codes to run under the system for a wide variety of problem types, while making use of existing reliable. codes with a minimum of al-. teration. As the system Is an interpreter, no precompiling or object code generation is required. The system simply reads its own problem oriented language and executes the intended operation.. 1.3. The FEHPOL Language g In developing the syntax of the FEHPOL language much care and. attrition. was given to make it as easy to learn and as similar to. English as possible.. Feedback from consulting engineers, acedemic. staff, and conference delegates helped to crystallize the development of a workable. and understandable set of comnanda.. Not only.

(14) 9 does a problem oriented language of this nature need to be able to accept minimum programmer description of a finite element problem^ but also it must be versatile. enough to represent a wide range of. problem types. To accomplish this,. statements should be independent of one. another and mutually transparent. They must perform actions m the data structure. which leave its integrity unimpaired regardless of. the possibly illegal consequences of the action.. Being a high le-. vel language (one in which a single instruction may represait very complex operatims) rather than basing it on primitives, the number of different command types is minimized and consequently it is easier to learn. 7. The aim is to provide a wide range of modifiers. to the verbs to enable logically similar but computationally different operations to be performed. An example of this is the H O P command.. In each of the following cases a different type of plot. is generated;. map Mzms mar «SH m a r a m imeBL m s n m o r <name of fx)des> m a r <name of region) m a r <name of curve>. mar onomt mp or. <name of parameter>,IjBNMB:3=(<list of nmibers». To help make the language easy to learn and use, the analysis is very flexible.. Free formatting is si%x)rted, and. ability to recognize abbreviatims and eliminate. lexical the. of keywords helps sin$»lify use. spelling errors. Both blank spaces and blank lines. are allowable anywhere but within a name or keyword..

(15) CHAPTER 2. DEVELOPMENT STRATEGY.

(16) 11 2.1. Parsing Scheme Formal language theory has been developed considerably since. 8 Chomsky first described a language formally,. itie definition of a. grammar which generates a language and the finite state automaton have. beai of great benefit ^to compiler. writers^ not so much in. terms of the relative merit of* formal parsing hoc. techniques over ad. schemesy but by' providing considerable insight. cognition process.. into the re-. A basic knowledge of automatic syntax methods. clearly helps him to program more systematically and efficiently. 9 A state diagran is a representation maton.. It is more closely. of a finite state auto-. suited to aiding the compiler writer. than the more rigorous mathematical representation. nonterminal symbols of the effectively nest. By allowing. language in the state diagram one can. diagrams in an easily understandable form. For. instance, consider a small subset of the production rules for the FEHPCL language (written in BNF); $. <curvestatement>: :<aQm<pointlist><idaitif ier> <pointlist>::=<point> <pointlist>;:=<pointlist><point>. In state diagram form these could be represented by Figure 1.. CURVE'. PoiitAlici. < point >. Figure 1.

(17) 12 Starting at the start state (labelled S) of a given diagram and traversing arcs in. clockwise preference vAenever the symbol. above it is recognized, the end state (labelled E) is reached if the input sentence was syntactically correct. If the end state 10 cannot be reached, a syntax error is detected. To include both the actions v^ich. correspond to each state. transition and prc^^ec error analysis and recovery, more features can be added to the diagramming represaitation.. Differentiation. must be made between errors which occur within the state diagram and those which occur because the first symbol in the diagram is not recognized. This requires three standard exits to each diagram which we may denote EX700 (exit for errors occurring within a diagram), EX800 (normal exit without error), and EX900 (recognition did not begin).. Secondly, the actions associated with a. state transition may he included below the arc and denoted ACTn. This means that the action must be performed when traversing the arc. , Using these conventions the diagram on the preceding page becomes Figure 2.. 'CURVE'. poin.-t(lSt>. ACTS. Point. I let. ACT4. EXSOO. Figure 2.

(18) 13 In this form, the diagram has become essaitially a flowchart of the interpretation process, vAiich may be coded quite easily in PORTBAN. Let each diagram represent a FORTRAN function which returns one of three possible values, depending on the. exit taken.. For convenience the values ai;e chosen to be (-1,0,1) which correspond to the exits EX700, EX800, and EX900.. With the aid of the. lowlevel routine NEXTIS, which reads cards and scans for the next incoming character string, returning the string matches. value zero whenever the. its argument, the transition diagram may be coded. as follows:. MtmiYiimi p o n m j s r o Q. ...perform actim 1... iFfBanmasroQ 2# ...perform actim 2.... 30 ...perform action 3.... 1# ...perform action 4... IF(BOmr(N) 7M Bonmsp*-!. panmj3p=#. GO 30 88#. 7#m. 9#g B Q n m s p = i. Emm. END. In this way the interpreter is coded in a cxm^ct, systematic and efficient manner.. The program is effectively modularized in such. a way that the grammar is readily apparent and easily alterable..

(19) 14 2.2. Error Detection and Recovery The systematic interpretation scheme discussed in the prev-. ious section makes the recognition of syntax errors an autonatic process.. The system replies to a syntactical error by printing. the offending line with a pointer to the character at vAiich the error occurred and waiting for* the next conmand. not sure of the corr^t syntax of the. If the user is. command, he may trace the. parsing process by preceding it with the command:. "MafR OK. the effect of this. statement is to provide a map of the parsing. of subsequent statements.. An example of the use of this coitmand. is given in Example 1 on the next page.. The map lists the char-. acter being sought by NEXTIS, as well as the name of the routine representing the state diagram just entered.. Because the names. (IDTs)-of the routines are picked so that the last abbreviate the name of the nonterminal symbol. four letters. being sought, the. state diagram paths taken are clearly evident. In the examplef the parser. first looked for a CURVE state-. ment (FPCUST). ' To find one it looked for the character 'C'. As it was not found the parser went on to search for an INTERPOLATE statement (FPINST) vAiich it found. Next it looked for a defined type name (FPDSNM) which required looking for letters, the character. and digits (FPLETR and FPDIGT).. Following this sort. of map one can 'easily see not only that the comma was the offending character, but also the other possible characters that could take its place and be syntactically correct. user can figure out the syntax resorting to. By this means, the. of the commands online,. without. a manual every time he forgets the exact format..

(20) 15. CURVE 0 , 2 0 0 0 0 , 4 0 e e * F R E D TRACE ON INTERPOLATE FRED , 7 NODES LINEAR FPCUST NEXTIS INTERPOLATE FRED C. ,. 7 NODES LINEAR FPINST NEXTIS. INTERPOLATE FRED I. ,. 7. NODES LINEAR FPDTNM FPLETR FPLETR FPLETR FPLETR FPLETR NEXTIS. INTERPOLATE FRED. ,. 7. NODES LINEAR FPDIGT NEXTIS. INTERPOLATE FRED. , 7 N. NODES LINEAR NEXTIS. INTERPOLATE FRED. ,. 7. NODES LINEAR FPRLNM NEXTIS. INTERPOLATE FRED ,. 7 NODES LINEAR FPDIGT. .SYNTAX ERROR! INTERPOLATE FRED ,. 7 NODES LINEAR. *. TRACE OFF. Example 1.

(21) 16 Besides making syntax errors, the user may make logical errorS; such as. referencing an undefined. illegal operation.. symbol or attempting an. Errors of this nature are handled on a case. by case basis with careful checks.. In the case of most logical. errors, a concise, self-explanatory message is remainder of the current line is ignored.. printed and the. However, for certain. errors, the system actually diagnoses and corrects the fault and continues processing the current line. page. In Example 2 on the next. are given several examples of logical. error diagnosis and. recovery. A third type of FEHPOL errors have to do with the limits of the system and the integrity of the data structure.. Among these. are symbol pool overflow, overflow of workareas,. corruption of. various tables, and solution program error exits.. They cause a. message to be displayed of the form:. a Z B = nnn****. where nnn is the ABORT code (given in Table 1).. After an abort. the system reinitializes itself and processing is resumed.. 2.3. Documentation Good documentation. is essential if a computer system is to. be of general applicability and wide use. in this area that most engineering. Unfortunately, it is. systems, and a great deal of. powerful general purpose software are lacking. The documentation strategy for the FEHPOL system is twofold.. Firstly, the manuals. for user's and programmers are separate, accurate, and as up-todate as possible,. and secondly, canprehensive. doc ument at ion is. included in comment form as part of the system's source..

(22) 17. QUIT WRITE CONNECTIVITY .CONNECTIVITY TABLE WRITE CONNECTIVITY. IS EMPTY! X #. CURVE 1 , 1 2 A 6 . 2 * J W 0 N - 1 .SYNTAX ERROR! CURVE 1 , 1 2 A 6 . 2 * J V 0 N - 1 * :A .SYNTAX ERROR! *A # INTERPOLATE S W D E S " 1 8 , L I N E A R .UNDEFINED NAME I INTERPOLATE S N O D E S - 1 0 , L I N E A R SET 0 - 3 . 3 ON D .UNDEFINED N A P E ! SET Q " 3 . 3 ON D REGION 1 , 1 l , 2 » C R U # e i Y - R E G I 0 N f C S H CRUMMY-REGION WITH THREE NODED T R I A N G L E S .TOO FEW BOUNDARY NODES! f C S H CRUMMY-REGimi WITH THREE NODED T R I A N G L E S #. GENERATE INTERNAL NODES ON NONEXISTENT .UNDEFINED N A P E ! GENERATE INTERNAL NODES ON NONEXISTENT » REGION R 1 , 1 1 , 4 4 , 4 4 , M A .UNDEFINED N A P E ! REGION R # 1 , 1 1 , 4 4 , 4 4 , 1 * A NODE 3 . 3 , 4 . 4 * A .NAPE PfOT U N I Q U E ! NODE 3 . 3 , 4 . 4 * A NAPE NOT U N I Q U E ! I CHANGED TO X REGION CRUMMY-REGION:B PESH A H O L E S » ( B ) WITH S I X NODED T R A I N G L E S .TOO FEW PIQDES ON INTERNAL BOUNDARY!! PESH A H O L E S » ( B ) WITH S I X NODED T R A I P K L E S #. LET - 7 , - 7 " I N T E R N A L NODE FOR A PESH A WITH THREE NOIKD TRIANGLES ^UNUSUAL MESH& OPTIMIZATION OMITTED! PESH A WITH THREE NODED TRIANGLES #. SET B « 1 3 ON # 1 8 3 .NODE NOPIBER TQ8 LARGE! SET B " 1 3 ON # 1 2 3. Example 2.

(23) 18. C C. c c c c c c c c c c c c c c c c c c c. c c c c c c c c. TABLE OF ABORT CODES FOR THE F E H P O L SYSTEM 1 5 / 0 8 / 7 6 ABORT NO. 1-28 29 38 31 32 33 34 35 36 37 38 39 48-45 46 47-52 53 54. MEANING. RESERVED FOR SOLUTION PROGRAMS SYMBOL OR PARAMETER POOL OVERFLOW PARAMETER POOL CORRUPTION HAS OCCURRED SYMBOL [email protected] CORRUPTION HAS OCCURRED MORE THAN 1 0 0 SYNTAX ERRORS S I N C E I N I T / Q U I T ILLEGAL INTERPOLATION CODE ILLEGAL ELEMENT CODE NEGATIVE NUMBER OF INTERNAL NODES NO. OF EQUALLY ATTRACTIVE CONNECTIONS > 1 0 TOO ^MNY F I N I T E ELEMENT NODES FOR SYSTEM S I Z E RENUMBERING TABLE CORRUPTION HAS OCCURRED TOO MANY F I N I T E ELEMENT CORNER NODES RESERVED FOR S ^ T E M DEVELOPMENT NOT ENOUGH POOL SPACE LEFT FOR INTERPOLATE RESERVED FOR SYSTEM DEVELOP^e:NT ATTEMPTED CONTOUR PLOT WITH UNAVAILABLE ELEMENT ATTEMPTED CONTOUR PLOT OF NON-NODAL PARAPETER. NOTE: A MORE DETAILED I N S C R I P T I O N O F THE MEANING OF THESE CODES AND CORRECTIVE ACTION TO % TAKEN SHOULD THEY OCCUR I S GIVEN IN THE U S E R ' S MANUAL ENTITLED 'THE FEHPOL S Y S T E M ' .. Table 1.

(24) CHAPTER 3. THE SYSTEM S STRUCTUSB.

(25) 20 3.1. FEHPOL PROGRAMS FEHPGL is a special purpose. interpretive problem oriented. language for setting up and solving hydraulic engineering problans using the finite element method. provide. a user oriented interface. Its prime function is to. between the complexities of. finite element calculations and the description of a particular problem. This is accbmplished using a command processing supervisor structure. Amcmg the facilities which the FEHPCL system provides are symbolic definition ^ reference^ and manipulation of geometrical entities (such as. curves, regions, and nodes) and of. solution. parameters (such as state variables, boundary conditions, etc), automatic node generation of several types, automatic mesh generation. and bandwidth minimization, comprehensive display and. plotting facilities, trace facility,. physical device reassignment, an internal. and the ability to load and. execute arbitrary. solution programs. The language. is specifically. tailored to solving partial. differential equations on two dimensional geographically oriented regions. As such, the commands are of a very high level in terms of the complexity oE the response to a given command. The symbolically referenceable data types. are lists. of points and. lists of data associated with a solution program (parameters) • Being an interpreter, the system builds its tables dynamically using a two way pool for maximum storage efficiency. The parsing. algorithm used. commands and. to. eliminate the dependence on a. precedence relations. made up by ease. is top-down to facilitate. addition of. strict set of. The efficiency lost by this technique is. of maintenance and alteration.. The system in-. cludes a command frequency table to speed parser operation..

(26) 21 3.2. Defined Types A CURVE in FEHPQL is an ordered list of. which represents a. non-closed curve.. points. It is associated. widi a. symbolic name when defined, and can be referenced in many different FEHPOL commands. by name.. For instarKxs,. a CURVE may la:. operated upon by the INTERPOLATE statement producing arKwlist of. points, larger than the. original list, according to one of. several user specifiable interpolation formulae. Reference can be. made to a particular point in a CURVE by. using subscripts (similar to FORTRAN arrays), For instance, the tenth point. in CURVE named ISLEDFWIGHT could be referred to as. ISLEOFWIGHT(10). In Edition, parts of CURVES may be referenced using expanded subscripted format (ie. SEAWALL(3-11)). A CURVE may also be referenced in reverse order by. preceding it with a. minus sign. CURVES are the fundamental of thfe geometry of a region. unit in building a description. on which a finite. element mesh is. to be produced and a partial differential equation solved. The various interpolation types allow minimum description of region boundaries yet with an arbitrary number of finite element nodes on than.. In. particular,, the. interpolation types REGULAR and. SMOOTH provide a simple way to define the typically unsynmetric boundaries of seas, harbours, and estuaries. Because nodal solution tions. are specified on. parameters such as boundary condi-. CURVES, CURVES generally represent the. logical parts'of a region's boundaries.. For instance, to solve. a differential equation on a square box with the state variable PSI equal to -13.0 on one side of the region and 5.0 on another side one could define four CURVES, named RIGHTSIDE, BOTTOMSIDE, LEFTSIDE, and TOPSIDE and the region SQUARE in. of t±ian..

(27) 22 thai he could set the value of PSI on the. sides by issuing. the camnand:. SET Bsi=-13.# CM EEomsnm, psi=5 CM larsnK If a mesh has been generated which contains side noded elementSy such as six noded. triangles^ setting a paraneter on. a CURVE automatically sets the^side nodes on any side which is along the CURVE. • A. REGION is simply a closed curve.. like a CURVE. but represents. nected region.. a two dimensional simply con-. Setting a parameter on. each finite element contained. a REGION means that. in the REGION. assigned, rather than any node. lowed. It is referenced. has the value. Several operations are al-. on REGIONSy such as generating. internal nodes for a. REGION, meshing a REGION with finite elements, and emitting a REGION from a finite element mesh. Generally, a REGION is defined in terms of CURVES and NODES,to. represent the region upon. which the differential. equation (s) are to be solved, or to provide a specification of a. subsection of that region on which. a particular pro-. perty is to be set. NODES are collections of points (like CURVES) but with no order implied. for a. For. instance, a list of. particular REGION, or. internal nodes. a list of nodes upon. certain boundary condition is to be set.. which a. NODES are usually. defined explicitly as an intermediate step in defining both CURVES and REGIONS. Ttiey allow easy alteration of the shape of a REGION when the REGION is defined. indirectly in terms. of them. Parameters are simply naned with the. solution program.. lists of. numbers for use. By issuing the appropriate su-.

(28) 23 pervisoc calls, the solution program may access ai^ list of data which. has been set. by the user.. In addition, para-. meters may be set by the solution program using the FPSPUT supervisor call. back. This enables solution values to be passed. to the system, where ttie user can exanine them or use. the PLOT command to draw contour maps or vector plots. 3.3. Supervisor Calls The function of the FEHPCL system is to provide a sol-. ution program. with finite element data input and output in. a standardized form.. This is done by allowing the solution. program to issue si^}ervisor calls to the system.. These are. coded as FORTRAN call statanents, or in the case of FPSPMS, as a FORTRAN. functioi call.. Among the SVCs available are. the following: FPSTOP. return to FEHPOL system. FPELCY. fetch element connectivity. 'FE^CDS. fetch nodal coordinates. PPNPMS. fetch mesh statistics. FPTITL. fetch job title. FPSPMS. fetch a solution parameter. FP(gRy FPSPUT. '. fetch solution parameter statistics return a parameter to the system. Under FEHPOL's supervision , the. solution program needs to. concern itself only with assembling and solving a system of equations acoording to a given differential equation. Ihe formait of a call to FPSTOP is as follows: GKL where I is a oode denoting the terminatiw status.. If I is. zero, the FEHPGL system is returned to normally. Otherwise, an ABORT message is printed on the. REPLY device giving the.

(29) 24 code I to reference the error or illegal condition. Effectively, FPSIOP is the FEHPOL equivalent of the PDRTRAN STOP statement, which returns to the user's operating system. The call to FPELCY is of the following form: CALL fPmCYOCOM,!) where lOOK is an array into which the. element connectivity. of the Ith element is passed. The service routine FPNCDS is called as follows:. In this case, M. is the sequence number of the finite ele-. ment nodes. H is returned the Mth The. as the optimized node number of. node and X and Y are the coordinates of that node.. routine is written this way to provide convenient al-. teration of existing programs for running under. the FEHPOL. system. FPNPMS passes to the of a finite element mesh.. solution program the statistics The call is:. CALL where: = nunber of elements * • = nunber of corner nodes (non-side nodes) = number of nodes total M Y H L = maximum number of nodes per element IBAKD = semi-bandwidth The call to EPTITL has the following form; C M L FAnL(A) where A is an array that can contain seventy two characters. The job title string. specified in the K ™. passed to the solution program with this call.. statement is This can be. useful particularly when running the system in batch mode..

(30) 25 The call to FPSPMS is coded as a FORTRAN. function call. A. exanple of the call is:. here, ieWB-HEICar is the name of a FEHPCL parameter.. It may be. either a global, elemental, or nodal parameter.. If HON is posi-. tive, _ the. parameter on the. function. B O & h element or node.. returns the value of that. If num is negative, the function returns. the value of MBB-EEEOaP on it was actually set.. the NONth node or element. Accessing the value. on \Aich. of a paraneter on an. element or at a node on which it was not set causes the value to be returned undefined (-1111.0). In addition, I R A G is returned nonzero in this case or in the event of any irregular condition. The meaning of the values of I FLAG are as follows: ifWG. Meaning. 1. the parameter was never defined. 2. M M is too negative (not that many nodes or elements had the value set). 3. mgJM is too positive (greater than the length of the list). 4. the parameter is not defined at the specified node or element. FP(gRy is similar in form to FPSPMS.. It is called. in the. following manner: QUA, In this. supervisor call, if M equals -1 the number. of nodes or. elements at which the parameter named PMRAI5-C23 was set is returned in N.. If # is positive, the node nundaer (or element num-. ber) of the Mkh set value of the parameter is returned in OL. If. the parameter was not defined, M is returned equal to zero. This is used for finding parameter statistics before accessing them..

(31) 26 For instance, the loop in a solution program to consider the nodal boundary condition 0-9BL might look like: CALL P P Q P R r ( 5 B 0 - * g L , 5 g - l , E a m C ). DO IB uyEmc(n=msHG(5aHmL,5,-iMm3. Itie FPSPUT supervisor call. returns ccmputed data. solution program to the FEHPCL data. structure.. from the. It is coded as. followsI O&L nhis defines a new FEHPOL parameter named. Wiich consists of. the first M M elements of the POKFRAN array aRHMT. to pass back the solution of a. simple scalar. For example,. potential problem. the call might look like: O I L EBSPar(aB90BomM,8,am^,BSi) where ESI is the solution vector.. By issuing a MOT ccxmand to. the system which referenced this parameter a contour plot of the solution could then be produced. 3.4. The Symbol Bool The single most important design feature of. the symbol pool.. This is a two-way table. the system is. which contains names. of CURVES, REGIONS, NCDEs, and parameters, together with indices and the actual data they represent. Each definition builds each end of the. table toward the other until the pool. is full.. In. this way storage is used most efficiently and the system size is easily altered. %e variable.. basic cell in the pool. structure is one FORTRAN. real. The system, however, allocates space and accesses in-. formation in a way that is independent of the local hardware and FORTRAN compiler. The system calculates the nimber of characters.

(32) 27. The Pool Structure. hame of Symbol L Sp&ce. of i»sfc 4-. isame oj ^^Vnbot. 2-. lekig-tk. of lo+ 2. # * #. L;st ef da+a C^) iK reucrseorder. List (il. (fvavne. oj ^^w>bol ft len^-tU 0-5 list" K List (n-. Free LtSi- (jL). Space.. Figure 3.

(33) 28. that (me real variable can hold on the local computer and calculates the pool entry size requiranents based on this. 3.5. Machine Independence Several other system features require hardware and compiler. independent packing and storage of character data.. The assembly. language routines CDMP and COPt are used to make up for the lack of character manipulation in FORTRAN. With these exceptions and also the coding of the lowest level plotting routines which are device dependent, the system is written entirely in ANSI FORTRAN IV..

(34) CHAPTER 4. FEHPOL AIGORITHMS.

(35) 30 4.1. Some FEHPQL Algorithms While many algorithms used in the system are tailored spec-. ifically to the system's data structure and syntactical analysis schemef several of the algorithms have quite general stand-alone applicability.. In particular, four original algorithms. are of. practical import. Probably the mogt important of these is the triangular mesh generation. algorithm, which. other algorithms.. is simpler and more efficient than. A rather trivial,. generates side noded element. but useful algorithm which. connectivity from three noded con-. nectivity while preserving optimal node numbering is given.. In. addition, an internal node generation algorithm which uses boundary node density to determine local internal node density, thus requiring only a boundary specification is discussed.. Lastly, a. general purpose contour plotting algorithm which uses the. shape. function of the finite elements rather than rectangular interpolation to locate and plot contours is described.. 4.2. The Triarygular Mesh Generation Algorithm Although several algorithms are available for generatim of. triangular finijte element, meshes on given regions, notably the 11 mcx3ified Suhara-Fukudu algorithm and the method of isoparametric 12 coordinates, the necessity of representing the typically irregularly shaped regions associated with coastal and estuarial problems and the demand for fast interactive response time. required. a more flexible and less time-consuming algorithm. Itie method of isoparametric. coordinates, although quite useful when, genei^tl^. a mesh oiravregularly shaped region, becMaes less attfaetive when applied to practical'probliems involving Irregular boundaries (for Instajice, Example ll), because of the amount of user specified zoning which must take place..

(36) 31 % e use of the modified Suhara-Pukudu algorithm was decided against based on the. author's opinion. complicated and time consuming.. that it is unnecessarily. The algorithm requires a large. amount of checking to see if a potential element overlaps a previously generated element or.boundary side.. By choosing a bet-. ter suitability criterion, the* over lap check may be avoided completely, and the boundary check. limited to the most suitable of. potential elements. In addition, the use of a push-down stack to save the unconnected triangles' sides in most likely order seems more efficient than picking a side from previous elements. In choosing a suitability criterion for triangular elements one may consider the following problem:. Given any two of several points as a baseline, and a side on which to seek one of the other points to form a triangle, what is the locus of points of equal suitability such that the same connections result when approached from any direction? For instance, consider the points A,B,C, ard D:. If M. is the baseline and D is more suitable than C, we want the. point A to be more suitable than C when the baseline is BD.. If. this is the case, we can avoid checking to see if the most suitable triangle with baseline. crosses element AH).. Since with-. out this criterion every element must be checked for overlap, it is a substantial timesaver indeed..

(37) 32 The locus of points equally element with sector of M. suitable to form a. must be symmetric about the. triangular. perpendicular bi-. since the specification of A and B is orderless. In. like fashion, the locus of points of equal suitability for BD is symmetric about its own perpendicular points equally suitable for suitable for ^. bisector. If the locus of. is different. fran those. then' it is possible to pick a point. two loci such that one of the two baselines will or D.. Therefore, they are the same locus.. equally. between the. prefer it to A. Being the same locus. and syimietric about two arbitrary lines, the locus is a circle. Therefore, the most suitable triangulation is considered to be the one which, when circumscribed by a circle, the the circle is farthest behind the baseline.. centre of. That is to say, the. signed distance CD is a minimum (see Figure 4). (less suitable than T). (most suitable). Figure 4 If any n nodes are found to lie on the circle. defining the. most suitable triangulation, they are all triangulized in righthand order since any triangulation combinations would be equally satisfactory. page.. A flowchart of the algorithm is given on the next ''.

(38) c c c c c c c c c. c c c c c c c c. c.. c c c c c c c. c c c c c c .c. c c c c c c c c c c c c c. 33 FLOWCHART OF TRIANGULAR MESH ALGORITHM ***#*#*#************* # * PICK BASELINE I - J * * ON THE BOUNDARY AND * * POINT N BEHIND I T . * *********************** *. ***********:*>* ^ V **************%******** * FIND N S ( M ) , M " 1 , I R * * EQUALLY MOST S U I T * * ABLE FOR I - J ON S I D E * * O P P O S I T E N AND NOT * * CROSSING ANY BOUND- * * ARY * *********************** * V *********************** * REORDER N S ( M ) TO * * PIVOT ON J * ***********************. c. c c c c c. Figure 5. * V *********************** * FOR M = 1 » I R * * * , A D D ELEM I - J - N S ( M ) * * STACK S I D E I - N S ( M ) * * WITH BEHIND NODE J * * N « I , I»NS(M) * *********************** '. *. V * *. IS * ' I-J A * BOUNDARY S E G * MENT? * * * *. *. *. e. c c c c c c c. GENERATION. *. *. * N V * * IS * * I - J IN * TWO ELEMENTS? *. *. *. * * * *. Y **** f * * * * * Y * ****. ************ * V * * * * *. * I S THE STACK EMPTY? * * * *. * *. Y *** * V DONE —. V *********************** * G&T I , J , N O F F STACK * ** * T *O * *P * *AND * * * *DECREMENT * * * * * * * * * * * **. * * V * * * * * * * * * * * * ******************************.

(39) 34 ]q9--3^^_]g7 3G3j33 343384/ \ 3923C?3%3j!%;aa 3W\ I /I 37037337^333. -'?®¥ 361'. .359. Joo/ 312^^^310'/ . . __. 324 333 331 _,34T ;f_in 7 315 300f L//"^ \ yS 33? 3^ #8 ;e4 28%(281 298/ 302-284-280-282-287''^ / \ /\ / :%» 294 283 270 271 / \/ \/ 3^—293—291 27^^^ 3^^ /27527LU6I 'iy'-'26f\ 23$4g41.227 226 -215 "214-238 -207-] 98-197^ ' /\ /\ / \_ I\1M 187 2,:\ i M5 ISA 22223 224 211 212 2C \1.gc / 202 19\^19%85 -194— ' I f 2/3 ^3:2^^-221 "210" 1 2g-7. \ t > o,-, i->a255252 '244~ 242-^23"5 0-.228~ "< F - ' f r m. :w ^. 218~. anjAlBER (}F Eajf]%EBITB= BRJMOaER C)F CKlRlOEIt I>15)= BKJMU3ER (DE" tK]D]S&=. 167.. s. ,166. ycyjr 'ipf. , - 128 / , , MS .W3 I M7\/ I \ ^1/ 102 iPi i04]0aif:i: 133 '<l "140—142-^64 \l 125't' 129. Example 3. B3T /ji34 /' JIC "35 05J dl. -OJl.

(40) 35. ^001. 061—049—047—037—031 0 /Ae I 060 0^ 067 0 5 9 \ /J345. "066 056. I. 4 0Ufr'. 03^. 1:1. 033. 023—021—011—000. ^3 34 02^/ \ / 024. ^6^ /. )14 014. \. j 010 r -. 003. 001. 006. 002. \. . 0 0 5 — 0[0 4. /. 0i5_013_0 .028 \ / 7 6 050 040 038 I / 064 ^ 057 A5 f \ v ' / \ 027 016 015 007 008 WSl 042 039 030 \ y 117—019—02 06^ I 054 I 053——043 I 041^—03]^^"02O 01^^—0i7"^"019"""020. 1/. Example 4. I.

(41) 36 4.3. Algorithm to Generate Side Noded Connectivity By renumbering. the finite element nodes associated. with a. particular finite element mesh, the original sparse matrix equation forming the model may be converted to a banded matrix equation, which allows smaller computer. storage requirements.. The. FEHPOL System uses an algorithm attributed to Collins (Ref. 11) to perform node renumbering for bandwidth minimization. than feeding the. algorithm side noded. Rather. connectivity on which it. would operate very inefficiently, an algorithm was developed for producing side noded connectivity from corner point connectivity while preserving the optimization of the numbering scheme.. The. algorithm is especially useful when used in conjunction with the Collins routine since the tables he sets up can be used. A flow chart of the algorithm is given on the next page and an. example. of its use is in Example 4.. 4.4 » .The Internal Node Generation Algorithm When modelling problems in continuous media it is often unnecessary to precisely locate each internal node. shaped regions. (such as simple polygons). internal nodes may be. generated using* curvilinear coordinate mapping. irregular regions associated with coastal a more. For regularly. For the highly. engineering problems,. general yet equally automatic method is needed to. gene-. rate internal nodes which reflect the local boundary density. An algorithm has been developed which is used in the FEHPOL. System. for this purpose. Consider a simply connected finite. element nodes.. ( with. coordinates. polygon vAiose n vertices. The linear node. are. density at the ith node. ) may be expressed as follows:.

(42) c. ALGORITHM TO GENERATE SIDE NODED CONNECTIVITY. J. **********************. 37. C C C c C C C G C C G C G C C G G G C G G G G C C C C C C C. * BANDWIDTH=0,NUM=0 * ********************** V *************************************************** * FOR L=1 TO NUMBER OF CORNER P O I N T S * * ********************** * * * F I N D NODE L * * * ********************** * * V . * * * K * * * 0 * * * * NODES * Y * * * CONNECTED * * * * * * * * * * * * * * * * * * * * * * > * * * TO L? * * * * * * * * N * * V * * ********************* * * * KKK-NUM-NUM+1 G I V E * * * * L NEW NUMBER=NUM * * * ********************* * * V * * ******************************************* * * * FOR J = 1 TO NUMB. OF NODES CONNECTED TO L * * * * ********************* * * * * * M= NODE NUMBER OF * $ * * * * J T H NODE GONNEC* * * * * * TED TO NODE L * * * * * ********************* * * * * V * *. c. *. C C C C C G C C c C c C C "G C C C ~ C C G G CG. '*. *. * *. * * * * * * * * * * Y * * * * * M < L? *******************>* * * * ' * * $ * * * * * * * * * * * * * * ' "V * * * * ********************************** * * * * * FOR K= 1,NUMBER OF N O D E S / S I D E * * * * * * ********************* * * * * * * * NUM=NUM+I ADD S I D E * * * * * * * * NODE ON S I D E L-M * * * * * * * * GIVE IT NEW NUMB- * * * * * * * * ER=NUM * * * * * * * * BANDWIDTH-NUM-KKK * * * * * * *, * +1 I F GREATER THAN* * * * * * * * OLD BANDWIDTH * * * * * * * ********************* * * * * * ********************************** * * * ******************************************* * *************************************************** DONE on «. Figure ^.

(43) REGION 1 » 1 1 , 8 ] # 3 2 , 3 3 , 3 3 , 2 3 , 3 2 , l l S Q U A R £ LET 2 , 2 « I N T E R N A L NODE FOR SQUARE MESH SQUARE WITH THREE NODED TRIANGLES. 38. 4 •. THREE NODED MESH DATA. *. WRITE C O N N E C T I V I T Y CONNECTIVITY TABLE I 1 4 7. 3 8 2. 1 4 5. 2 7 3. NODAL COORDINATES. 1. 4 5 ^ 6. 2 5 8. 1.0000. •Xg COORD. MESH SQUARE WITH S I X * * *. 3 3 2. 7 9. 3 6. 4 7. 3 5. Y-COORD. 1.0000. 4. 2.0000 1.0000. 6. 3.0000. 5. 1 .0000. 2. 2.0000 2.0000 3.0000 2.0000 2.0000 3.0000 3.0000, 3.40QQ NUMBER OF ELEMENTS" NUMBER OF CORNER P T S ' NUMBER OF NODES= BANDWIDTH®. 3 5 7 9. 1 7 5. 1 .0000 2.0000. 1 .0000 3.0000. 8 $ 9 4. f O D E D TRIANGLES. S I X NODED MESH DATA GENERATED BY S I D E NODE GENERATION ALGORITHM ACTING ON THE ABOVE. *. WRITE CONNECTIVITY CONNECTIVITY TABLE* 9 21 16 5. 1 3 5 7. 1 13 21 16. 5 9 9 9. NODAL COORDINATES 1 3 5 7 9 11 13 15 17 K9 21 23 25. 3 14 17 ' 7. 2 10 11 12. 6 11 12 6. 13 24 25 20. 2 4 6 8. X-COORD. 1.0000 1.0000 1.5000 1 .5000 2.0000 1.0000 1 .5000 2.5000 2.0000 2.0000 2.0000 2.5000 1 .0000 2.0000 2.5000 1 .0000 2.5000 2.5000 1.5000 3.0008 3.0000 2.0000 3.0000 2.5000 3.0000 3.0000 NUMBER OF ELEMENTSNUMBER OF CORNER P T S = NUMBER OF NODES a BANDWIDTH-. 1 13 21 16. 9 21 16 5. 4 15 23 19. 3 14 17 7. 10 22 18 8. Y-COORD 2 4 6 8 10 12 14 16 18 20 22 24 8 9 25 15. Example ^. 1 .5000 1 .0000 2.0000 2.5000 1 .5000 2.5000 1.5000 3.0000 3.0000 3.0000 1 .5000 1.0000. 1 .0000 1 .5000 1 .5000 1.0000 2.0000 2.0000 2 .5000 2 . 0 000 2.5000 I .0000 3.0000 3.0000.

(44) 39. S i. where the node nimibef s are cyclic (ie. x ^ ^ = x ). A suitable way of making the density'^of. the internal nodes generated to reflect the local boundary density is:. -.-. -^. 2 ^ i=i jO. (XfY). 2 : (x-x^) +(y-yi). = n. i=i. since this is essentially'a normalized integral, weighted at the point x,y by the inverse square of the distance to the boundary. The algorithm divides the area into square cell whose sides have length equal to the average boundary segment length.. Ihen. it calculates the value of the density function at the centre of each of the ceils.. Ihe value times the area of^ the cell gives. the gg^roximate number of nodes to place in that cell.. To vary. the total nimber of nodes in the region but reflect the boundary density a scale factor magr Tie set by the user lAich scales the 'number of nodes per cell lief ere converting to fixed point..

(45) 40 Once the number has been determined the nodes are placed in the cell in the. following manner.. the centre of the cell. The first node is placed at. and subsequent nodes (i=2,n) are placed. on a circle of diameter two thirds the width of the cell centred at the first node at an angle from an arbitrarily picked base of 2. i.. For instance, if there are to be three nodes in a cell, the. first node. is placed at the centre of the cell, the second node. is placed at four radians past the base angle, and the placed at nine radians past the base angle.. third is. This ensures sparse. distribution and, since the number of nodes in a practical prob13 lem for each cell ranges in the small whole numbers, acceptable finite elements.. relatively. Once a finite element mesh is gene-. rated, it is possible to smooth the mesh very easily by locating each generated. node at the average position of itself and nodes. connected to it. This algorithm has proven to provide a reasonable. internal. node distributim with a minimum of computation and without user specified zoning or local density values.. As such it is ideally. suited to use in the FEHPCL System, although probably not flexible enough to be very attractive for stand alone use.. In Figure. 5- an example of' the use of the algorithm is given showing a mesh whose internal nodes were generated using it. 4.5. The Contour Plotting Algorithm To help display the solution values generated by a particu-. cular finite Aement running plotting. under the FEHPCL System, a contour. algortithm was developed which uses the shape function. of the element, rather than. finite difference interpolation, to. locate and draw contour lines.. The algorithm works for any ele-. ment type and for any number of contour levels..

(46) The Boundary. /\EEf 679-.ei. 106.. •ea6 10 10. .0g)-^5^^49 / \ ! / \ 0^6 - '" 05. .099^/ M2. /. // %. (/. \. / \. Z\/KK. Generated Internal Nodes Example £. -ezi.

(47) 42 The routine is table driven, that is to say, it uses a subconnectivity table, a table of sub-nodal coordinates (in homoge14 nous form), and a table of shape functions for the various types of finite elements.. By using these tables, drawing the contours. for any element type can be reduced to drawing contours on several linear, triangular finite elements.. The values of the state. variables being plotted are calculated at each sub-node in every element.. Ihe coordinates of. the sub-nodes are. calculated from. the coordinates of the elements nodes and the homogenous coordinate table. Once these values are. available it is a triviality. to generate straight line contours on each sub-element. flowchart of the algorithm's. Both a. logic, and a listing of the FEHPOL. implementation are given in the next few pages.. Figure 7.

(48) c c c c c c c c c •c c c c c c c c c c c c c c c c c c c c c c c -c c c c c c c c c c c c c. 43 ALGORITHM TO PLOT CONTOURS ON F I N I T E ELEMENT REGION 1^5 IW3 THE SHAPE FUNCTION O P TIWE ELEMENTS. DO FOR EVERY F I N I T E ELEMENT. DO FOR EVERY CONTOUR LEVEL. *#**************************************** DO FOR NUMBER OF S U B N O D E S / E L E f E N T *. *****************************#* * F I N D X , Y COORDINATES O F THE * * SUBNODES US ING THE T A B L E OF * * HOMOGENOUS COORDINATES * ****************(*****;******** *. V * F I N D THE VALUE OF THE F U N C - * * T I O N AT EACH SUBNODE U S I N G * * T f g SHAPE FUNCTION FOR T H I S * * TYPE OF ELEMENT *. ********************************#****** *. V. *l#*********!**********#*************** **** DO FOR NUMBER OF S U B - E L E M E N T S / E L E M E N T. # , C A L L L I W A R THREE NODE T R I - * * ANGLE CONTOUR PLOTTING R O U - * * T I N E FOR THE ITH S U B - E L E M E I f T * * U S I N G SUBCONNECTIVITY T A B L E *. * * * * * * * #. ****#*#*****************#*#***************. jC. c c c , c c c c c. * * * * * * * * * * * * * * *. * * * * * * * * * * * * * * * * * *. *. V DONE.

(49) FFGN2L Cnntiur Plot. Pi^re 9.

(50) 45 4.6. Smooth Interpolation Mhen trying to represent irregularly shaped. boundaries, it. can be extremely useful to be able to interpolate points along a smooth curve joining an existing set of points.. In graphical a-. nalysis; various sorts of function approximations are often used to define a smooth curve fitting a particular set of data points which, are known.. To perform curve manipulation in FEHPOL a more. general technique was used. Consider a set of n ordered points (x^,y^) through which we wish to approximate a smooth curve.. For linear interpolation we. use the hanogeneous coordinate t (usually without realizing it), to define interpolated points as follows:. x(t) = (t-i)x^+(l+i-t)x^^^. i<t<i+l. y(t) = (t-i)y^+(l+i-t)y^^^. i<t<i+l. ie.. x(3.5) = (3.5-3.0) x^+(1+3-3.5) x^= (x^+x^)/2. By consider ing. further points to determine the interpolation on. each segment a higher order intepolation is reached:. X ( t ) = f , x ^ ^ ^ ' ^ i + 2 i < t <i+l. Since x(i-l)=x. 1—X. X(t) = X ( t - i + 1 ) [ g ( X , x ^ , t ) ]. and since x(i)=Xj^,. (t) =Xi_l+ (t-i+l) [ (X^-Xj,_^) + (t-i)h. f. ^.

(51) 46 Carrying this to its logical conclusion:. x ( t ) = x ^ _ ^ + ( t + i - l ) * ( ^ ) + (t-i)*(((Xj^_^-2x^+Xj.^^)/2) + (t-i-1)*((-x^_2+3x^-3x^^^+x^^2)/6)) ). and. y (t) =y^_2+ (t+i-i) * ((y\-y\_i)+(t-i) * ( ( / 2 ) + (t-i-l)*((-y\_2+3%\-3y\^^+y\^2)/6))). The end segments present a slight difficulty, since neither Xg nor x ^ ^ is defined.. This is remedied (in the FEHPd, System). by defining xg=x^ and x ^ =x^ which simply straightens the curve slightly at the ends.. Since no shape information at the end may. be deduced from the original curve this is the logical choice. ntie interpolation types^ SMDCXIH and REGULAR, differ only in the relative density of distribution of the points. terpolation causes the new. REGULAR in-. nodes to be spread as evenly as pos-. sible among the old nodes, while SMOOTH interpolation creates an entirely new set of points whose density along the curve reflect the density of points along the original curve.. Examples 8 and. 9 show the two interpolation types operating on a curve. pendix B several more tion are given.. In Ap-. exanples of SMOOTH and REGULAR interpola-. This method produces extremely well conditioned. interpolations for sharp corners, multiply specified points, and *. curves which double back on themselves, as well..

(52) 47 CURVK 13,U 6,0 6,7 13,7 13,3 9,3 9,5 10,b iO,4:SriHAL SKT XMAX'2U,YMAA-8 PLOT SriKAL INTLnrCUVrK SPIRAL H0DEH=48,PRGULAR PLOT SPIRAL. E. n. Example 8.

(53) CtlWVK 13,0 6,W 6,7 1 3 ,7 13,3 9, 3 9, 5 10,5 lP,4:SriRAL SUT XMAX"2d,YMAX"Q PLOT SPIRAL INTERPOLATK S^IHAL .N0UES"48,SMOOTH PLOT SPIRAL. Example 9. 48.

(54) 49. 1. C C C. c c c. SUBROUTINE FPMESH(S1,S2,S3,AA,CY,NS,NR,X,Y,M1,M2,NC, NL,NB,NP). SEGMENT NAME S E G M E N T L E N G T H IN C A R D S D A T E OF L A S T A L T E R A T I O N N U M B E R OF L O C A L I N T E G E R S N U M B E R OF L O C A L R E A L S. FPMESH 126 21/07/76 l8 13. 'C. c c c c c c c c c c c c c c c c c c c c c c 'c c c c c c c c c c c c. c. .C. c c c c c c c c c'. c c c. FEHPOL. ROUTINES. FORTRAN OTHER. LIBRARY. LIBRARY. CALLED. ;. ROUTINES. ROUTINES. CALLING. ROUTINES. COMMONS. REFERENCED. FPSSOL. CALLED. SQRT ..lABS. CALLED. NONE FPCNCT NONE. REMARKS: THIS R O U T I N E P E R F O R M S THE C O N N E C T I O N OF A FINITE E L E M E N T M E S H G I V E N THE L O C A T I O N OF A L L THE NODES A N D I D E N T I F I C A T I O N OF T H E B O U N D A R Y N O D E S . ARGUMENTS: S 1 , S 2 , S 3 = W 0 R K A R E A F O R S T A C K S , L E N G T H A T L E A S T Ml A A z W O R K A R E A , L E N G T H AT L E A S T M2 N S = W O R K A R E A , L E N G T H AT L E A S T M2 N S , N R = W O R K A R E A S , LENGTH AT LEAST M 2 X,Y=NODE COORDINATES, DIMENSION NC M 1 = M A X I M U M N U M B E R OF E L E M E N T S A L L O W E D M 2 = M A X N U M B E R OF E Q U A L L Y A T T R A C T I V E C O N N E C T I O N S FOR ANY BASELINE. FOR A N Y R E A S O N A B L E M E S H M 2 = 2 0 N C , N L / N B = N U M OF CORNER POINTS, E L E M S , B O U N D A R I E S N P ( I ) = N U M B E R O F N O D E S ON T H E ITH B O U N D A R Y FLOWCHART. OF T R I A N G U L A R ALGORITHM ****************#****** * P I C K B A S E L I N E I-J * ON T H E B O U N D A R Y A N D * P O I N T N B E H I N D IT.. * * *. *********************** * **************. V ********************** * FIND NS(M),M=1,IR * EQUALLY MOST SUIT* A B L E F O R I - J ON S I D E * O PPOSITE M AND NOT * C ROSSING ANY BOUND*. ARY. MESH. GENERATION.

(55) (HM)dN+II=lI. aN'i=HM ozoi oa 1=11 0 = 11. , "ozi 01 OD 'S3% ai "iHvaNnoE v NO SI f-i ai ass * ******#***#**************************************** 'OOOOOOOOOOOOOl=NH 000L SE 0 1 0 0 '000000a000000l=NH. l=N I =r (l)dN=I. 0 = ON 0=dS (Z*#(L%-ZA)+Z**(lX-ZX))iKDS=(6l'ZX'ia'lX)Q (ZM)VV'(0N)I'(0N)X 1V3K (l)dN'(ZW)HN'(ZW)SN'(S6E'9)%0'(LW)ES'(LH)ZS'(lW)lS WaOaiNI. 0 0 0 0 D 0 0 0 D 0 0 0 0 0 0 0 0. A * . iNawaHoaa Q N V d O I * 30V1S jjO N f'l lao *. *. * *. A *. awoa. *. *. #. *. ****. &SINaH313 OMI *. A *. #. 6%ldM3. *. * I *. ***. 30VIS aHI SI * *. *. *. ,. *. A. *. N *. X. *. *. *. A *. #. *******. *. *. HI P - I SI *. *. * *. * *****. l. *. 61N3M. 0. *. -DBS IKVawnOB. *. V f-i *. SI. * *. *. A # ***********************. * * * f. ( H ) S N = I 'I=N f aaON Q N I H a B HIIM (M)SN-i a o i s 33VIS (H)SN-f-I Haia QQV. * * * *. * :yi'L=H yoj * *********************** A * ***********************. * f NO lOAIJ * * 01 ( W ) S N H a a H O S H * *********************** A *. OS. 3 0 0 0 0 0 0 D 0 0 0 0 0• D 0 0 D 0 0 0 0.

(56) 51. 1020. 40 35. 80. 314 313 C C. I F ( I L . G T . J ) G O TO 1020 I F ( I L . G T . I ) G O TO 1020 I F ( J . G T . I T ) G O TO 1 0 2 0 I F ( I . G T . I T ) G O TO 1 0 2 0 I F ( I A B S ( I - J ) . E Q . 1 ) G 0 TO 120 I F ( I A B S ( I - J ) . E Q . N P ( M M ) - 1 ) G 0 TO 1 2 0 IL=IT+1 NU = 0 DO 40 L = 1 , N G II=CY(1,L) JJ=CY(2,L) KK=CY(3,L) I F ( I . N E . I I . A N % . I . N E . J J . A N D . I . N E . K K ) G O TO 40 I F ( J . N E . I I . A N D / j % # E . J J . A N D . J . N E . K K ) G O TO 40 NU=NU+1 I F ( N U . G E . 2 ) G 0 TO 120 CONTINUE XI=X(I) XJ=X(J) XN=X(N) YI=Y(I) YJ=Y(J) YN=Y(N) DSQ=((XJ-XI)**2+(YJ-YI)**2)/4.0 DO 60 L = 1 , N C I F ( L . E Q . I ) G O TO 60 I F ( L . E Q . J ) G O TO 60 XL=X(L) YL=Y(L) IF(FPSSOL(XI,YI,XJ,YJ,XL,YL,XN,YN))80,80,60 CALL F P C N T R ( X I , Y I , X J , Y J , X L , Y L , X C , Y C , R S Q ) R=RSQ-DSQ IF(FPSS0L(XI,YI,XJ,YJ,XC,YC,XL,YL))314,314,313 R=-R I F ( R . G T . R N ) G # TO 60. * C H E C K TO S E E IF S E G M E N T * IF Y E S , GO TO 60 .. I-L. CROSSES. BOUNDARY.. * *. C IT = 0 IL= 1. 96 95. DO 1 0 3 0 M M = 1 , N B IT=IT+NP(MM) DO 95 N O = I L , I T N1=N0+1 IF(N0.EQ.IT)N1=IL I F ( N O . E Q . I ) G O TO 95 I F ( N O . E Q . L ) G O TO 95 I F ( N 1 . E Q . I ) G 0 TO 95 I F ( N 1 . E Q . L ) G 0 TO 95 IF(FPSSOL(XI,YI,XL,YL,X(N0),Y(N0),X(N1),Y(N1)))95,96,95 IF(FPSSOL(X(N0),Y(N0),X(N1),Y(N1),XI,YI,XL,YL))95,60,95 CONTINUE. C. ****#***********************«**,*******#********. C C. * C H E C K TO S E E IF S E G M E N T * IF Y E S , GO TO 60. C. **************************************#*********. J-L. CROSSES. BOUNDARY.. * *.

(57) 52 DO. 97 N O = I L , I T. N1=N0+1. .. 98 97 1030. 90. IF(N0.EQ.IT)N1=IL I F ( N O . E Q . J ) G O TO 97 I F ( N O . E Q . L ) G O TO 97 I F ( N 1 . E Q . J ) G 0 TO 97 I F ( N 1 . E Q . L ) G 0 TO 97 IF(FPSSOL(XJ,YJ,XL,YL,X(NO),Y(NO),X(N1),Y(N1)))97,98,97 IF(FPSSOL(X(N0),Y(N0),X(N1),Y(N1),XJ,YJ,XL,YL))97,60,97 CONTINUE IL=IT+1 I F ( R . L T . R N ) G O TO 90 IR=IR+1 NS(IR)=L GO TO 60 CONTINUE RN = R. IR= 1 60. 30. 20 25. NS(IR)=L CONTINUE I F ( I R . G T . M 2 ) G 0 TO 9 2 0 DO 30 I I = 1 , I R IO=NS(II) AA(II)=D(XJ,YJ,X(IO),Y(IO))-D(XI,YI,X(IO),Y(IO)) DO 25 I I = 1 , I R 10 = 0 DO 2 0 J J = 1 , I R IF(AA(JJ).GE.AA(II))I0=I0+1 CONTINUE NR(IO)=NS(II) DO J O I I = 1 , I R NG=NG+1 SP=SP+1 S1(SP)=I S2(SP)=NR(II) S3(SP)=J. C. *****#*********************************************#*. C. *. ADD. NEW. ELEMENT. I - J - N R ( I I ) TO. CONNECTIVITY. TABLE. *. CY(1,NG)=I CY(2,NG)=J CY(3,NG)=NR(II) N=I 10 I = N R ( I I ) GO TO 1 0 0 0. C. *****************************************************. C. *. UNSTACK. BASELINE. AND. C 120. I=S1(SP) J=S2(SP) N=S3(SP) SP=SP-1 IF(SP)920,1000,1000 920 NL=NG RETURN END. BEHIND. NODE. (I,J) AND. (N). *.

(58) « *. «. «. ». #. « » « « « « «. *. ». *. «. *. «. ». «. «. «. c. «. « « « « «. * *. c « « » « « * * *. « « « *. » SIHX HOj NOIiONna a d V H S SHX « « oNisn a a o N a n s H o v a x v n o i x « « -oNfii 3 H X a o a m v A a H x o N i a # #*****##*#****#**##************ A a****************************** • saxvNianooo snoNaoowoH « « ao a i H v x aHx O N i s n s a a o N a n s « « aHX ao s a x v N i a a o o D I'x ONia * *******************************. *. « «. *. *. ». *. X. a******************************************. xNawaia/saaoNans. ao. aaawnN. 0 0. * * * * * * * * * * * * * *. Hoa. oa. 0 o D D 0 0 0 0. 0 0. 0. «. *. *. *. «. laAai. Hno-LNOO. inaAa. Hoa. oa. * '. *************************************************. x N a w a i a a x i N i a j^aaAa a o a o a ******************************************************. NoioaH. sxNswaia XNawaia. anx ao axiNia. N o i x o w n a a d V H S anx ONisn s a n o x N O o x o i d ox w h x i h o o i v. no. •(SH3HX0 s N i o f X N a w a i a nv n i x N a w a i a - a n s H O v a h o i h h xv s x N i o d a n x s i x v h x ) s a a o N - a n s aHX ao H O v a xv a a x x o i d o N i a a a a x a w v a v a anx ao s a m v A aHX o N i a ox X N a w a i a aHX ao N o i x o N n a a d V H S 3 H X s a s n XI ' W H o a a a d nvo E d N O d a hoihm O N i x x o i d X N a w a i a h v t i i o n v i h x a v a N i i t v h 3 A 3 s ox w a n x a o o N i x x o T d a n o x N O D 3HX 3 D n a 3 H ox S X N 3 M 3 1 3 a a o a o H 3 H D I H a o i x i A i x o a N N O o a n s 3HX s a s n a N i x n o a s i h X ' :saavwaa vaavsw swvavd. aaoN3aaaaa. xsidda. saNixnoa. snowwoo O N m v o. 0 D 0 0 0 0 0 D D. 0. 0 D 0. '. 0. 0 0 D 0 0 0 0 0 0 0 0 0 0 D D D. 0 awoN 3N0N EdNDda doxsda 9 El 92/10/Lz tiOL aNixnoaans TdNDda. aaiiVD aanvD. sawixnoa. xavaan. saNixnoa'lavaan. '•'•••;aanvD. saNixnoa. aanxo. Nvaxaoa lodnaa. s i v a a T v o o T ao a 3 a w n N s a a o a x N i i v o o i ao a a a w n N N o i x v a a x T v x s v T ao a x v a saavo n i nxoNai xNawoas adix x n 3 w d 3 S 3WVN xNawoas. (xoni'AaiwnN'AaiNOO)idNOda aNixnoaans ES. 3 0 0 0 0• 0 D 0 0 0 0 D.

(59) 54. C C C C C C C • C C. c c c c c c c c c c c c c c c c c c c-. # # * # * « « » » * « » » « ». *. TYPE. OF. ELEMENT. •. *. *. *. *. # #*#*#****###*#*****#***#***##***##*#*. * #. ******###*##***##*#***#*##*#***. ». *. *. V. *. *#**#*#**##*#*#*###**#*****##****#*****#***. «. *. *. DO. FOR. NUMBER. OF , S U B - E L E M E N T S / E L E M E N T. ». # * # * * * * * ^ * * * * * * * * * * * * * * # * * * * * # * * *. * CALL LINEAR THREE NODE TRI- * * ANGLE CONTOUR PLOTTING ROU- • * T I N E FOR THE ITH S U B - E L E M E N T * * USING SUBCONNECTIVITY TABLE * **#*#**********#*************#*. * > * *. * *. » » » * * * *. » » » * « #. a***********************************************. *. *. * - ^ # s******************************************. a***************************************************** #. V DONE. REAL C O N L E V ( N U M L E V ) , F ( 1 ) , X X ( 1 5 ) , Y Y ( 1 5 ) , F F ( 1 5 ) INTEGER C0N6NT(3,16) REAL H 6 N T ( 3 , 1 5 ) INTEGER CY(6,395),NT(395),JM(395),MJ(3950),BW,TN REAL X ( 3 0 0 ) , Y ( 3 0 0 ) INTEGER SI,DP,RP,SV(9),DA,CR,PS,PT,CN,SK,TC REAL P L ( 1 5 0 0 ) , L N ( 2 0 ) COMMON/WKAREA/PL,KS,KP,LS,LP,LN,IP,TM,SK,TC COMMON/PARAMS/SI,DP,RP,LO,SV,DA,CR,PS,PT,CN,NE •C0MM0N/MSAR6A/CY,NT,VM,X,Y,MJ,IE,NN,NC,NL,BW,NB,TN,NP(9) EQUIVALENCE (Y(300),F(1)) / 1 , 7, 12/ D A T A C 0 N 6 N T ( 1 , 1), C 0 N 6 N T ( 2 , 1 ) , C O N 6 N T ( 3 , 1 ) C 0 N 6 N T ( 1 , 2 ) ,C O N 6 N T ( 2 , 2 ) , C 0 N 6 N T ( 3 , 2 ) 1 / 7, 12, 13/ C 0 N 6 N T ( 1 , 3 ) ,C 0 N 6 N T ( 2 , 3 ) , C O N 6 N T ( 3 , 3 ) 2 / 1 3 , 12 , 6/ / 6, 13, 1 5/ C 0 N 6 N T ( 1 , 4), C 0 N 6 N T ( 2 , 4 ) , C 0 N 6 N T ( 3 , 4 ) 3 /I 5, 1 1 , 6/ 4 C 0 N 6 N T ( 1 , 5 ) ,C 0 N 6 N T ( 2 , 5 ) , C 0 N 6 N T ( 3 , 5 ) / I I , 15, 10/ C 0 N 6 N T ( 1 , 6 ) ,C 0 N 6 N T ( 2 , 6 ) , C 0 N 6 N T ( 3 , 6 ) 5 / 1 0 , 3, 1 1/ 6 C 0 N 6 N T ( 1 , 7 ) ,C 0 N 6 N T ( 2 , 7 ) , C 0 N 6 N T ( 3 , 7 ) / 5, 1 0 ,1 5/ C 0 N 5 N T ( 1 , 8), C 0 N 6 N T ( 2 , 8 ) , C 0 N 6 N T ( 3 , 8 ) 7 / 5, 15, 14/ .8 C 0 N 6 N T ( 1 , 9 ) ,C O N 6 N T ( 2 , 9 ) , C O N 6 N T ( 3 , 9 ) / 1 4 , 15, 13/ C 0 N 6 N T ( 1 , 10) , C 0 N 6 N T ( 2 , 1 0 ) , C O N 6 N T ( 3 , 10) 9 / 1 3 , 1 4 , 4/ C 0 N 6 N T ( 1 , 11) , C 0 N 6 N T ( 2 , 1 1 ) , C O N 6 N T ( 3 , 11) 1 / 4, 13, 7/ C 0 N 6 N T ( 1 , 12) , C 0 N 6 N T ( 2 , 1 2 ) , C 0 N 6 N T ( 3 , 1 2 ) 2 / 4, 8, 14/ C 0 N 6 N T ( 1 , 13) , C 0 N 6 N T ( 2 , 1 3 ) , C O N 6 N T ( 3 , 1 3 ) 3 / 1 4 , 8, 9/ C 0 N 6 N T ( 1 , 14) , C O N 6 N T ( 2 , 1 4 ) , C O N 6 N T ( 3 , 1 4 ) 4 / 9, 1 4 , 5/ C 0 N 6 N T ( 1 , 15) , C O N 6 N T ( 2 , 1 5 ) , C 0 N 6 N T ( 3 , 1 5 ) 5 / 2, 8, 9/ 6 C 0 N 6 N T ( 1 , 16) , C 0 N 6 N T ( 2 , 1 6 ) , C O N 6 N T ( 3 , 16) / 1 .0 , 0 . 0 , 0 . 0/ DATA H 6 N T ( 1 , 1 ) , H 6 N T ( 2 , 1 ) , H 6 N T ( 3 , 1 ) / O . 0 , 1 . 0 , 0 . 0/ H6NT(1,2) ,H6NT(2,2),H6NT(3,2) 1,.

(60) 55. /O. H 6 N T ( 1 3) H 6 N T ( 2 , 3 ) , H 6 N T ( 3 , 3 ) 2, H 6 N T ( 1 4) H 6 N T ( 2 , 4 ) , H 6 N T ( 3 , 4 ) /O. 3, /O. H6NT(1 5) H 6 N T ( 2 , 5 ) , H 6 N T ( 3 , 5 ) 4, /o. H6NT(1 6) H 6 N T ( 2 , 6 ) , H 6 N T ( 3 , 6 ) 5, /o. H6NT(1 7) H 6 N T ( 2 , 7 ) , H 6 N T ( 3 , 7 ) 6, /o. H6NT(1 8) H 6 N T ( 2 , 8 ) , H 6 N T ( 3 , 8 ) 7, /o. 8, H6NT(1 9) H 6 N T ( 2 , 9 ) , H 6 N T ( 3 , 9 ) /o. H 6 N T ( 1 10 , H 6 N T ( 2 , 1 0 ) , H 6 N T ( 3 , 1 0 ) 9, /o. H 6 N T ( 1 1 1 ,H6NT(2,-1 1 ) , H 6 N T ( 3, 1 1 ) 1, /o. H 6 N T ( 1 12 , H 6 N T ( 2 , 1 ^ ) , H 6 N T ( 3 , 1 2 ) 2, /o. H 6 N T ( 1 13 , H 6 N T ( 2 , 1 3 ) , H 6 N T ( 3 , 1 3 ) 3, /o. H 6 N T ( 1 14 ,"H6NT(2, 1 4 ) , H 6 N T ( 3 , 1 4 ) 4, /o. H 6 N T ( 1 15 , H 6 N T ( 2 , 1 5 ) , H 6 N T ( 3 , 1 5 ) 5, PHI6NT(EL1,EL2,EL3)= F(11)*EL1 *(2. 0*EL1-1 F(JJ)*EL2*(2. 0*EL2-1 1 F(KK)*EL3*(2. 0*EL3-1 2 3 4 5. 0 , 0 . 0,1 0/ 5 , 0 . 5 , 0 0/ 0 , 0 . 5 , 0 5/ 5 , 0 . 0 , 0 5/ 75 , 0.25 0 . 0/ 2 5 , P . 75 0 . 0/ 0 , 0 . 75, 0 .25/ 0 , 0 . 25, 0 .75/ 2 5 , 0 . 0, 0 . 7 5 / 7 5 , 0 .0, 0 . 2 5 / 5,0. 25, 0 . 2 5 / 2 5 , 0 .5, 0 . 2 5 / 2 5 , 0 . 25 0 . 5/ . 0) + . 0) +. . 0) +. F(IJ)»4.0*EL1*EL2+ F(JK)*4.0*EL2*EL3+. F(KI)*4.0*EL3*EL1. DO 10 1 = 1 , N N 10 . F ( I ) = P L ( P T - I N D X - I ) DO 2 0 1 = 1 , N L II=CY(1,I) JJ=CY(2,I) KK=CY(3,I) LL=CY(4,I) IJ = LL JK=CY(5,I) KI=CY(6,I) DO 30 J = 1 , N U M L E V C=CDNLEV(J) G O TO ( 1 0 0 , 1 0 0 , 3 0 0 , 1 0 0 , 1 0 0 , 6 0 0 , 1 0 0 ) , I E 100 C A L L F P S T 0 P ( 5 3 ) 300 CALL F P C N P 3 ( X , Y , F , I I , J J , K K , C ) G O TO 3 0 6 0 0 DO 40 K = 1 , 1 5 XX(K)=X(II)»H6NT(1,K)+X(JJ)»H6NT(2,K)+X(KK) *H6NT(3,K) Y Y ( K ) = Y ( I I ) » H 6 N T ( 1 ,K-)+Y( J J ) » H 6 N T ( 2 , K ) + Y ( K K ) * H 6 N T ( 3 , K ) 40'FF(K)=P6NT(H6NT(1,K),H6NT(2,K),H6NT(3,K)) DO 6 1 0 K = 1 , 1 6 III=C0N6NT(1,K) JJJ=C0N6NT(2,K) KKK=CON6NT(3,K) 610 CALL F P C N P 3 ( X X , Y Y , F F , I I I , J J J , K K K , C ) G O TO 3 0 30 C O N T I N U E 20 C O N T I N U E RETURN END.

(61) CHAPTER 5. EXAMPLES. •,. •.

(62) 56 5.1. FEHPOL Solution Programs The FEHPCL system supervises finite element programs.. solution programs are essentially. The. 'black boxes' which represent. given partial differential equations.. The system inputs finite. elanent mesh descriptions, boundary conditions, and constants to the solution program and it returns the values of various. state. variables at finite element nodes. While several solution programs may be combined or run under the PEHPQL system in parallel, the orientation towards miniconputer environments makes the supervision of a single solution program the most likely configuration.. In practice, solution programs are overlayed over part of. the FEHPOL system. At presait, two existing. finite element solution. have been modified to run under the system.. programs. Their solution cap-. abilities include: 15 1. DISPERSION EQUATION SOLUTION PROGRAM a) Tran^)ort or Heat Transfer Equation for One Vari^le (Time Independent) " b) Perfect Flow, Potential Formulation (T.I.) c) Confined Seepage Equation (T.I.) d) Potential Formulation of Shallow Water Problems (T.I.) 16 2. NAVIER-SIOKES EQUATIOI SOLUTION PROGRAM a) Navier Stokes Equation for Incompressible Viscous Fluids, Including Time Dependence. In retrieving elemental properties, boundary other. conditions and any. parameters frcan the FEHPOL data structure, each. program defines. the corresponding names.. solution. This means that. the.

(63) 57 solution parameters to be set (using the FEHPCL SET command) depend on the supervised program.. 5.2. The Solution Program DSPSTD The solution program DSPSTD. uses the finite element method. to solve the following differential equation:. The various solution parameters associated with the equation and their default values are given in the following table.. Item in equation. FEHPOL parameter name. Type. Default value. OnNTHITWmJCM. nodal. none. global. 1.00. BK. elemental. 1.00. m. elemental. 1.00. global. 0.00. mscHnGE. nodal. 0.00. aoBBMaacHaRGE. elemental. 0.00. u. z-mocinr. nodal. 0.00. V. .i^ri Mhii. nodal. 0.00. T c ^1 Ko. ^i Qi. The first example of the use of this solution program is a simple rectangular channel problem. The concentraticai boundary condition has been set at either end of the channel and a decay constant of and a decay constant of 0.01 has been specified.. A contour plot. of the resulting levels of concentration, the finite element mesh generated and the commands is given on the next page..

(64) CURVE 4,0 2,4,0:TOP CURVE 24,2 4 , 2 : B 0 T INTERPOLATE TOP NODES=10,LINEAR INTERPOLATE EOT NODES=10,LINEAR CURVE TOP(IO) B0T(1):END1 CURVE T0P(1) B O T ( 1 0 ) : E N D 2 REGION TOP B O T : C H A N N E L MESH C H A N N E L W I T H SIX N O D E D T R I A N G L E S S E T C O N C E N T R A T I O N : 1 0 0 ON E N D t , C 0 N C E N T R A T I 0 N = 0 O N E N D 2 , D E C A Y = 0 . 0 1 EXECUTE "DISPERSION EQUATION SOLUTION" SET X M A X = 2 5 , Y M A X = 2 PLOT C O N T O U R M A P OF S O L U T I O N , L E V E L S = ( 1 0 , 2 0 , 3 0 , 4 0 , 5 0 , 6 0 , 7 0 , 8 0 , 9 0 ) PLOT AND L A B E L M E S H. 004-006-011 "012-013-015-019-022-029"030-031 -033-037-039-043-045-049-051 -055. l\. / I. / l \. I. /I. /I. /I. /I. /I. 002 005 008 009 0 1 4 017 020 821 026 027 032 035 038 041 044 047 050 053 056. I. \ l /. 1/. I. \ l /. 1/. 1/. 1/. 1/. I. 001-003-007-010-016-018-023-024-025-028-034-036-040"042-046-048-052-054-057. Example 10.

(65) 59. The following example illustrates the use of FEHPOL to form a model of the dispersion of. sewage which is released. into the. river Guaiba from the city of Porto Alegre in Rio Grande do Sul, Brazil.. For the example which follows f no velocities were int-. roduced ^ however since the sewage concentration is non-conservative y the d e c ^ coefficient was set.. The concentraticxi boundary. conditio! is set on i±e mouth of the river, and a discharge at a node representing the outfall point.. Notice that in the conmand. seguaice it is not necessary for the user to know anything about the finite element mesh vAiich was generated exoQ)t to specify an element type in the MESH statement. Plotting is only. of the ways of displaying the results. of the finite element calculations.. As this exanple shows, any. EEHPOL paraneter (including those passed back from. the solution. program via the FPSPUT supervisor call) may be printed at the user's discretion, as well as other. sorts of intermediate infor-. mation such as the mesh specifics, the connectivity table, nodal coordinates, and representations of REGIONS,. CDRVEs, and NCDEs.. In this example the mesh specifics and the solution (concentration) vector have been requested and printed..

(66) NODE 13,47:PTA-DA-CADEIA NODE 1 5 , 1 5 : S A L G A D 0 C U R V E 25,0 4 0 , 3 : L A G 0 A - D 0 S - P A T 0 S INTERPOLATE LAGOA-DOS-PATOS N0DES=3,LINEAR CURVE. LAGOA —DuS —P A T 0 S ( 3 ). 35,6 34,9 3 7 , 1 2 3 8 , 1 6 35,18 3 2 , 1 7 3 2 , 2 2 28,19 25,20 2 3 , 1 7 2 1 , 1 8 2 2 , 2 1 18,21 19,24 17,25 16,28 10,28 12,30 12,33 10,35 9,38 10,40 13,43 PTA-DA-CADEIA:ALEGRE CURVE 11,48 10,45 7 , 4 5 3,42 1,40 2 , 3 6 1,30 1,23 4,22 5,19 5 , 1 4 10,13 S A L G A D O 1 5 . 5 , 9 18,4 22,6 27,8 2 3 , 6 2 6 , 3 : S A C 0 S REGION SACOS L A G O A - D O S - P A T O S A L E G R E : R I O - G U A I B A LET 7,41 5,35 7 . 5 , 3 3 11,21 2 1 , 1 2 = I N T S R N A L N O D E S FOR R I O - G U A I B A M E S H R I 0 - G U A I 3 A W I T H SIX N O D E S T R I A N G L E S SET X M A X = 5 0 , Y M A X = 6 0 PLOT MESH SET D I S C H A R G E z l O O O ON P T A - D A - C A D E I A , C O N C E N T R A T I O N : 1 5 0 ON L A G O A - D O S - P A T O S , DECAY = 0.001 EXECUTE " D I S P E R S I O N E Q U A T I O N S O L U T I O N W I T H D E C A Y = 0 . 0 0 1 " WRITE M E S H S P E C S , S O L U T I O N PLOT CONTOUR M A P OF S O L U T I O N , L E V E L S : ( 1 3 3 , 1 6 7 , 2 0 0 , 2 3 3 , 2 6 7 , 3 0 2 , 333,367,400) SET DECAY = 0.01 EXECUTE " D I S P E R S I O N E Q U A T I O N S O L U T I O N W I T H D E C A Y = 0 . 0 1 " PLOT CONTOUR M A P OF S O L U T I O N , L E V E L S : ( 1 3 3 , 1 6 7 , 2 0 0 , 2 3 3 , 2 6 7 , 3 0 0 , 333,367,400) /*. Example 11.

(67) 51. \. Example 11 (cont'd).

References

Related documents