THE MORTAR FINITE ELEMENT METHOD IN 2D: IMPLEMENTATION IN MATLAB - Vscht.cz

Transcription

THE MORTAR FINITE ELEMENT METHOD IN 2D:IMPLEMENTATION IN MATLABJ. Daněk 1 , H. Kutáková12Department of Mathematics, University of West Bohemia, Pilsen2 MECAS ESI s.r.o., PilsenAbstractThe paper is focused on the mortar finite element method for solving linearelliptic problems in 2D. The mortar finite element method is a nonconformingdomain decomposition technique tailored to handle problems posed on domainsthat are partitioned into independently triangulated subdomains. In the contribution we explained the principle and properties of the method. A significantpart of the paper is dedicated to the implementation of the mortar method inthe Matlab system. The numerical results are showing both the principle andthe possibility of practical use of the method.1IntroductionThe finite element method is applicable to a wide range of physical and engineering problemswhich can be described by means of partial differential equations. The mortar finite elementdiscretization is a discontinuous Galerkin approximation. The functions in the approximationsubspaces have jumps across subdomain interfaces and are standard finite element functionswhen restricted to the subdomains. The jumps across subdomains interfaces are constrainedby conditions associated with one of the two neighboring meshes so that a weak continuitycondition must be fulfilled. Because of the discontinuity on the interface we classify the mortarfinite element method as a nonconforming finite element method (see [6]).Mortar finite elements were first introduced in 1994 by Christine Bernardi, Yvon Madayand Anthony T. Patera in [1]. Our paper is focused on the mortar finite element method in twodimensions and its implementation in the Matlab system. Most of the literature describing themortar finite element method deal with the geometrically conforming partition, which is easier.Therefore, this paper is focused on the nonconforming case.2Mortar Finite Element MethodIn this section we briefly describe the mortar finite element method in two dimensions. LetΩ R2 be a polygonal computational domain. We decompose the domain into P nonoverlappingpolygonal subdomainsΩ P[Ωi ,Ωj Ωk for j 6 k,j, k 1, . . . , P.i 1The partition can be: Geometrically conforming – The intersection between two closure of any two subdomainsΩi Ωj , i 6 j is either an entire edge, a vertex or empty. Figure 1 shows an example ofthe partition. Geometrically nonconforming – All the other cases. See example of the nonconformingpartition in Figure 2.

ΩΩ1Ω6Figure 1: Example of geometrically conforming partition of Ω into subdomains Ω i .ΩΩΩ1Ω1Ω7Ω5Figure 2: Example of geometrically nonconforming partition of Ω into subdomains Ω i .The subdomains Ωi form together a coarse mesh of the whole domain Ω. We discretizeeach subdomain by triangular elements known from the finite element method. The size of thetriangles can be chosen with regard to the problem. We use finer mesh in subdomains, wherebig changes in behaviour of the solution are expected, etc. The resulting triangulation can benonmatching across the interfaces of the subdomains, as you can see in Figure 4.We define the interface Γ between subdomains Ω i as a closure of the union of the parts ofthe boundaries of Ωi , i 1, . . . P , that are interior to ΩΓ Pi 1 ( Ωi \ Ω).(1)The interface can be considered also as a set of nodes, that belong to the boundary of at leasttwo subdomains.We denoteV h (Ω) V1h (Ω1 ) V2h (Ω2 ) · · · VPh (ΩP )(2)the space of mortar finite elements defined on Ω. We consider the low order basis functions, forexample the piecewise linear basis functions. V ih (Ωi ) is a finite element space in each subdomainΩi . Vih (S) is a restriction of functions from V h to a set S.For further analysis, we introduce some more notation. A main edge will represent a sideof a planar n-agle, see Figure 3. A square has four main edges, n-agle has n main edges. LetΓij be an open common edge or a part of an edge of two adjacent subdomains Ω i and ΩjΓij Ωi Ωj .(3)The edge Γij is a part of a main edge (or is a main edge) both of the subdomain Ω i and Ωj . Wechoose the main edge of one subdomain as a master (mortar) and the main edge of the secondsubdomain as a slave (nonmortar). We use a new notation: Mortar edge γ – If it belongs to a particular main edge of a boundary Ω i , we denote itγi . Nonmortar edge δ – If it belongs to a particular main edge of a boundary Ω j , we denoteit δj .

Figures 3 and 4 show examples of situations, that can occur on the interface. If we considergeometrically conforming partition of Ω, it is obvious, that for two subdomains Ω i and Ωj witha commom edge holds an equality γi Γij δj , or γj Γij δi (it’s important which edgeis chosen as a mortar), see Figure 4. The situation is more complicated in the nonconformingcase. There is arising a question, how to choose mortar and nonmortar edges. An example ofsuch a choice is in Figure 5. It can be proven that the partition always exists (see [3] or [6]).In term of a new notation we can write:Γ K[γm γn ,γk ,if m 6 n,m, n 1, . . . , K,(4)m, n 1, . . . , L,(5)k 1where K is the number of all mortar edges. Obviously alsoΓ L[δm δn ,δl ,if m 6 n,l 1where L is the number of all nonmortar edges.ΩΓijmain edge Ωimain edge ΩjΩiΩjγiδjFigure 3: Interface Γij of two subdomains Ωi and Ωj and signification of edges as mortar andnonmortar.ΩΓijΩiδiΩjγjFigure 4: Mortar edge γ and nonmortar edge δ on the interface Γ ij of two subdomains Ωi andΩj .It remains to solve the most important point of the method - the situation on the interfaceΓ. It’s necessary to join somehow the values of the searched function (we call it mortar function)

ΩΩΩ1Ω1Ω7Ω5Figure 5: Example of choice of mortar edges in geometrically nonconforming case (mortar edgesare blue).on the interface. Instead of a pointwise continuity we require fulfilment of a weak continuitycondition. The exact formulation will follow after some necessary definitions.Each nonmortar edge δl belongs to exactly one subdomain, we denote it Ω l . Let Γl be theunion of q parts of the mortar edges γ l,i which correspond geometrically to nonmortar edge δ lΓl q[(γl,i δl ).(6)i 1For each nonmortar edge δl we choose a space of test functions Ψ h (δl ), which is a subspaceof the space Vlh (δl ), that is a restriction of functions from V lh (Ωl ) to δl . So if we choose piecewiselinear basis functions, Vlh (Ωl ) will be a space of piecewise linear functions. Ψ h (δl ) will be arestriction of functions from Vlh (Ωl ) to δl with requirement that these continuous, piecewiselinear functions are constant in the first and last mesh intervals of δ l (see Figure 6). Otherpossibility how to establish the space of test functions is described in [7].Figure 6: Test functions on δl .We define the mortar projection on δl as πq1 ,q2 (ul ) : L2 (Γl ) Vlh (δl ). For two arbitraryvalues q1 and q2 and a function ul L2 (Γl ) it satisfiesZ(7)(ul πq1 ,q2 (ul ))ψ ds 0 ψ Ψh (δl ).δlThe condition means, that the jump of the mortar function across each nonmortar edge mustbe orthogonal (in L2 (Γl )) to the space of test functions defined on δ l . The condition is calledthe weak continuity condition or the mortar condition.

3Formulation of the Mortar Problem3.1Variational (Weak) Formulation of the Mortar ProblemLet us remind a variational (weak) formulation of a Poisson problem in two dimensions. Weneed to find a solution u W21 (Ω) of the Poisson equationu g1 4u fin Ω R2 ,(8)on ΩD , u g2 n(9)on ΩN ,where f L2 (Ω), g1 L2 ( ΩD ), g2 L2 ( ΩN ). The solution u W21 (Ω) must be from the setof admissible functionsVg {u W21 (Ω) : u g1 na ΩD in the sense of traces}(10)and for every test function v must satisfy v V,a(u, v) F (v)(11)whereV {v W21 (Ω) : v 0 on ΩD in the sense of traces}.Za(u, v) [grad u grad v] dΩ,F (v) ZΩf v dΩ Zg2 v dS.(12)(13)(14) ΩNΩWe can formulate the problem (8), (9) in terms of a decomposition of the domain Ω intosubdomains Ωi , i 1, 2, . . . , P and by using an appropriate mortar finite element space V h . Weappear from the weak formulation (11) of the problem (8), (9) and we rewrite it to the discreteform.We know, that Vih (Ωi ) W21 (Ωi ), i 1, . . . , P . Thus, we can writeaΓ (u, v) F Γ (v) v W21,0 (Ω).(15)aΓ (·, ·) is a bilinear form, which is defined as a sum of contributions from the particular subdomainsP ZXΓa (u, v) [grad u grad v] dΩi(16)i 1 ΩandF Γ (v) F (v) iZΩf v dΩ Zg2 v dS.(17) ΩNA variational (weak) formulation of the mortar problem represents such a task: Find u h V hwhich satisfiesaΓ (uh , vh ) F Γ (vh ) vh V h .(18)The existence and uniqueness of the solution of (18) follows i.a. from the Lax-Milgram lemma.

3.2Mixed Formulation of the Mortar ProblemFirst, we present some findings relating to dual spaces. We know, that V ih (Ωi ) W21 (Ωi ). A1/2restriction of a mortar function u to a nonmortar edge δ l belongs to the space W2 (δl ). The1/2space of test functions Ψh (δl ) can then be a subset of the dual space of space W 2 (δl ) with 1/2respect to the L2 inner product, thus Ψh (δl ) W2(δl ).For introduction of a mixed formulation we use the mortar condition (7), whose satisfactionis demanded on the interface. We denote [u l ] the jump of uh V h across δl . The test functionsfrom the mortar condition can be considered as Lagrange multipliers. A function u belongs tothe space V h if and only if for all the nonmortar edges δ l and for all the Lagrange multipliersµl , which form a basis of Ψh (δl ), holdsZ[ul ]µl ds 0.(19)δl1/2From the first paragraph of this subsection results, that [u l ] W2 (δl ). Lagrange multiQQ 1/2 1/2pliers µl must then be from the dual space W2(δl ). Let M h l Ψh (δl ) l W2(δl ) andhµh M , where µh (µl )l 1:L , L is the number of nonmortar edges. We define a bilinear formb(uh , µh ) L ZX[uh ]µl ds.(20) µh M h .(21)l 1 δlA function uh is a mortar function if and only ifb(uh , µh ) 0We can rewrite the discrete problem (18) to the mixed formulation: Find a couple (u h , λh ) V h M h which satisfiesaΓ (uh , vh ) b(vh , λh ) F Γ (vh )b(uh , µh ) 0 vh V h , µh M h .(22)As well as in other mixed formulations, it is important to satisfy the Brezzi-Babuškacondition (see [7]) also in formulation (22). This is important for the existence of the solutionand for the error estimate.4Implementation of the Mortar Finite Element MethodWe describe briefly the key points of the implementation of the mortar finite element methodin the Matlab system. We started from the program [4], which deals with the conformingpartition of the computational domain into squares and rectangles, whose sides are parallelto the coordinate axes. The generalization of the program to the nonconforming case is nota trivial task. Our program solves the Poisson or Laplace equation in two dimensions withDirichlet boundary condition and can deal with polygonal computational domains, that can bedivided into general polygonal convex subdomains. Since the conforming partition is a specificcase of the nonconforming partition, it’s obvious, that the program can handle with conformingcase also.The input data are the geometry of the computational domain, the right hand side and theDirichlet boundary condition. The geometrical data contain informations about the subdomains- each subdomain and its triangulations is inscribed with a triplet of matrices p, e, t representingmatrices of points, edges and triangles. It’s necessary to save the information on the mutual

relationships of the edges and subdomains. We must distinguish the edges on the boundarybecause of the fulfilment of the boundary condition and we need to know the adjacent edgesand subdomains of each edge and subdomain.4.1Mutual Relationship of the EdgesSo let us consider a polygonal computational domain Ω. We divide the domain into polygonalsubdomains Ωi . There are, in fact, two types of nonconforming partitions, see Figure 2. In thefirst case, the subdomains are squares and rectangles, whose sides are parallel to the coordinateaxes. The second case is more general – the subdomains are general n-agles or rectangles, whosesides are not parallel to the coordinate axes. Both cases can be combined.In the following text we will use the terms edge and main edge, see Section 2 for theexplanation. The edges and their belongings to the main edges are described in matrices e. Thecomparison of the mutual relationships in the input geometry data is realized through the edges,not the main edges. We look for the parallelism of the edges. The parallelism is indicated bythe identical multiples of x- and y- component of the directional vectors. If an edge is parallelto a coordinate axis, we can profit from the fact, that one component of its directional vectoris equal to zero. We must identify the edges, that are overlapping. The necessary condition ofthe overlapping is, that the edges lie on the same line (a special case of parallelism). Two edgescan overlap with parts of the edges, one edge can be inside the second one or they can coincide.The information on the mutual relationships of the edges and subdomains is stored in a matrixby a numerical value. On the basis of described information we can do the partition into mortarand nonmortar edges.4.2Division of the Edges into Mortar and NonmortarWe divide the main edges, that are not lying on the outer boundary, into mortars and nonmortars. We have already mentioned, that the partition is always possible. But there is nouniversal instruction, how to choose the mortars. We introduce some possibilities. First of all,we focus on the conforming case with rectangular subdomains. Each main edge is either on theouter boundary or has one adjacent main edge with which it coincides. The choice of mortar iswithout any problems. Let’s show two possibilities: Neumann-Dirichlet partition – Each subdomain has either all the main edges mortar ornonmortar. We sign the first two main edges of the subdomain as mortar, the second two as nonmortar.We omit the main edges on the boundary.The situation is more complicated in the nonconforming case. Neither of the above-mentionedmethods can be used. With regard to a lack of information in a literature we use our own wayof a choice of the mortar edges.We will do the following. We go through the particular subdomains in the same sequenceas they were entered. If a main edge is unsigned yet and if it is possible, we sign the main edgeas mortar and its adjacent main edge (or edges) as nonmortar. So we go through all the mainedges of all the subdomains. If a main edge is once called mortar (or nonmortar), we don’tchange it again. The process of signing of the main edges is shown in Figure 7.The information on the adjacent edges is known from the previous research and is storedin a matrix. On the basis of a detection of an overlap there is assigned a type of the appropriateedge and of the adjacent edge. It’s necessary to verify if one of these two edges already hasa value (mortar or nonmortar). In this case, we must keep the value and the type is assigned

only to the second edge. The edges, that belong to the same main edge, are of the same type.The type (mortar, nonmortar, outer boundary) is stored as a numerical parameter added in thematrices e (0 outer boundary, 1 nonmortar edge, 2 mortar edge), see Figure 05)00Ω210Ω102212Ω311020Ω40211Ω500Figure 7: Process of signing of main edges (mortar edges are blue (2), nonmortar edges are grey(1) and 0 is for edges of outer boundary).4.3AssemblingWe briefly describe the assembling of the stiffness matrix and the right hand side. We add inthe assembling the requierement of the fulfilment of the mortar condition (see Section 2) also.First, we need to do some auxiliary steps. Let us consider all the nodes of all the subdomains.For further computation we divide the nodes into several groups - in the local meaning (withinthe subdomains) and also in global meaning (in terms of the whole computational domain). Wedivide the nodes into active and inactive, into interior and boundary, etc. We mention closelythe global division of the nodes. We introduce a set of global active interior nodes, that containsinterior nodes of all the subdomains, interior nodes of the mortar edges and all the corner nodes,that don’t lie on the outer boundary. All the nodes lying on the outer boundary are called globalactive boundary nodes, etc. The sense of these sets will be clear later.For each mortar (master) edge we assemble the so-called master matrix and for each

nonmortar (slave) edge the so-called slave matrix, that introduce the right and left hand sidematrix in applying the mortar condition. In the computation of the master matrix we deal withthe test functions on the nonmortar edge described in Section 2. Since the test functions havezero values at the end points of the nonmortar edges, it’s necessary to have the nonmortar edgeswith at least three nodes (including the end nodes).Each subdomain is first assembled in a usual way as in the case of the finite elementmethod. The values on the subdomain edges are re-counted according to whether the appropriatemain edge is mortar or nonmortar.4.4Solving the Resulting System of EquationsFor solving the resulting system of equations, we use the conjugate gradient method with preconditioning, that is implemented in Matlab. This method is highly suitable for solving systemof equations with symmetric positive definite and sparse matrix. The method is convenient forlarge matrices because of the iterative character of the method. The preconditioning acceleratesthe computation and improves stability.The system of equations is solved only for the global active interior nodes. After thecomputation it’s necessary to compute the solution on the outer boundary, where the fulfilmentof the Dirichlet boundary condition is required, and the solution in the inactive (nonmortar)nodes, which is computed by the mortar projection.5Numerical ResultsIn this section, we present two practical examples showing both the principle and the possibilityof practical use of the method. The examples are solved by our program for solving linear ellipticpartial differential equations in 2D by the mortar finite element method.As first example, we consider a Poisson problem on a general computational domain Ω(see Figure 8): 4u 30on Ω,u 0on Γ0 ,u 1on Γ1 .(23)Γ1Γ0Figure 8: Computational domain Ω for problem (23).

The partition of the computational domain with the appropriate nonmatching mesh is onFigure 9 and the solution of the problem (23) is displayed in Figures 10 and 11. This exampleserves as an illustration of the principle of the mortar finite element method. There is shownthe commonness of the usage of the method.21.21.811.60.81.40.61.20.410.80.20.600.4 0.20.2 0.4 1Figure 9: Partition of Ω for problem (23). 0.8 0.6 0.4 0.200.20.40.60.801Figure 10: Solution of (23).22.51.821.61.51.411.20.5011.50.810.60.50.40 0.5 1.5 1 0.50Figure 11: Solution of (23).0.511.50.20

As the second example, we consider a Laplace problem: 4u 01 x2 y 2 1},4π 9π ϕ, ϕ ( , ),4 4π 9π ϕ, ϕ ( , ).4 4on Ω {(x, y) R2 :u(cos ϕ, sin ϕ) 11u( cos ϕ, sin ϕ) 225π45π4(24)Figures 12(a),(b) show the partition of the computational domain with two versions ofthe appropriate mesh. The solution of the problem (24) is displayed in Figures 13(a),(b) and14(a),(b). The usage of the mortar finite element method enables a choice of a mesh with respectto the discontinuity of the boundary condition. The subdomain with the jump can be meshedmuch finer than the other one.(a)(b)Figure 12: Partition of Ω and two versions of the appropriate mesh for problem (24).130.8130.820.60.420.60.410.210.200 0.200 0.2 1 1 0.4 0.4 0.6 0.6 2 2 0.8 1 0.8 3 1 0.8 0.6 0.4 0.200.2(a)0.40.60.81 1 3 1 0.8 0.6 0.4 0.200.20.40.6(b)Figure 13: Solution of (24) for two versions of the appropriate mesh.0.81

3322114400 12 0.50 10 2 12 0.500 2 2 20.5 4 1 0.8 0.6 0.400.20.40.6(a)0.8110.5 4 1 0.2 3 1 0.8 0.6 0.4 0.20 30.20.40.60.811(b)Figure 14: Solution of (24) for two versions of the appropriate mesh.AcknowledgementsThe first author was supported by the Research Plan MSM 4977751301.References[1] Bernardi, C., Maday, Y., Patera, A. T.: A new nonconforming approach to domain decompositon: The mortar element method. Nonlinear partial diferential equations and theirapplications: Collège de France Seminar, 1994, Vol. 299, pages 13–51.[2] Brezzi, F., Fortin, M.: Mixed and Hybrid Finite Element Methods. Springer-Verlag, 1991.ISBN 0-387-97582-9.[3] Kutáková, H.: Mortar finite element method for linear elliptic problems in 2D. DiplomaThesis (written in czech), Pilsen: University of West Bohemia, Fakulty of Applied Sciences,2008.[4] Rahman, T.: Mortar FE on nonmatching grid. Matlab File, University of Augsburg, 2002.From: h ad.jsp?MC ID 1&SC ID 1&MP ID 21 i.[5] Smith, B., Bjørstad, P. E., Gropp, W.: Domain Decomposition Parallel Multilevel MethodsFor Elliptic Partial Differential Equations. Cambridge University Press (United Kingdom),2004, ISBN 0-521-49589-X.[6] Stefanica, D.: Domain Decomposition Methods for Mortar Finite Elements. Ph.D. Thesis, Courant Institute of Mathematical Sciences, New York University, 1999. From:h R2000-804/TR2000-804.pdf i.[7] Wohlmuth, B.: Discretization Methods and Iterative Solvers Based on Domain Decomposition. Lectures Notes in Computational Science and Engineering, Vol 17. 2001.

Ing. Josef Daněk, Ph.D.Department of MathematicsUniversity of West BohemiaUniverzitnı́ 22306 14 PilsenCzech RepublicEmail: danek@kma.zcu.czIng. Hana KutákováMECAS ESI s.r.o.Brojova 16326 00 PilsenCzech RepublicEmail: kutakova@volny.cz

THE MORTAR FINITE ELEMENT METHOD IN 2D: IMPLEMENTATION IN MATLAB J. Dan ek 1, H. Kut akov a 2 1 Department of Mathematics, University of West Bohemia, Pilsen 2 MECAS ESI s.r.o., Pilsen Abstract The paper is focused on the mortar nite element method for solving linear elliptic problems in 2D. The mortar nite element method is a nonconforming