Adaptive Discrete Models of Functionally Represented Object Shapes

Zaporizhzhia National University 66 Zhukovsky Str., Zaporizhzhia, 69600, Ukraine Designers often use a numerical analysis of mechanical engineering product models. The analysis is based on partial differential equations. One of the most used numerical methods is the finite element method, in which the continuous object model is replaced by a discrete one. As a result, the first stage of modeling is the construction of a discrete object shape model as the final union of simple shapes. The distribution of elements in a discrete object shape model has a significant impact on the accuracy of numerical analysis. One of the most universal approaches to the computer modeling of object shapes is functional representation. This approach is based on using implicit functions to determine the set of points that corresponds to the object shape. Moreover, implicit functions for complex objects can be created constructively using combinations of simpler functions. For this, one can apply the real functions that are proposed in the R-functions theory and correspond to logical operations. Although functional representation makes it possible to check whether a point belongs to a set, it requires that methods for constructing discrete models be developed. In this paper, a method is proposed for constructing adaptive discrete models of object shapes represented functionally. This method uses an estimate of the accuracy of the finite element analysis to determine the areas where nodes and elements are refined. In the process of refinement, the refinement templates of elements are used that are proposed for the most common elements (triangles, quadrangles, tetrahedra and hexagons), with reprojection on the domain boundary of boundary nodes. Examples of constructing adaptive discrete models for solving twoand three-dimensional problems of studying stress-strain state are shown.


Introduction
One of the important parts of designing complex technical objects is studying their operational characteristics. In such industries as rocket production, shipbuilding, mechanical engineering, construction, etc., in designing, it becomes necessary to study the stress-strain state, strength or stability of structural elements. In this case, as a rule, modeling requires the use of the systems of partial differential equations that have no analytical solution. One of the most common numerical methods, the finite element method, is based on the idea of replacing a continuous model with its discrete analog. In this case, the object shape is modeled by a set of simple shapes (for example, tetrahedra or hexagons).
The first step in modeling the behavior of an object is to specify its shape. At the same time, one of the most universal approaches to the description of object shape models is the functional one [1][2][3]. It makes it possible to use implicit functions and logical operations with them to describe complex object shapes. However, in the general case, the implicitness and complexity of the resulting functions do not make it possible to directly generate discrete models. As a result, it is important to develop methods for constructing discrete object shape models that allow one to investigate their behavior with a given accuracy.
The aim of the research is to develop a method for constructing adaptive discrete object shape models that are represented functionally.
At present, highly effective methods have been proposed for constructing discrete shape models based on triangular [4], quadrilateral [5], tetrahedral [6], and hexagonal elements [7]. They make it possible to approximate geometric object features but do not take into account the accuracy of modeling object behavior.
To improve the accuracy of modeling, adaptive discrete models are used. The most common methods for constructing adaptive discrete models are based on a local increase in the number of nodes and elements [8], search for the optimal coordinates of nodes or approximation on finite elements by high-order functions [9]. Searching for the optimal coordinates of nodes, as a rule, does not allow one to significantly increase the accuracy of modeling independently and is used in conjunction with other methods. Increasing the number of nodes and elements in the worst approximating areas is most common. However, its use makes it necessary to correct the positions of the boundary nodes. Using a finite-element solution approximation by high-order functions improves the accuracy of modeling but significantly increases the algorithmic complexity and in some cases can lead to poor convergence of numerical solutions.

Functional approach to modeling object shapes
The main idea of the functional approach is to use implicit functions to represent the object shape. For example, the function greater than zero in the middle of the region bounded by a circle of radius r centered at the origin of coordinates is zero at the boundary of this region and less than zero at the points external to it. More complex forms can be described using R-functions [1][2][3], which correspond to logical operations. They are combined into systems, among which one of the most common is

Building discrete models of object shapes
Let there be an implicit function F corresponding to a certain object shape, and an initial discrete model B is constructed for the area completely including this object. In this case, B consists of the elements whose form corresponds to the required one. To generate a discrete model, one can use the following algorithm.
1. From the discrete model B, delete all the nodes in which the function F is less than or equal to zero, as well as the elements incident to these nodes.
2. For each boundary node from the discrete model B, calculate the direction of the search for the boundary as the arithmetic mean of the normals to the adjacent edges (edges in the two-dimensional case).
3. For each boundary node from the discrete model B, calculate the projection on the object boundary as the point of intersection of the ray with the vertex in this node and the direction coinciding with the normal found at the previous step. Move all the projections on the border, located at a small distance from the geometric object features to the corresponding points.
4. For each boundary face of the discrete model B, form the boundary elements that break the plane or volume formed by the boundary vertices and their projections. In the two-dimensional case, each boundary edge will correspond to a pair of vertices on the boundary. Accordingly, if B consists of quadrilaterals, then one quadrilateral is to be added to the model; if B consists of triangles, then a pair of triangles are to be added by drawing a diagonal in the quadrilateral formed by the vertices and their projections. In the threedimensional case, if B consists of tetrahedra, then the nodes of the boundary faces with their projections will form the triangular prisms, which are to be subdivided into three new tetrahedrons by drawing diagonals. If B consists of hexagons, then each quadrangular boundary face will correspond to a projection of four points on the boundary, which together form a new hexagon.
5. Move each internal node to the center of mass of the figure formed by neighboring nodes. Apply element-specific local transformations. Let us consider an example of constructing a discrete model of the flange shape based on a uniform initial mesh consisting of 45×30 nodes (Fig. 2). When using triangles, the model shown in Fig. 2, a will be obtained. When using quadrilaterals, the model shown in Fig. 2, b will be obtained.

Construction of Adaptive Discrete Object Shape Models
The models obtained using the algorithm described above do not take into account the approximation accuracy of the problem being solved. To do this, it is necessary to refine the discrete object shape model in the process of finite element analysis. Thus, in twodimensional models based on triangular elements, each triangle can be subdivided into four new ones by inserting nodes in the centers of its sides (Fig. 3). This scheme is known as the 'green triangles' scheme [10]. It makes it possible to perform a uniform refinement of discrete models based on triangular elements.

Fig. 3. Subdivision scheme for triangular elements
The 'green triangles' scheme can be generalized to the case of tetrahedra. By inserting new nodes in the centers of their sides, a tetrahedron can be subdivided into eight elements (Fig. 4). If a tetrahedron has a common edge with the subdivided one, then it is subdivided into two elements by inserting a new node into the center of the common edge. If a tetrahedron has a common face with the subdivided one, then it is subdivided into four elements by inserting new nodes in the centers of the edges that belong to the common face. Thus, for tetrahedra there are three refinement patterns. For the discrete models based on quadrangular elements, one can use the scheme for subdividing an element into nine parts (Fig. 5) [11]. At the same time, for the neighboring elements two templates will be enough. If a element has a common edge with the subdivided one, then it is subdivided into four parts. If the element touches the subdivided elements with its two adjacent edges, then it is subdivided into five parts. As a result, there are three basic patterns for quadrilaterals.
In the case of discrete models based on hexagonal elements, each hexagon subject to subdivision is subdivided into 27 parts (Fig. 6) [11]. If some element has an edge participating in the subdivision process, then it is subdivided into five parts. If an element has a face participating in the partition, then it is subdivided into thirteen parts. If the subdivision process involves three vertices belonging to the same face, then the element is subdivided into six parts. If the subdivision process involves six vertices belonging to two faces with a common edge, then this element is divided into five parts. In the latter two cases, elements are obtained to which one of the first two templates must be recursively applied.
As a result, each element shape has main types of templates described. In total, taking into account rotation, there are 8 of them for triangles, 16 for tetrahedrons and quadrangles, and 256 for hexagons. Accordingly, the following algorithm can be formulated.
1. For an object whose form is determined by the implicit function F, construct the initial discrete model B.
2. Using the finite element analysis, obtain an approximation of the desired quantity at the nodes of the discrete model B.
3. If there are elements for which the accuracy estimate obtained using the error function is greater than a given value of ε, then subdivide them and neighboring elements in accordance with the templates. Go to step 2. Otherwise -the end of the algorithm.

Fig. 8. Flange adaptive discrete model obtained as a result of using formula (2)
As a test example, consider the problem of studying the stress-strain state of a flange (Fig. 7). In dimensionless values, the thickness is assumed to be 20, Young's modulus is 200,000, and Poisson's ratio is 0.33. The flange is believed to be under the action of a force uniformly distributed over a hole of radius 30, with an intensity of 20, and the force vector coinciding with the x-axis. Both holes of radius 10 are rigidly fixed.
As a result of the finite element analysis of the flange plane-stressed state, it was found that when us-  (Fig. 7, b).
Common techniques for determining the areas for refining the number of nodes and elements use different estimates of the accuracy of the result. The simplest way of estimating accuracy (with an unknown exact solution) is to compare the change in nodal values with the average value on the element [12]. In this case, the error function used in the adaptive finite element analysis algorithm will take the form where e is an element; |e| is the number of vertices in the element; C is a vector of nodal values. When using formula (2) in the algorithm for constructing an adaptive discrete model (if C is the length of the displacement vector, the limit on the maximum permissible error on the element is ε=0.4), as a result of three iterations for the two forms of finite elements, the refinement will be around holes of radius 10 (Fig. 8).
In the practice of engineering analysis there arises not only the task of studying the stress-strain state, but also strength of structures. In this case, areas of greatest stress intensity are of fundamental interest to the researcher. Accordingly, it is necessary to refine discrete models in the areas with the greatest change in stress intensity (or another scalar of interest to the researcher). At ε=0.2, if C is the von Mises stress intensity σ i , then for the to forms of finite elements the refinement will be in the vicinity of the hole of radius 30, where the largest relative change is σ i (Fig. 9).
To study the stress-strain state of the flange in the three-dimensional setting, one can use the function In the three-dimensional case, when using models based both on tetrahedra and hexahedra (Fig. 10) for the adaptive finite element analysis, if the limit on the maximum permissible error on the element is ε=0.2 and C is the von Mises stress intensity σ i , then the refinement zones will be similar to the two-dimensional ones presented above . а б Fig. 9. Adaptive discrete flange model obtained as a result of using stress intensity to control accuracy

Work Discussion
It should be noted that the difference between the numerical values in the extreme stress values between a conventional and an adaptive analysis is a few percent. If we compare the results for the plane-stressed state with those for three-dimensional models, we obtain a difference of about 10%, which is explained by the simplified hypotheses used for the two-dimensional case.
The results obtained in this work, in contrast to [4][5][6][7], allow one to construct discrete models for object shapes, taking into account not only the geometric features, but also the accuracy of approximation of the value of interest to the researcher.

Conclusions
Thus, the main scientific result of the research is a new method for constructing adaptive discrete models of object shapes that have been represented functionally. The proposed method, unlike the existing ones, is based on the analysis of the finite element method results, and not only on geometric information.
The method algorithm can be used to construct adaptive discrete models based on arbitrary shape elements. It is based on the idea of using patterns to reconstruct discrete models of geometric objects. Numerical convergence is confirmed by comparing the results for the models based on elements of various shapes and having different numbers of elements, as well as comparing two-dimensional and threedimensional cases.
Prospects for further research are related to the use of machine learning methods to predict the areas in which discrete models need to be refined.
This work was carried out as part of research on the state budget theme "Development of software for engineering analysis of aerospace technology objects based on cloud technologies", 0117U007204.