The one of the most important issues to define is the domain boundary. After determining the boundary Γ_{A} by the initial *constant* nodes (lines 1-18 of the presented below algorithm), the next task is to determine which new nodes are lying on boundary line segments Γ (as it is visible in Fig. 4). These selection is done with a help of the following algorithm:

- For an initial node table
*p*(nodes from 1 to N) find all pairs of neighbouring vertices. - Connect them by a segment line. If
*x*then a function_{1}- x_{2}≠ 0*y=ax+b*exists and one can find pairs*a, b*for each such a line segment otherwise a vertical line*x = a*together with limits*[y*must be found._{1}, y_{2}] - Establish the table of coefficients
*a, b*. - For each new node check whether its coordinates (
*x, y*) fulfill any of*y=ax + b*equations or*x = a*where*y < y*and_{2}*y > y*_{1} - If yes classify it as a boundary node else classify it as an internal node.

Fig. 4 presents the square domain divided into a set of new elements Ω^{i} with corresponding set of line segments Γ^{i} being its boundary. A way of finding new nodes constitutes the main point of the mesh generation process (see Sec. 3.2) while a selection of nodes is perform according to the algorithm from Sec. 3.3 a) nodes *a,b,c,d* have been classified as boundary nodes whereas b) nodes *e,f,g* have been determined as internal nodes.

^{^}O. C. Zienkiewicz, R. L. Taylor and J. Z. Zhu,*The Finite Element Method: Its Basis and Fundamentals, Sixth edition.*, Elsevier 2005