# Finite Element Method - 2D Mesh Generator - Metfem2D

## Generator Optimization via the Metropolis method

Let us define the set of mesh triangles Ω = { Tj, j = 1, 2, …, M } and a set Ti of triangle mesh elements to which a node pi belongs. The closest neighbours C(pi) of the mesh point pi are defined as a subset of mesh points pjP

 ∀ pi ∃ Ti ⊂ Ω: pi ∈ Ti C(pi) = { pj: pj ∈ Ti where pj ≠ pi }.

Note, that the closest region is not the same what the Voronoi region [1]. Presented definition is needed to proceed with the Metropolis algorithm [2] which will be applied in order to adjust triangle's area to the desired size given by the element size h.
In turn, a proper triangulation is the essence of the finite element method as it is stated in the Sec. 2. Let us divide the whole problem into two different tasks. The first one focuses on finding an optimization for mesh elements being the internal elements whereas the second one is developed for so – called the edge elements. They are the elements for which one triangle's bar belongs to the boundary Γ of the domain Ω. It is assumed that a proper triangulation gives a discrete set of triangles Tj which approximates the domain Ω well.

### References

1. ^ O. C. Zienkiewicz, R. L. Taylor and J. Z. Zhu, The Finite Element Method: Its Basis and Fundamentals, Sixth edition., Elsevier 2005
2. ^N. Metropolis, S. Ulam, The Monte Carlo Method, J. Amer. Stat. Assoc., 44, No. 247., pp. 335-341, 1949