Structured quadrilateral mesh layout optimization method and device, equipment and medium
By automatically updating the two-family function values of the structured quadrilateral mesh layout on the target surface until the harmonic function converges locally, the problem of grid layout division in the existing technology depends on manual experience, and the optimization efficiency and quality are improved.
Patent Information
- Application Number
- CN202411557449.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-01
- Publication Date
- 2025-02-07
AI Technical Summary
In the prior art, the division of structured quadrilateral mesh layouts depends on manual experience, which consumes time and is difficult to guarantee.
The quadrilateral mesh layout is automatically optimized by determining the initial two-family function values for each vertex of each triangle in the target surface and updating the two-family function values based on these values until the harmonic function converges locally.
Automatic optimization without relying on manual experience is achieved, the quality and optimization efficiency of grid layout are improved, and the calculation amount is reduced.
Smart Images

Figure CN119399405A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of numerical simulation technology, and in particular to a structured quadrilateral grid layout optimization method, device, equipment and medium. Background Art
[0002] Structured quadrilateral mesh is a discretization method widely used in various numerical simulations of CAE (Computer Aided Engineering), and the key to generating structured quadrilateral mesh is to calculate the mesh layout.
[0003] At present, most simulation software provides a human-computer interaction interface, and technicians can obtain a structured quadrilateral grid layout by manually dividing the grid layout. However, this method relies too much on manual experience, is time-consuming, and the quality of the quadrilateral grid layout division is difficult to guarantee. Summary of the invention
[0004] The present invention provides a structured quadrilateral grid layout optimization method, device, equipment and medium, which can automatically optimize the structured quadrilateral grid layout and improve the optimization quality and efficiency.
[0005] According to one aspect of the present invention, a structured quadrilateral grid layout optimization method is provided, comprising:
[0006] According to the initial quadrilateral mesh layout of the target surface, the preset horizontal width value and the vertical height value, respectively determine the initial two-family function values of each vertex of each triangular face in the target surface;
[0007] According to the initial quadrilateral mesh layout of the target surface, the initial two-family function value of each vertex and the harmonic weight of each second vertex adjacent to the first vertex, the two-family function value of each vertex in the target surface is updated, and the contour line is extracted according to the updated current two-family function value, and the current quadrilateral mesh layout of the target surface is obtained according to the contour line;
[0008] According to the current two-family function values of each vertex and the two-family function values of the previous round, it is determined whether the harmonic function of the current quadrilateral grid layout is locally converged;
[0009] If so, the current quadrilateral mesh layout of the target surface is used as the optimized structured quadrilateral mesh layout;
[0010] If not, the two-family function values of each vertex and the quadrilateral mesh layout of the target surface are updated multiple times according to the current quadrilateral mesh layout, the current two-family function values of each vertex, and the harmonic weights of each second vertex adjacent to the first vertex, until the harmonic functions of the current quadrilateral mesh layout are locally converged.
[0011] According to another aspect of the present invention, there is provided a structured quadrilateral grid layout optimization device, comprising:
[0012] An initial two-family function value determination module is used to determine the initial two-family function values of each vertex of each triangular face in the target surface according to the initial quadrilateral mesh layout of the target surface, the preset horizontal width value and the vertical height value;
[0013] A quadrilateral mesh layout updating module is used to update the two-family function value of each vertex in the target surface according to the initial quadrilateral mesh layout of the target surface, the initial two-family function value of each vertex, and the harmonic weight of each second vertex adjacent to the first vertex, and extract contour lines according to the updated current two-family function value, and obtain the current quadrilateral mesh layout of the target surface according to the contour lines;
[0014] A harmonic function judgment module is used to judge whether the harmonic function of the current quadrilateral grid layout is locally converged according to the current two-family function value of each vertex and the two-family function value of the previous round;
[0015] a structured quadrilateral mesh layout determination module, for, if yes, using the current quadrilateral mesh layout of the target surface as the optimized structured quadrilateral mesh layout;
[0016] The loop iteration module is used to update the two-family function value of each vertex and the quadrilateral mesh layout of the target surface for multiple rounds according to the current quadrilateral mesh layout, the current two-family function value of each vertex and the harmonic weights of each second vertex adjacent to the first vertex, until the harmonic function of the current quadrilateral mesh layout is locally converged.
[0017] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:
[0018] at least one processor; and
[0019] a memory communicatively connected to the at least one processor; wherein,
[0020] The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the structured quadrilateral mesh layout optimization method described in any embodiment of the present invention.
[0021] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the structured quadrilateral mesh layout optimization method described in any embodiment of the present invention when executed.
[0022] The technical solution of the embodiment of the present invention determines the initial two-family function values of each vertex of each triangular face in the target surface respectively, updates the two-family function values of each vertex in the target surface according to the initial quadrilateral mesh layout, the initial two-family function values of each vertex and the harmonic weights of each second vertex adjacent to the first vertex, extracts contour lines according to the updated current two-family function values, obtains the current quadrilateral mesh layout of the target surface according to the contour lines, judges whether the harmonic function of the current quadrilateral mesh layout is locally converged after each update of the quadrilateral mesh layout, and when the harmonic function is locally converged, uses the current quadrilateral mesh layout of the target surface as the optimized structured quadrilateral mesh layout, and when the harmonic function is not converged, updates the two-family function values of each vertex and the quadrilateral mesh layout of the target surface for multiple rounds until the harmonic function is locally converged. This method can optimize the structured quadrilateral mesh layout in an automated manner without relying on manual experience, thereby improving the quality and optimization efficiency of the structured quadrilateral mesh layout and greatly reducing the amount of calculation.
[0023] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0025] Figure 1 is a flow chart of a structured quadrilateral grid layout optimization method provided according to Embodiment 1 of the present invention;
[0026] Figure 2 is a schematic diagram of contour line division of quadruple coverage provided according to an embodiment of the present invention;
[0027] Figure 3 is a schematic diagram of a structured quadrilateral grid layout provided according to an embodiment of the present invention;
[0028] Figure 4 is a schematic diagram of a medium triangle mesh provided according to an embodiment of the present invention;
[0029] Figure 5 is a flow chart of another structured quadrilateral grid layout optimization method provided according to the second embodiment of the present invention;
[0030] Figure 6 is a schematic diagram of the structure of a structured quadrilateral grid layout optimization device provided according to Embodiment 3 of the present invention;
[0031] Figure 7 It is a schematic diagram of the structure of an electronic device for implementing the structured quadrilateral grid layout optimization method according to an embodiment of the present invention. DETAILED DESCRIPTION
[0032] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0033] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0034] Embodiment 1
[0035] Figure 1 This is a flow chart of a structured quadrilateral mesh layout optimization method provided in the first embodiment of the present invention. This embodiment is applicable to the case of optimizing the quadrilateral mesh layout of a curved surface in an automated manner. The method can be executed by a structured quadrilateral mesh layout optimization device. The structured quadrilateral mesh layout optimization device can be implemented in the form of hardware and / or software and can generally be configured in a computer or processor with data processing capabilities. Figure 1 As shown, the method includes:
[0036] S110 , determining initial two-family function values of each vertex of each triangular face in the target surface according to the initial quadrilateral mesh layout of the target surface, the preset horizontal width value, and the vertical height value.
[0037] It can be understood that by dividing the model through quadrilateral meshes, the complex physical system can be discretized into a finite number of small units for numerical calculation and analysis.
[0038] From mathematical theory, it is known that a closed quadrilateral mesh induces a conformal atlas, making the surface a Riemann surface. It can be proved that there are globally defined meromorphic fourth differentials on this Riemann surface. Except for the singular point position, there are locally holomorphic first differentials in other parts of the Riemann surface, and there are globally defined holomorphic first differentials on the quadruple cover. Therefore, the inventors of the present application noticed that there are two families of locally harmonic functions, and the contours of the harmonic functions give the optimized quadrilateral mesh layout.
[0039] The inventor of the present application creatively proposed an optimization method for quadrilateral grid layout, namely: split the model along singular lines to obtain a single coverage, and obtain a quadruple coverage based on branch bonding lines and the single coverage; determine the horizontal contour line distribution and the vertical contour line distribution on each layer of the quadruple coverage respectively, and obtain the target horizontal contour lines on the first target layer in the quadruple coverage, and obtain the target vertical contour lines on the second target layer; according to the target horizontal contour lines and the target vertical contour lines, after mapping the two-dimensional surface to the three-dimensional physical space, the structured quadrilateral of the model can be obtained.
[0040] Figure 2 This is a schematic diagram of an optional quadruple coverage contour division. Figure 2 As shown in the figure, cut the 3D model in the upper left corner along the darker singular line and flatten it to obtain the following Figure 2 The single-layer cover shown in the lower left corner has darker lines on it, which are branch bonding lines. By bonding four single-layer covers of the same shape along the branch bonding lines, we can obtain a quadruple cover. Each layer of the quadruple cover is as follows: Figure 2 The four figures on the right of are respectively represented. The lines marked with numbers in the figures are contour lines of different values. Contour lines can represent harmonic functions. The vertical lines can be regarded as vertical contour lines, and the horizontal lines can be regarded as horizontal contour lines. In fact, the horizontal contour lines and vertical contour lines are calculated once in each layer, that is, each layer has two families of harmonic functions. Therefore, for quadruple coverage, it is calculated 8 times, that is, two sets of harmonic functions are calculated in each of the four layers. However, when determining the quadrilateral grid layout, if two contour lines are extracted in each layer, then the contour lines of the four layers will form an overlapping quadrilateral grid layout. Therefore, it is only necessary to take a horizontal contour line of the target horizontal value in a certain layer, and then take a vertical contour line of the target vertical value in a certain layer. The quadrilateral grid layout can be determined based on these two contour lines. For example, a vertical contour line with a value of 0 is extracted in the first layer, and a horizontal contour line with a value of 0 is extracted in the second layer. The quadrilateral grid layout can be determined based on these two lines.
[0041] However, although the above method can optimize the grid layout of quadrilaterals, it is obvious that the calculation on the quadruple cover contains redundant data and the amount of calculation is large. Therefore, based on the above findings, the inventors of the present application further proposed a method for optimizing the grid layout of quadrilaterals by only calculating two families of function values. The purpose of this method is to obtain two families of mutually perpendicular harmonic functions on each quadrilateral piece. The two families of function values can be saved only for each vertex. By recording the connection relationship of the quadrilateral pieces and specifying the branch bonding lines, the increase or decrease of the harmonic function can be determined by recording the gradient direction of the harmonic function on the quadrilateral piece.
[0042] Figure 3 is a schematic diagram of an optional structured quadrilateral grid layout. Figure 3 As shown, quadrilateral meshing is performed on the surface of the three-dimensional model, and after the division, singular points are determined, and then the singular points are connected to obtain singular trajectories. Figure 3 The darker ones are singular trajectories, and the lighter ones are used to divide the quadrilateral grid.
[0043] Optionally, in a quadrilateral grid layout, for a point of a quadrilateral piece, if the number of quadrilateral pieces adjacent to it is not 4, the point is determined as a singular point, and the line connecting the singular points can be used as a singular trajectory.
[0044] Optionally, the target surface can be the outer surface of a 3D model. In the prior art, after obtaining the 3D model, the surface of the 3D model can be preliminarily divided to obtain the initial quadrilateral mesh layout of the target surface. The quadrilateral mesh layout can divide the surface into multiple adjacent and non-overlapping initial quadrilateral pieces, but the initial layout may not meet the requirements of structured quadrilateral mesh generation, that is, a rectangular quadrilateral mesh cannot be globally constructed on it. Therefore, quadrilateral mesh layout optimization is required.
[0045] Optionally, the horizontal width value and the vertical height value are preset values of the user, which can indicate the user's expectation of the size of the final divided quadrilateral pieces. For example, when the horizontal width values of two quadrilateral pieces are set to 2 and 3 respectively, the horizontal ratio of the two optimized quadrilateral pieces outputted finally is 2:3.
[0046] Figure 4 is a schematic diagram of an optional medium triangle mesh. In existing model processing software, the target surface can be divided into Figure 4 The triangular mesh structure shown in the figure is composed of multiple triangular facets, and the quadrilateral mesh layout is calculated on the triangular mesh.
[0047] Optionally, after obtaining the initial quadrilateral grid layout, the gradient of the harmonic function on each quadrilateral piece can be determined according to the branch bonding line. The gradient can be a positive gradient or a negative gradient. For a quadrilateral piece with a positive gradient, the horizontal value increases from left to right and the vertical value increases from top to bottom. For a quadrilateral piece with a negative gradient, the horizontal value decreases from left to right and the vertical value decreases from top to bottom. However, both the increase and decrease are relative, and the positive gradient and the negative gradient can be opposite.
[0048] In an optional example, when the quadrilateral patch has a positive gradient and the horizontal width value and the vertical height value are 2 respectively, a dual layout can be constructed in the quadrilateral patch, that is, the quadrilateral patch is divided into two pieces in the horizontal direction and the left and right pieces in the vertical direction, that is, four partitions of the quadrilateral patch are obtained. At this time, the initial two-family function values of each vertex in the upper left partition can be set to (0,0), the two-family function values of each vertex in the lower left partition can be set to (0,2), the two-family function values of each vertex in the upper right partition can be set to (2,0), and the lower right partition is (2,2). The negative gradient is set oppositely, which is not elaborated here.
[0049] S120. Update the two-family function value of each vertex in the target surface according to the initial quadrilateral mesh layout of the target surface, the initial two-family function value of each vertex, and the harmonic weights of each second vertex adjacent to the first vertex, extract contour lines according to the updated current two-family function value, and obtain the current quadrilateral mesh layout of the target surface according to the contour lines.
[0050] Optionally, the two-family function value of the target vertex can be taken as the harmonic mean of the two-family function values of all vertices in its 1-neighborhood, that is, the harmonic mean of the horizontal values of all vertices in the 1-neighborhood is calculated as the horizontal value of the target vertex, and the vertical value is calculated in a similar way.
[0051] Optionally, the first vertex may refer to a target vertex for which the harmonic mean is currently being calculated, and the second vertex may refer to other vertices in the 1-neighborhood of the first vertex.
[0052] Optionally, since the distance between each second vertex and the first vertex is different, different weights are configured for each second vertex with respect to the first vertex, for example, the cotan edge weight is used to set the weight of the second vertex.
[0053] It can be understood that, since the horizontal height value and the vertical width value are set in advance, the two-family function values of the vertices inside each quadrilateral piece are calculated separately. Taking the initial two-family function values mentioned above as an example, for quadrilateral piece 1, the initial function values of the vertices at its upper left corner are all (0, 0), and for quadrilateral piece 2, the initial function values of the vertices at its upper left corner are also (0, 0). It can be seen that the two-family function value of the vertex depends only on its position inside the quadrilateral piece, not on the positional relationship between the two quadrilateral pieces. Therefore, if the first vertex and the target second vertex are not in the same quadrilateral piece, the two-family function value of the target second vertex can be extended, and the extension result is only used to calculate the first vertex, that is, as its temporary two-family function value.
[0054] In an optional example, if the horizontal height value and the vertical width value are both set to 2, the two-family function value of the first vertex is (1.9, 1.9), the target second vertex is in a quadrilateral piece with the same gradient on its right, and the two-family function value of the target second vertex is (0.1, 1.8), then the temporary two-family function value of the target second vertex can be set to (2.1, 3.8).
[0055] Optionally, when updating the two-family function values of each vertex in each round, whether the second vertex is extended or not, it is calculated based on the calculation results of the two-family function values in the previous round. That is, even if the two-family function values of a vertex have been updated in this round of updates, if the vertex also participates in the harmonic mean calculation of other vertices, then when calculating other vertices, the two-family function values of the vertex before the update are still used.
[0056] Optionally, after a round of updating of the two families of function values at each vertex of the target surface is completed, each point with a specified horizontal value and a specified vertical value can be determined in the target surface according to the interpolation method, and the lines connecting these points can be determined as horizontal contour lines and vertical contour lines, respectively.
[0057] S130, judging whether the harmonic function of the current quadrilateral grid layout is locally converged according to the current two-family function value of each vertex and the two-family function value of the previous round; if so, executing step S140; if not, executing step S150.
[0058] Optionally, for the target vertex, the horizontal difference and vertical difference between the current two-family function values and the two-family function values of the previous round can be calculated. If the horizontal difference and the vertical difference are both within the preset thresholds, it is determined that the target vertex is locally converged. When all vertices on the target surface are locally converged, it can be determined that the harmonic function is locally converged. If there is at least one vertex that is not locally converged, the harmonic function does not converge.
[0059] S140: Using the current quadrilateral mesh layout of the target surface as the optimized structured quadrilateral mesh layout.
[0060] Optionally, when the harmonic function converges locally, the current quadrilateral grid layout is a better layout.
[0061] S150, according to the current quadrilateral mesh layout, the current two-family function value of each vertex and the harmonic weights of each second vertex adjacent to the first vertex, the two-family function value of each vertex and the quadrilateral mesh layout of the target surface are updated for multiple rounds until the harmonic functions of the current quadrilateral mesh layout are converged.
[0062] Optionally, when the harmonic function has not converged, the next round of updating of the two-family function values of vertices can be continued, and based on the updated two-family function values of each vertex, it can be determined again whether the harmonic function has converged, until the target round ends and the harmonic function converges locally, then the updating of the two-family function values is terminated.
[0063] Optionally, when updating the two-family function values of each vertex in the current round, the two-family function value of the first vertex needs to calculate the harmonic mean based on the two-family function values of each adjacent second vertices calculated in the previous round, even if one or several of the second vertices have had their two-family function values updated in this round.
[0064] Optionally, after the two sets of function values of each vertex in each round are updated, it is necessary to determine the quadrilateral mesh layout of the current round based on the two sets of function values of each vertex in the current round, and number each quadrilateral piece for use in the next round of updating the two sets of function values.
[0065] The technical solution of the embodiment of the present invention determines the initial two-family function values of each vertex of each triangular face in the target surface respectively, updates the two-family function values of each vertex in the target surface according to the initial quadrilateral mesh layout, the initial two-family function values of each vertex and the harmonic weights of each second vertex adjacent to the first vertex, extracts contour lines according to the updated current two-family function values, obtains the current quadrilateral mesh layout of the target surface according to the contour lines, judges whether the harmonic function of the current quadrilateral mesh layout is locally converged after each update of the quadrilateral mesh layout, and when the harmonic function is locally converged, uses the current quadrilateral mesh layout of the target surface as the optimized structured quadrilateral mesh layout, and when the harmonic function is not converged, updates the two-family function values of each vertex and the quadrilateral mesh layout of the target surface for multiple rounds until the harmonic function is locally converged. This method can optimize the structured quadrilateral mesh layout in an automated manner without relying on manual experience, thereby improving the quality and optimization efficiency of the structured quadrilateral mesh layout and greatly reducing the amount of calculation.
[0066] Embodiment 2
[0067] Figure 5 This is a flow chart of a structured quadrilateral mesh layout optimization method provided in the second embodiment of the present invention. This embodiment specifically describes the structured quadrilateral mesh layout optimization method based on the above embodiment. Figure 5 As shown, the method includes:
[0068] S210, determining the position of the branch bonding line on the target surface according to the initial quadrilateral grid layout, and determining the gradient of the harmonic function on each initial quadrilateral patch according to the positional relationship between each initial quadrilateral patch and the branch bonding line on the target surface.
[0069] Optionally, determining the branch bonding line position on the target surface according to the initial quadrilateral mesh layout may include:
[0070] According to the initial quadrilateral grid layout, target singular points and singular trajectories are determined, and a cut graph of the target surface is calculated;
[0071] The shortest connection line between the target singular point and the cut graph is determined, and a target singular trajectory that is closest to the shortest connection line is determined, and the target singular trajectory is determined as a branch bonding line.
[0072] Optionally, the cut graph may refer to a graph formed by a secant trajectory that cuts the surface into 0 genus. After the cut graph is determined, the secant may be regressed to the singular trajectory closest to the secant.
[0073] Optionally, a singular point can be arbitrarily selected as the target singular point in the initial quadrilateral grid layout, and the shortest line between the target singular point and the cut graph can be used as the branch bonding line. However, in the present application, the shortest line is returned to the singular trajectory, that is, the singular trajectory closest to the shortest line is determined as the branch bonding line.
[0074] Optionally, since the branch bonding line regresses to the singular trajectory, the branch bonding line does not pass through the interior of the quadrilateral piece and can only be the edge of the quadrilateral piece. When the first quadrilateral piece and the second quadrilateral piece need to cross the branch bonding line, the second quadrilateral piece is set to have a gradient opposite to that of the first quadrilateral piece. For example, if quadrilateral piece 1, quadrilateral piece 2, quadrilateral piece 3 and quadrilateral piece 4 are arranged in sequence, and the intersection line of quadrilateral piece 2 and quadrilateral piece 3 is the branch bonding line, when quadrilateral piece 1 has a positive gradient, quadrilateral piece 2 also has a positive gradient, and quadrilateral piece 3 and quadrilateral piece 4 have negative gradients.
[0075] S220, constructing a dual layout in each initial quadrilateral patch, and determining initial two-family function values of each vertex in the initial quadrilateral patch according to the dual layout, the gradient of the harmonization function on the initial quadrilateral patch, a preset horizontal width value, and a vertical height value.
[0076] S230, determining temporary two-family function values of each second vertex when calculating the first vertex according to the numbers of the initial quadrilateral pieces where the first vertex and each second vertex are located, and the initial two-family function values of each second vertex.
[0077] Optionally, determining the temporary two-family function values of each second vertex when calculating the first vertex according to the numbers of the initial quadrilateral pieces where the first vertex and each second vertex are located, and the initial two-family function values of each second vertex, may include any of the following:
[0078] When it is determined according to the number that the first vertex and each second vertex are all located in the same initial quadrilateral piece, the initial two-family function value of each second vertex is determined as a temporary two-family function value; and
[0079] When it is determined based on the numbering that the first vertex and at least one second vertex are located in different initial quadrilateral patches, the initial two-family function values of each target second vertex are extended based on the gradient of the harmonic function on the initial quadrilateral patch where the first vertex is located, the gradient of the harmonic function on the initial quadrilateral patch where each target second vertex is located, the horizontal width value, and the vertical height value to determine the temporary two-family function values of each target second vertex; wherein the target second vertex and the first vertex are located in different initial quadrilateral patches.
[0080] S240 , calculating a harmonic mean value according to the harmonic weights of each second vertex and the temporary two-family function value, and using the harmonic mean value as the current two-family function value of the first vertex.
[0081] S250. After the two-family function values of each vertex in the target surface are updated, the points whose horizontal values are the first value are connected in the current two-family function values through the interpolation algorithm to obtain horizontal contour lines, and the points whose vertical values are the second value are connected to obtain vertical contour lines.
[0082] Optionally, the first value and the second value are the function values of the horizontal contour line and the function values of the vertical contour line pre-selected by the user, respectively. For example, the first value and the second value can be set to 0, and then points with horizontal values of 0 are determined in the target surface, and these points are connected to form horizontal contour lines, and vertical contour lines are determined in a similar way.
[0083] Optionally, after the two families of function values of the vertices of each triangle are updated, the horizontal value and the vertical value of each vertex may not be an integer. At this time, the interpolation method can be used to determine the points with horizontal values of the first value and the points with vertical values of the second value on the target surface.
[0084] S260: Determine the current quadrilateral grid layout of the target surface according to the horizontal contour lines and the vertical contour lines.
[0085] Optionally, after completing the update of the two families of function values of each vertex, the steps of calculating the horizontal contour lines and the vertical contour lines can be omitted, and the contour lines can be accurately calculated only after the optimized quadrilateral grid layout is finally determined. Therefore, after executing step S240, another optional implementation is to directly execute step S270.
[0086] S270, judging whether the harmonic function of the current quadrilateral grid layout is locally converged according to the current two-family function value of each vertex and the two-family function value of the previous round; if so, executing step S280; if not, executing step S290.
[0087] Optionally, judging whether the harmonic function converges according to the current two-family function value of each vertex and the two-family function value of the previous round may include:
[0088] According to the current two-family function value of the target vertex and the two-family function value of the previous round, the horizontal difference and vertical difference of the target vertex are calculated respectively;
[0089] When it is determined that the horizontal difference and the vertical difference of all vertices on the target surface are less than a preset threshold, it is determined that the harmonic function is locally converged.
[0090] Optionally, whether the harmonic function converges can be determined by calculating the minimum square error, mean square error, etc. between the current two-family function values of each vertex and the two-family function values of the previous round. The method for determining the convergence of the harmonic function is not limited here.
[0091] S280: Use the current quadrilateral mesh layout of the target surface as the optimized structured quadrilateral mesh layout.
[0092] S290, according to the current quadrilateral mesh layout, the current two-family function value of each vertex and the harmonic weights of each second vertex adjacent to the first vertex, the two-family function value of each vertex and the quadrilateral mesh layout of the target surface are updated for multiple rounds until the harmonic functions of the current quadrilateral mesh layout converge.
[0093] The technical solution of the embodiment of the present invention determines the initial two-family function values of each vertex of each triangular face in the target surface respectively, updates the two-family function values of each vertex in the target surface according to the initial quadrilateral mesh layout, the initial two-family function values of each vertex and the harmonic weights of each second vertex adjacent to the first vertex, extracts contour lines according to the updated current two-family function values, obtains the current quadrilateral mesh layout of the target surface according to the contour lines, judges whether the harmonic function of the current quadrilateral mesh layout is locally converged after each update of the quadrilateral mesh layout, and when the harmonic function is locally converged, uses the current quadrilateral mesh layout of the target surface as the optimized structured quadrilateral mesh layout, and when the harmonic function is not converged, updates the two-family function values of each vertex and the quadrilateral mesh layout of the target surface for multiple rounds until the harmonic function is locally converged. This method can optimize the structured quadrilateral mesh layout in an automated manner without relying on manual experience, thereby improving the quality and optimization efficiency of the structured quadrilateral mesh layout and greatly reducing the amount of calculation.
[0094] Embodiment 3
[0095] Figure 6 This is a schematic diagram of the structure of a structured quadrilateral grid layout optimization device provided in Embodiment 3 of the present invention. Figure 6 As shown, the device includes: an initial two-family function value determination module 310, a quadrilateral grid layout update module 320, a harmonic function judgment module 330, a structured quadrilateral grid layout determination module 340 and a loop iteration module 350.
[0096] The initial two-family function value determination module 310 is used to determine the initial two-family function values of each vertex of each triangle patch in the target surface according to the initial quadrilateral mesh layout of the target surface, the preset horizontal width value and the vertical height value.
[0097] The quadrilateral mesh layout update module 320 is used to update the two-family function value of each vertex in the target surface according to the initial quadrilateral mesh layout of the target surface, the initial two-family function value of each vertex and the harmonic weight of each second vertex adjacent to the first vertex, and extract contour lines according to the updated current two-family function value, and obtain the current quadrilateral mesh layout of the target surface according to the contour lines.
[0098] The harmonic function determination module 330 is used to determine whether the harmonic function of the current quadrilateral mesh layout is locally converged according to the current two-family function value of each vertex and the two-family function value of the previous round.
[0099] The structured quadrilateral mesh layout determining module 340 is configured to, if yes, use the current quadrilateral mesh layout of the target surface as the optimized structured quadrilateral mesh layout.
[0100] The loop iteration module 350 is used to update the two-family function value of each vertex and the quadrilateral mesh layout of the target surface for multiple rounds according to the current quadrilateral mesh layout, the current two-family function value of each vertex and the harmonic weights of each second vertex adjacent to the first vertex, until the harmonic functions of the current quadrilateral mesh layout converge.
[0101] The technical solution of the embodiment of the present invention determines the initial two-family function values of each vertex of each triangular face in the target surface respectively, updates the two-family function values of each vertex in the target surface according to the initial quadrilateral mesh layout, the initial two-family function values of each vertex and the harmonic weights of each second vertex adjacent to the first vertex, extracts contour lines according to the updated current two-family function values, obtains the current quadrilateral mesh layout of the target surface according to the contour lines, judges whether the harmonic function of the current quadrilateral mesh layout is locally converged after each update of the quadrilateral mesh layout, and when the harmonic function is locally converged, uses the current quadrilateral mesh layout of the target surface as the optimized structured quadrilateral mesh layout, and when the harmonic function is not converged, updates the two-family function values of each vertex and the quadrilateral mesh layout of the target surface for multiple rounds until the harmonic function is locally converged. This method can optimize the structured quadrilateral mesh layout in an automated manner without relying on manual experience, thereby improving the quality and optimization efficiency of the structured quadrilateral mesh layout and greatly reducing the amount of calculation.
[0102] Based on the above embodiments, the initial two-family function value determination module 310 may include:
[0103] A gradient determination unit, used to determine the position of the branch bonding line on the target surface according to the initial quadrilateral grid layout, and determine the gradient of the harmonic function on each initial quadrilateral piece according to the positional relationship between each initial quadrilateral piece and the branch bonding line on the target surface;
[0104] The initial two-family function value calculation unit is used to construct a dual layout of the original quadrilateral layout, and determine the initial two-family function values of each vertex in the initial quadrilateral piece according to the dual layout, the gradient of the harmonization function on the initial quadrilateral piece, the preset horizontal width value and the vertical height value.
[0105] Based on the above embodiments, the gradient determination unit may be specifically used for:
[0106] According to the initial quadrilateral grid layout, target singular points and singular trajectories are determined, and a cut graph of the target surface is calculated;
[0107] The shortest connection line between the target singular point and the cut graph is determined, and a target singular trajectory that is closest to the shortest connection line is determined, and the target singular trajectory is determined as a branch bonding line.
[0108] Based on the above embodiments, the quadrilateral grid layout updating module 320 may include:
[0109] A temporary two-family function value calculation unit, used to determine the temporary two-family function values of each second vertex when calculating the first vertex according to the numbers of the initial quadrilateral pieces where the first vertex and each second vertex are located, and the initial two-family function values of each second vertex;
[0110] The current two-family function value calculation unit is used to calculate the harmonic mean value according to the harmonic weights of each second vertex and the temporary two-family function value, and use the harmonic mean value as the current two-family function value of the first vertex.
[0111] Based on the above embodiments, the temporary two-family function value calculation unit can be used to perform any of the following:
[0112] When it is determined according to the number that the first vertex and each second vertex are all located in the same initial quadrilateral piece, determining the initial two-family function value of each second vertex as a temporary two-family function value; and
[0113] When it is determined based on the numbering that the first vertex and at least one second vertex are located in different initial quadrilateral patches, the initial two-family function values of each target second vertex are extended based on the gradient of the harmonic function on the initial quadrilateral patch where the first vertex is located, the gradient of the harmonic function on the initial quadrilateral patch where each target second vertex is located, the horizontal width value, and the vertical height value to determine the temporary two-family function values of each target second vertex; wherein the target second vertex and the first vertex are located in different initial quadrilateral patches.
[0114] Based on the above embodiments, the quadrilateral grid layout updating module 320 may also be specifically used for:
[0115] After the two-family function values of each vertex in the target surface are updated, the points with the first value in the horizontal direction are connected by the interpolation algorithm to obtain the horizontal contour line, and the points with the second value in the vertical direction are connected to obtain the vertical contour line;
[0116] A current quadrilateral grid layout of the target surface is determined according to the horizontal contour lines and the vertical contour lines.
[0117] Based on the above embodiments, the harmonic function determination module 330 can be specifically used for:
[0118] According to the current two-family function value of the target vertex and the two-family function value of the previous round, the horizontal difference and vertical difference of the target vertex are calculated respectively;
[0119] When it is determined that the horizontal difference and the vertical difference of all vertices on the target surface are less than a preset threshold, it is determined that the harmonic function is locally converged.
[0120] The structured quadrilateral mesh layout optimization device provided in the embodiment of the present invention can execute the structured quadrilateral mesh layout optimization method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.
[0121] Embodiment 4
[0122] Figure 7 A schematic diagram of the structure of an electronic device 10 that can be used to implement an embodiment of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.
[0123] like Figure 7 As shown, the electronic device 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0124] A number of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0125] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The processor 11 executes the various methods and processes described above, such as the structured quadrilateral grid layout optimization method described in an embodiment of the present invention. That is:
[0126] According to the initial quadrilateral mesh layout of the target surface, the preset horizontal width value and the vertical height value, respectively determine the initial two-family function values of each vertex of each triangular face in the target surface;
[0127] According to the initial quadrilateral mesh layout of the target surface, the initial two-family function value of each vertex and the harmonic weight of each second vertex adjacent to the first vertex, the two-family function value of each vertex in the target surface is updated, and the contour line is extracted according to the updated current two-family function value, and the current quadrilateral mesh layout of the target surface is obtained according to the contour line;
[0128] According to the current two-family function values of each vertex and the two-family function values of the previous round, it is determined whether the harmonic function of the current quadrilateral grid layout is locally converged;
[0129] If so, the current quadrilateral mesh layout of the target surface is used as the optimized structured quadrilateral mesh layout;
[0130] If not, the two-family function values of each vertex and the quadrilateral mesh layout of the target surface are updated multiple times according to the current quadrilateral mesh layout, the current two-family function values of each vertex, and the harmonic weights of each second vertex adjacent to the first vertex, until the harmonic functions of the current quadrilateral mesh layout are locally converged.
[0131] In some embodiments, the structured quadrilateral mesh layout optimization method may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the structured quadrilateral mesh layout optimization method described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to execute the structured quadrilateral mesh layout optimization method in any other appropriate manner (e.g., by means of firmware).
[0132] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0133] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0134] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0135] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).
[0136] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.
[0137] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.
[0138] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.
[0139] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A structured quadrilateral grid layout optimization method, characterized in that: include: According to the initial quadrilateral mesh layout of the target surface, the preset horizontal width value and the vertical height value, respectively determine the initial two-family function values of each vertex of each triangular face in the target surface; According to the initial quadrilateral mesh layout of the target surface, the initial two-family function value of each vertex and the harmonic weight of each second vertex adjacent to the first vertex, the two-family function value of each vertex in the target surface is updated, and the contour line is extracted according to the updated current two-family function value, and the current quadrilateral mesh layout of the target surface is obtained according to the contour line; According to the current two-family function values of each vertex and the two-family function values of the previous round, it is determined whether the harmonic function of the current quadrilateral grid layout is locally converged; If so, the current quadrilateral mesh layout of the target surface is used as the optimized structured quadrilateral mesh layout; If not, the two-family function values of each vertex and the quadrilateral mesh layout of the target surface are updated multiple times according to the current quadrilateral mesh layout, the current two-family function values of each vertex, and the harmonic weights of each second vertex adjacent to the first vertex, until the harmonic functions of the current quadrilateral mesh layout are locally converged.
2. The method according to claim 1, characterized in that According to the initial quadrilateral mesh layout of the target surface, the preset horizontal width value and the vertical height value, the initial two families of function values of each vertex of each triangular face in the target surface are determined respectively, including: Determine the position of the branch bonding line on the target surface according to the initial quadrilateral grid layout, and determine the gradient of the harmonic function on each initial quadrilateral piece according to the positional relationship between each initial quadrilateral piece and the branch bonding line on the target surface; A dual layout is constructed in each initial quadrilateral patch, and initial two-family function values of each vertex in the initial quadrilateral patch are determined according to the dual layout, the gradient of the harmonization function on the initial quadrilateral patch, a preset horizontal width value, and a vertical height value.
3. The method according to claim 2, characterized in that Determining the branch bonding line position on the target surface according to the initial quadrilateral mesh layout includes: According to the initial quadrilateral grid layout, target singular points and singular trajectories are determined, and a cut graph of the target surface is calculated; The shortest connection line between the target singular point and the cut graph is determined, and a target singular trajectory that is closest to the shortest connection line is determined, and the target singular trajectory is determined as a branch bonding line.
4. The method according to claim 2, characterized in that: According to the initial quadrilateral mesh layout of the target surface, the initial two-family function value of each vertex and the harmonic weight of each second vertex adjacent to the first vertex, the two-family function value of each vertex in the target surface is updated, including: Determine temporary two-family function values of each second vertex when calculating the first vertex according to the numbers of the initial quadrilateral pieces where the first vertex and each second vertex are located, and the initial two-family function values of each second vertex; A harmonic mean is calculated according to the harmonic weights of each second vertex and the temporary two-family function value, and the harmonic mean is used as the current two-family function value of the first vertex.
5. The method according to claim 4, characterized in that According to the numbers of the initial quadrilateral pieces where the first vertex and each second vertex are located, and the initial two-family function values of each second vertex, the temporary two-family function values of each second vertex when calculating the first vertex are determined, including any of the following: When it is determined according to the number that the first vertex and each second vertex are all located in the same initial quadrilateral piece, the initial two-family function value of each second vertex is determined as a temporary two-family function value; as well as When it is determined based on the numbering that the first vertex and at least one second vertex are located in different initial quadrilateral patches, the initial two-family function values of each target second vertex are extended based on the gradient of the harmonic function on the initial quadrilateral patch where the first vertex is located, the gradient of the harmonic function on the initial quadrilateral patch where each target second vertex is located, the horizontal width value, and the vertical height value to determine the temporary two-family function values of each target second vertex; wherein the target second vertex and the first vertex are located in different initial quadrilateral patches.
6. The method according to claim 4, characterized in that Extracting contour lines according to the updated current two-family function values, and obtaining the current quadrilateral mesh layout of the target surface according to the contour lines, including: After the two-family function values of each vertex in the target surface are updated, the points with the first value in the horizontal direction are connected by the interpolation algorithm to obtain the horizontal contour line, and the points with the second value in the vertical direction are connected to obtain the vertical contour line; A current quadrilateral grid layout of the target surface is determined according to the horizontal contour lines and the vertical contour lines.
7. The method according to claim 6, characterized in that According to the current two-family function values of each vertex and the two-family function values of the previous round, it is judged whether the harmonic function of the current quadrilateral grid layout is locally converged, including: According to the current two-family function value of the target vertex and the two-family function value of the previous round, the horizontal difference and vertical difference of the target vertex are calculated respectively; When it is determined that the horizontal difference and the vertical difference of all vertices on the target surface are less than a preset threshold, it is determined that the harmonic function is locally converged.
8. A structured quadrilateral grid layout optimization device, characterized in that: include: An initial two-family function value determination module is used to determine the initial two-family function values of each vertex of each triangular face in the target surface according to the initial quadrilateral mesh layout of the target surface, the preset horizontal width value and the vertical height value; A quadrilateral mesh layout updating module is used to update the two-family function value of each vertex in the target surface according to the initial quadrilateral mesh layout of the target surface, the initial two-family function value of each vertex, and the harmonic weight of each second vertex adjacent to the first vertex, and extract contour lines according to the updated current two-family function value, and obtain the current quadrilateral mesh layout of the target surface according to the contour lines; A harmonic function judgment module is used to judge whether the harmonic function of the current quadrilateral grid layout is locally converged according to the current two-family function value of each vertex and the two-family function value of the previous round; a structured quadrilateral mesh layout determination module, for, if yes, using the current quadrilateral mesh layout of the target surface as the optimized structured quadrilateral mesh layout; The loop iteration module is used to update the two-family function value of each vertex and the quadrilateral mesh layout of the target surface for multiple rounds according to the current quadrilateral mesh layout, the current two-family function value of each vertex and the harmonic weights of each second vertex adjacent to the first vertex, until the harmonic function of the current quadrilateral mesh layout is locally converged.
9. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the structured quadrilateral mesh layout optimization method described in any one of claims 1 to 7 of the present invention.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the structured quadrilateral grid layout optimization method according to any one of claims 1 to 7 when executed.