Code conversion FEM - XFEM



Comments



Description

CIMNEMSc Computational Mechanics Advanced Discretisation Methods Homework 1 Student: Jacob E. Salazar Solano Professor: Esther Sala Lardies November 21, 2014 JESS Homework 1 Page: 1 1.1. • For elements in D1 the function eL2 set D1 was defined. • Integration Gauss Points.for elements partially in the domain. Note that the function CreateMesh.1.1. 1. • Mesh no longer read directly but generated with CreateMesh • Computation of the Level Set function at nodes with InitialiseLS • Elements discrimination into sets with SetElements – D1 .2. 1. LS Level Set information was required in the next step. • Shape functions and derivatives of them were calculated at the new gauss points for each element using the provided function ShapeFunc • The elemental stiffness matrix for each element was calculated using the same provided function EleMatElasticity using the new quadrature information and shape functions. 1. Problem 1 1.Z eL 2 = (uh − u)2 dΩ u2 dΩ Ω sZ eH 1 = Ω (∇uh − ∇u) : (1) Ω (∇uh . and material properties for these points were calculated for each element using the provided function ModifyQuadrature. – D2 . This was based on the function CreMat with the following modifications: • A new parameter was required. General description. – For each element. one for elements in D1 and another for elements in Int.Z − ∇u) dΩ ∇u : ∇u dΩ (2) Ω Integrals over the domain were performed in two parts.2. • New boundary conditions were defined for nodes inside the hole and not part of elements in Int. Calculation of eL2 . In it. Write a Matlab function to compute the error of the X-FEM approximation: sZ . – Part1: Contribution to K by elements in D1 using the same function CreMat by only passing to it the connectivity (variable T) for elements in D1. This was performed in order to avoid a singular matrix.m can be used to build a uniform mesh on a rectangular domain. About the function CreMat par JACOB.1. – For all elements used quadrature and shape functions were same as with the RefElement of the original code. and this value added to the previously accumulated value. even though Matlab managed to get the proper solution without this consideration.for the elements completely contained within the domain. – Part2: Contribution to K by elements in Int with the new function CreMat par JACOB.2. • For elements in Int a similar the function eL2 set Int was defined: . weights. Briefly explain the modifications you have done. Modify the given code to solve the problem using X-FEM. – Int . – The previous information was fed to the function eL2 elem to compute the error integral over the element’s domain. 1. • The stiffness matrix K computation was performed by parts. nodal coordinates and solution values were isolated. and then added up.for the elements completely out of the domain.1. – The previous information was fed to the function eL2 elem to compute the error integral over the element’s domain. Which is the convergence rate? Compare it to the one of FEM with a uniform mesh. – uh were interpolated from values at nodes using the shape functions. nodal coordinates and solution values were isolated. Display a convergence plot to show the evolution of the error. • About the function eL2 elem: – Gauss quadrature was used for integration. Convergence value and comparisson eL2 . – RΩ (uh − u)2 dΩ was calculated. Calculation of eH 1 . – Rx. • About the function eH1 elem – Basically the same eL2 elem but with the following differences: – ∇uh was calculated with derivatives of shape functions and solution at nodes. y coordinates were calculated and with them u values were read from exact solution. For eL2 both of them approximate a convergence rate of 1. – x. and final computation of eH1 performed. and this value added to the previously accumulated value. R y coordinates were calculated and with them ∇u values were read from exact solution. – Ω u2 dΩ was calculated.2. and final computation of eL2 performed.3. – RΩ (∇uh − ∇u) : (∇uh − ∇u) dΩ was calculated. 1. • Finally corresponding integrals over the two sets were aded.8 (not exactly 2 but close enough).JESS Homework 1 Page: 2 – A particular Gauss quadrature was used for each element (using the provided function ModifyQuadrature) – For each element. • Finally corresponding integrals over the two sets were aded. – For each GP the following was implemented. Figure 1. 1. and for eH 1 again both methods present a similar value of almost 1. For both methods the convergence is quite similar. • For elements in D1 the function eH1 set D1 was set analogous to eL2 set D1 but calling eH1 elem. shape functions were calculated with the provided function ShapeFunc – For each element. • For elements in Int the function eH1 set Int was set analogous to eL2 set Int but calling eH1 elem.2. – Ω ∇u : ∇u dΩ was calculated. 4. If the hole was not traction-free. traction on the boundary is easily computed as an integral over the edges of the elements defying the boundary since the mesh is adjusted to the domain. Convergence value and comparisson eH1 1. • The line integral Γintern v · t dΓintern computed and its contribution to each node added. . for each element in the boundary: • Boundary ΓinternRshould be defined by approximating its position. However for XFEM this is not the case and therefore.JESS Homework 1 Page: 3 Figure 2. how should boundary conditions be taken into account ? When expressing the problem in the weak form we have the following terms Z Z Z ∇v · σ dΩ = v · f dΩ + v · t dΓ Ω Ω (3) Γ When R the boundary Γ is traction free no special considerations must be taken into account since the term Γ v · t dΓ is equal to zero. In FEM. 5 1 Figure 4. 2.5 0 0. General description.2. – D2 . For FEM 5280 elements were used and for XFEM 5208. One for each interval. Problem 2 2. In order to make a fair comparison.1.5 1 0 −1 −2 −2 −1. • Conectivities of enriched elements were obtained withe the provided function SetEnrichment • The stiffness matrix K computation was performed using the newly defined function CreMat XFEM JACOB About the function CreMat XFEM JACOB • based on the previous function CreMat • Three cycles were defined. since it was already prepared to calculate elementary stiffness matrices accordingly to the information received) 2.5 −1 −0. but simply a consequence of it having nodes defined on the boundary.1. Dispacements v FEM 1 1. • Elements in D1 were integrated normally using their corresponding material properties. Briefly explain the modifications you have done. Now. clearer boundary. where displacements for direction v are plotted. Dispacements v XFEM 1. Visually the results are almost identical as seen in figures 3 and 4. Modify the given code to solve the problem using X-FEM. “normal integration process and contributions added to the global stiffness matrix.5 Figure 3.for the elements completely contained within the domain.for the elements completely out of the domain. v v 2 2 1 1 0 0 −1 −1 −2 2 −2 2 1 0 −1 −2 −2 −1.JESS Homework 1 Page: 4 2. – Int .1.5 0 0. This is not necessarily due to a better solution in the FEM solution.5 .for elements partially in the domain.5 −1 −0. Compare the X-FEM solution with the one you obtained using a FEM mesh. • Similarly for elements in D2. when looking the same graph at a different angle (figures 5 6) small differences appear. • Mesh no longer read directly but generated with CreateMesh • Computation of the Level Set function at nodes with InitialiseLS • Elements discrimination into sets with SetElements – D1 . similar meshes were used (approximately same number of nodes). • For elements in the boundary (in the set Int): – quadrature parameters calculated for each element with the provided function ModifyQuadrature – Shape functions and derivatives calculated with the provided function ShapeFunc – Enriched shape functions were calculated using the provided function ComputeEnrichedBaseFunctions – This information was used and sent to the same provided function EleMatElasticity (same used for elements in domains D1 and D2. with the FEM solution having a better defined. and its contributions assembled in the global stiffness matrix. and therefore showing a clear change in results for each domain. Chopp. 6183 . 1257-1275. but results were inverse for larger number of elements.6200. we could say that XFEM results are equally satisfactory as FEM ones. Comput. . Moes and T.5 1 0. L. A. & Huerta. Mech. Comparison FEM . Although some differences appear. (2) N. 193(12-14). D.5 −1 −1.XFEM max|errornodes | References (1) Fernandez-Mendez.5 0 −0. Dispacements v FEM Figure 6.JESS Homework 1 Page: 5 v v 0 2 2 1. Methods Appl. Computer Methods in Applied Mechanics and Engineering. (2004). however a quantitative comparison is complementary. Dispacements v XFEM The plots provide a quick qualitative comparison. Figure 7.5 −2 −2 0 2 1.5 −2 Figure 5. 190(46-47).. the FEM solution presented a higher maximum error.5 −1 −1. 2001. N.5 1 0. Belytschko: Modeling holes and inclusions by level sets in the extended finite-element method.5 0 −0. S. Imposing essential boundary conditions in mesh-free methods. Engrg. In figure 7 different mesh sizes were used and it was clear that for small number of elements. Sukumar.
Copyright © 2024 DOKUMEN.SITE Inc.