Anda di halaman 1dari 6

CIMNE

MSc 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. Problem 1
1.1.
Modify the given code to solve the problem using X-FEM. Briefly explain the modifications you have
done. Note that the function CreateMesh.m can be used to build a uniform mesh on a rectangular
domain.
1.1.1. General description.
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 - for the elements completely contained within the domain.
D2 - for the elements completely out of the domain.
Int - for elements partially in the domain.
The stiffness matrix K computation was performed by parts, and then added up.
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.
Part2: Contribution to K by elements in Int with the new function CreMat par JACOB.
New boundary conditions were defined for nodes inside the hole and not part of elements in Int.
This was performed in order to avoid a singular matrix, even though Matlab managed to get the
proper solution without this consideration.
1.1.2. About the function CreMat par JACOB.
This was based on the function CreMat with the following modifications:
A new parameter was required. LS Level Set information was required in the next step.
Integration Gauss Points, weights, and material properties for these points were calculated for
each element using the provided function ModifyQuadrature.
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.2.
Write a Matlab function to compute the error of the X-FEM approximation:
sZ
.Z
eL 2 =
(uh u)2 d
u2 d

sZ
eH 1 =

(uh

u) :

(1)

(uh

.Z
u) d
u : u d

(2)

Integrals over the domain were performed in two parts, one for elements in D1 and another for elements
in Int.
1.2.1. Calculation of eL2 .
For elements in D1 the function eL2 set D1 was defined. In it,
For all elements used quadrature and shape functions were same as with the RefElement of
the original code.
For each element, nodal coordinates and solution values were isolated.
The previous information was fed to the function eL2 elem to compute the error integral over
the elements domain, and this value added to the previously accumulated value.
For elements in Int a similar the function eL2 set Int was defined:

JESS

Homework 1

Page: 2

A particular Gauss quadrature was used for each element (using the provided function
ModifyQuadrature)
For each element, shape functions were calculated with the provided function ShapeFunc
For each element, nodal coordinates and solution values were isolated.
The previous information was fed to the function eL2 elem to compute the error integral over
the elements domain, and this value added to the previously accumulated value.
About the function eL2 elem:
Gauss quadrature was used for integration.
For each GP the following was implemented.
uh were interpolated from values at nodes using the shape functions.
Rx, y coordinates were calculated and with them u values were read from exact solution.
R (uh u)2 d was calculated.
u2 d was calculated.
Finally corresponding integrals over the two sets were aded, and final computation of eL2 performed.
1.2.2. Calculation of eH 1 .
For elements in D1 the function eH1 set D1 was set analogous to eL2 set D1 but calling eH1 elem.
For elements in Int the function eH1 set Int was set analogous to eL2 set Int but calling
eH1 elem.
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.
x,
R y coordinates were calculated and with them u values were read from exact solution.
R (uh u) : (uh u) d was calculated.
u : u d was calculated.
Finally corresponding integrals over the two sets were aded, and final computation of eH1 performed.
1.3.
Display a convergence plot to show the evolution of the error. Which is the convergence rate? Compare
it to the one of FEM with a uniform mesh.
For both methods the convergence is quite similar. For eL2 both of them approximate a convergence
rate of 1.8 (not exactly 2 but close enough), and for eH 1 again both methods present a similar value of
almost 1.

Figure 1. Convergence value and comparisson eL2

JESS

Homework 1

Page: 3

Figure 2. Convergence value and comparisson eH1


1.4.
If the hole was not traction-free, 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, 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. However for
XFEM this is not the case and therefore, for each element in the boundary:
Boundary internRshould be defined by approximating its position.
The line integral intern v t dintern computed and its contribution to each node added.

JESS

Homework 1

Page: 4

2. Problem 2
2.1.
Modify the given code to solve the problem using X-FEM. Briefly explain the modifications you have
done.
2.1.1. General description.
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 - for the elements completely contained within the domain.
D2 - for the elements completely out of the domain.
Int - for elements partially in the domain.
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. One for each interval.
Elements in D1 were integrated normally using their corresponding material properties, and its
contributions assembled in the global stiffness matrix.
Similarly for elements in D2, normal integration process and contributions added to the global
stiffness matrix.
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, since it was already prepared to calculate elementary
stiffness matrices accordingly to the information received)
2.2.
Compare the X-FEM solution with the one you obtained using a FEM mesh.
In order to make a fair comparison, similar meshes were used (approximately same number of nodes).
For FEM 5280 elements were used and for XFEM 5208. Visually the results are almost identical as seen
in figures 3 and 4; where displacements for direction v are plotted.
Now, when looking the same graph at a different angle (figures 5 6) small differences appear, with the
FEM solution having a better defined, clearer boundary. This is not necessarily due to a better solution
in the FEM solution, but simply a consequence of it having nodes defined on the boundary, and therefore
showing a clear change in results for each domain.
v

2
2

2
2
1
0
1
2

1.5

0.5

0.5

Figure 3. Dispacements v FEM

1.5

1
0
1
2

1.5

0.5

0.5

Figure 4. Dispacements v XFEM

1.5

JESS

Homework 1

Page: 5

1.5

0.5

0.5

1.5

1.5

0.5

0.5

1.5

Figure 5. Dispacements v FEM

Figure 6. Dispacements v XFEM


The plots provide a quick qualitative comparison, however a quantitative comparison is complementary. In figure 7 different mesh sizes were used and it was clear that for small number of elements, the
FEM solution presented a higher maximum error, but results were inverse for larger number of elements.
Although some differences appear, we could say that XFEM results are equally satisfactory as FEM ones.

Figure 7. Comparison FEM - XFEM max|errornodes |

References
(1) Fernandez-Mendez, S., & Huerta, A. (2004). Imposing essential boundary conditions in mesh-free
methods. Computer Methods in Applied Mechanics and Engineering, 193(12-14), 1257-1275.
(2) N. Sukumar, D. L. Chopp, N. Moes and T. Belytschko: Modeling holes and inclusions by level
sets in the extended finite-element method, Comput. Methods Appl. Mech. Engrg. 190(46-47),
6183 - 6200, 2001.

Anda mungkin juga menyukai