Proc. of the 9th WSEAS Int. Conf. on Mathematcal Methods and Computatonal Technques n Electrcal Engneerng, Arcachon, October 13-15, 2007 53 Multblock method for database generaton n fnte element programs DANIELA CÂRSTEA Hgh School Group of Ralways Craova Str. Doljulu nr. 14, bl. C8c, sc.1, apt.7, Craova ROMANIA danacrst@yahoo.com Abstract. A pre-processor for the generaton of the mesh 2D n a CAD product based on the fnte element method (FEM) s presented. Our software product s based on the multblock method and s mplemented n C language. A frendly nterface user-program s ncluded and some communcaton languages are avalable n the communcaton protocol. In our software product the database conssts n a set of fles (text or bnary fles). These fles contan both geometrcal data of the elements and physcal propertes (feld sources, materal propertes, boundary condtons etc). The database can be used by well known software products for graphcs processng and post processng stages of a fnte element program. We present some aspects of parallel mplementaton of the pre-processor. Keywords: Fnte-element method; CAD. 1 Introducton In many engneerng applcatons n the area of feld computaton, the numercal models are based on the fnte element method (FEM). The FEM programs have a modular form n accordance the stages of the method: pre-processng, soluton (processng) and postprocessng. The greatest task n any fnte element program s generally the preparaton of the nput data. There s a large amount of nput data that conssts n both geometrcal and physcal data. Our work concerned to pre-processng of the FEM programs. In order to elmnate much of the effort nvolved n data preparaton for fnte element programs, an automatc or sem-automatc mesh generaton can be employed. In ths way the data errors whch nevtably occur durng manual preparaton are elmnated. There are a lot of methods for mesh generaton but some of them are not effcent. A sem-automatc approach s very effcent. The mesh generator can be mplemented both n conventonal and parallel computers. On parallel computers the speedup of the computaton can be mproved. The conventonal mesh generator can be used both n the case of convex domans and for domans wth shapes not too dfferent from a convex. In twsted geometry a sutable transport functon must be defned but t s dffcult to fnd a transport functon for non-convex domans. 2 The multblock method The multblock method [3], sometmes referred to as super-element method, has some advantages over many methods. One man advantage conssts n the fact that t s well suted for parallel computaton. Ths s a top research area and our program was created wth ths dea n mnd. It was tested for many applcatons for conventonal computers but can be extended for advanced archtectures, lke parallel computers. The basc dea conssts of parttonng the doman of feld nto a set of curved-sded general quadrlateral blocks. Each block of ths coarse parttonng s then meshed n trangles. Although the method s effcent for parallel archtectures, t ncludes two knds of dffcultes: The creaton of elementary blocks and ther meshes The management of the block nterfaces As nput data, the mesh generator requres data for the coarse mesh of the doman n terms of blocks of quadrlateral nature and, n addton, data for pont's dstrbuton on the block edges. The number of the ponts must be consstent (.e., two logcally connected edges must have the same number of control ponts). The control ponts can be generated automatcally n the case of straght edges, but for curved edges the control ponts are gven explctly n order to descrbe the shape of the curve accurately.
Proc. of the 9th WSEAS Int. Conf. on Mathematcal Methods and Computatonal Technques n Electrcal Engneerng, Arcachon, October 13-15, 2007 54 3 A conventonal algorthm The dea of the multblock method s smple [2]: the spatal doman s dvded nto a few large blocks or zones (the nput data), and the subdvson proceeds automatcally. The algorthm has four steps presented n the fgures 1-4. In a sem-automatc generator the block s specfed by: The number of the elements of dvson on the drectons ξ andη, called n ζ and n η. The weghtng factors. curved-sded quadrlateral and s represented by the 8-nodded quadratc soparametrc element descrbed n [4]. A quadrlateral s defned by four vertces and four ponts located on each of the sdes (see Fg. 1). For a quadrlateral doman, let n be the number of ponts descrbng edges 1 and 3 and m correspondng to edges 2 and 4. The method creates a mesh consstng of (n-1) (m-1) quadrlateral elements. Step 2. The subdvson process In the step 2 of the algorthm, each block s subdvded nto quadrlateral elements accordng to a fneness of subdvson to be specfed as data nput (Fg. 2). Ths s a feature that can permt a parallel mplementaton of the algorthm. The subdvson process s performed ndvdually for each block and element nodal ponts n each block are numbered separately. For ths step of our software product, we use lnear 4-noded quadrlateral elements. The elements are formed by lnearly connectng grd ponts, as shown n Fg.2. Fg. 1 - The defnton of blocks The algorthm n pseudo-code has the followng form [1]: 1. The constructon of a coarse mesh. It conssts n: Defnton of the structural blocks Defnton of the control ponts on the edge of the blocks 2. The subdvson of each block n more blocks n accordance wth the poston and the number of ponts on ts edges 3. The connecton of ndvdual meshes wth nodal renumberng 4. The subdvson of each quadrlateral element n trangles to obtan the fnal mesh Each step of the algorthm nvolves some operatons that are not easy to mplement. For example, the step 2 of the algorthm uses transportdeformaton functons that depend by the doman (convex or non-convex), and the block nature [3]. Step 1. Defnton of the blocks Our mesh generator starts wth quadrlaterals wth parabolc sdes. Each block has the general form of a Fg. 2 - Subdvson of a structural block The natural co-ordnate system ξ and η permts elements wth curvlnear shapes to be consdered. The co-ordnate values x and y at any pont wthn the element are gven by the expressons [4]: n ( e x( ξ, η) = N ) η) x = 1 n ( e) y( ξ, η) = N η) y = 1 wth: x, y the co-ordnates of the node and N shape functon. The natural curvlnear co-ordnates ξ and η range between the lmts ± 1 and the
Proc. of the 9th WSEAS Int. Conf. on Mathematcal Methods and Computatonal Technques n Electrcal Engneerng, Arcachon, October 13-15, 2007 55 drecton of ξ s defned by the order of numberng of the frst 3 element node numbers, followng an antclockwse sequence around the element. The nterpolaton functons for quadrlateral elements are [4]: For a vertex: N ( ξ, η) = (1 + ξξ )(1 + ηη )( ξξ + ηη 1) / 4 For a mddle pont of an edge: ξ 2 = 0 : N η) = (1 ξ )(1 + ηη ) / 2 η 2 = 0 : N η) = (1 η )(1 + ξξ ) / 2 In a sem-automatc generator we must defne the block. In our generator we specfy: The number of the elements of dvson on the drectons ξ and η, called n x and n y. For a non-unform mesh we specfy the weghtng factors. Denotng by (p ξ ) and (p η ) the weghtng factors, the grd ponts can be located [2]. Thus: 1. Intate the co-ordnates ξ and η 2. Compute the natural co-ordnates for the dvson: 2( p ξ ) ξ = ξ 1 + (1) p ξt c 2( pη ) η = η 1 + (2) p ηt c where n = x n p ξ T ( p = 1 ξ ), p = y ηt p = 1 ( η ) The value for c n equatons (1)-(2) s 1 for lnear elements (defned by 4 nodes), and 2 for quadratc elements (defned by 8 nodes). Step 3. The connecton of ndvdual blocks The subdvson process s performed ndvdually for each block. The element nodal ponts n adjacent blocks are numbered separately. The nodal ponts along block nterfaces wll have common co-ordnate values and therefore should be unquely numbered. Thus after subdvdng each block n a mesh, t s necessary to search for nodal ponts along block nterfaces, by comparng the co-ordnates of all nodal ponts, and then assgnng a sngle nodal number to the nodes wth dentcal co-ordnate values. Step 4. Generaton of the trangular mesh In the step 4 of the algorthm, a trangular mesh can be created. The quadrlaterals can subsequently be splt nto two optmal trangles (.e. splttng wth respect to the shortest dagonal). In order to allow the mesh to be graded, the absolute or relatve sze of the elements n a partcular block s defned or computed. In the frst approach we compute the absolute sze of the elements. The user defnes the spacng at the edge ends and j. Fg. 3 - The connecton of ndvdual meshes For adjacent blocks t s necessary to specfy the spacng values so that the subdvsons along block nterfaces are compatble. Fg.4- Fnal mesh wth trangular elements In another approach, the weghtng factors, whch prescrbe the relatve sze of elements wthn a block, are generated automatcally both n ξ-drecton and η-drecton. The user defnes the spacng at the ends
Proc. of the 9th WSEAS Int. Conf. on Mathematcal Methods and Computatonal Technques n Electrcal Engneerng, Arcachon, October 13-15, 2007 56 of an edge of the block. The formulae that we use for estmatng the number of ponts that wll be produced by our mesh generator are smple and cheap. Fnally, the generated mesh s processed so that a bandwdth mnmsaton s obtaned. Ths procedure s based on a judcous orderng of the structural blocks and node numbers allocated. 4 Database generaton The scope of the generator s to create automatcally the database necessary n the followng stages of the FEM program: processng and post-processng. In our software product the database conssts n a set of fles (text or bnary fles). The relevant attrbute of the database s the portablty. For ths requrement, the output data of the mesh generator are arranged n two types of the fles: the frst type of the fles contans the geometrcal propertes of the mesh; another fle contans the physcal propertes of the elements (feld sources, materal propertes, boundary condtons etc). The frst fle wth geometrcal propertes contans the records wth the followng components: the number of the node, coordnates of the nodes, code for the boundary condtons. The nodes are labelled wth ntegers rangng from 1 to the total number of nodes n the doman. The second fle wth geometrcal propertes contans element data: number of the element, the nodes of the element, label of the element, code of the edge for non-natural boundary condtons. The two fles have no physcal nformaton about the doman. In ths way the database s ndependently by the feld problem. The attrbutes relatve to the physcal problem can be assgned fnally f the user desres. The process s done by the codes from the records of the geometrcal fles. For example, the element code s an ndex n a table wth physcal propertes of the element. An alternatve approach s to assgn the physcal propertes n the assembly phase of the fnte element program n processng stage. From practcal consderatons, all elements n a block have the same code. The user has the access at the database and can lnk t wth dfferent programs of FEM or software products as Mathcad, Matlab etc. The advantage of our software conssts n the possblty of the user to develop hs solvers for specal problems n engneerng. 5 Sem-automatc facltes The mesh generator has a lot of manual facltes for refnements. The ntal mesh can be extended n the zones of the nterest. Some transformatons as bsecton, trsecton, quadr-secton, symmetry etc. were ncluded n our software product and can be used by the users n the development of the database n the manual effort nvolved n data preparaton [5]. An automatc extenson nvolves the desgn of effcent error estmators and ths task s dffcult. An engneer can estmate the zones wth accuracy problems so that a manual extenson s a good approach n the development of the fnal mesh. Fg. 5- The bsecton The bsecton method nvolves the dvson of the trangular element n two elements usng the mddle of a sde n an element (Fg. 5). Fg. 6- The trsecton The trsecton method nvolves the dvson of the trangle n three trangles (Fg.6). The new vertex s the ntersecton of the medans. The quadrsecton method nvolves the dvson of a trangle n four trangles by the mddle lnes of the selected trangle (Fg. 7). Fg. 7- The quadr-secton We consdered only trangular elements but our generator can create dfferent element types. The permtted element types are:
Proc. of the 9th WSEAS Int. Conf. on Mathematcal Methods and Computatonal Technques n Electrcal Engneerng, Arcachon, October 13-15, 2007 57 Lnear 3 nodded trangular elements. The procedure for mesh generaton was presented n the above dscusson. Lnear 4-noded quadrlateral elements. In ths case elements are formed by lnearly connectng grd ponts. Quadratc 8-noded soparametrc elements. For ths case each element spans over a 2 x 2 mesh of grd ponts. 6 Conclusons In ths work we descrbed an effcent program for generatng fnte element meshes based on automatc element subdvson of a few large domans or blocks whch are defned as nput data. Our mesh generator can be mplemented both n conventonal and parallel computers. On parallel computers the speedup of the computaton can be mproved. The FE mesh tself can be generated n parallel, wth each processor generatng a porton of the mesh, whch t was allocated durng the parttonng phase. Refnement technques can be used f t s necessary. The conventonal mesh generator can be used both n the case of convex domans and for domans wth shapes not too dfferent from a convex. In twsted geometres a sutable transport functon must be defned and t s dffcult to fnd a transport functon for non-convex domans [3]. The mesh generator developed by the author s easy to use. The frst verson of ths mesh edtor was a sem-automatc generator [5]. We can control the densty of elements n a gven regon. As nput data, our mesh generator requres the nput of a coarse dscretzaton of the doman n terms of blocks of quadrlateral nature and, n addton, a dstrbuton on the edges of the blocks. The number of the ponts must be consstent (.e., two logcally connected edges must have the same number of control ponts). The control ponts can be generated automatcally n the case of straght edges but for curved edges the control ponts are gven explctly n order to descrbe the shape of the curve. In an adaptve mesh the followng strateges can be used: h-strategy (when elements are refned); p- strategy (when the order of the polynomal approxmatons of the unknowns s ncreased); h-p strategy (a combnaton of the prevous strateges). References: [1]. Cârstea, D. CAD tools for magneto-thermal and electrc-thermal coupled felds. Research Report n a CNR-NATO Grant. Unversty of Trento. Italy, 2004. [2]. Hnton, E., Owen, D.R., An ntroducton to fnte element computatons. Academc Press, New York, San Francsco, 1977, US. [3]. George, P.L., Automatc Mesh Generaton. Applcaton to fnte element methods. John Wlley & Sons, Pars 1991. [4]. Olaru, V., Brătanu, C., Modelarea numercă cu elemente fnte. Edtura tehncă, Bucureşt, 1986, Romana. [5]. Cârstea, D., Cârstea, I., A sem-automatc mesh edtor for fnte element programs. In: Proceedngs of the Second Internatonal Workshop CAD n electromagnetsm and electrcal crcuts, CADEMEC 99. pg. 138-141. 7-9 September 1999, Cluj, Romana, 1999