  The presented article contains a 2D mesh generation routine optimized with
the Metropolis algorithm. The procedure enables to produce meshes with a
prescribed size h of elements. These finite element meshes can serve as
standard discrete patterns for the Finite Element Method (FEM). Appropriate
meshes together with the FEM approach constitute an effective tool to deal with
differential problems. Thus, having them both one can solve the 2D Poisson
problem. It can be done for different domains being either of a regular
(circle, square) or of a non--regular type. The proposed routine is even
capable to deal with non--convex shapes.
