A method, device, equipment and medium for mapping mismatched hexahedral mesh data
By constructing background mesh space and dynamic division in large-scale non-regular hexahedral mesh scenarios, the problems of data mapping accuracy and search efficiency are solved, and efficient data mapping is achieved.
Patent Information
- Application Number
- CN202510436276.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-09
- Publication Date
- 2025-06-06
- Estimated Expiration
- 2045-04-09
AI Technical Summary
In the data mapping in large-scale non-regular hexahedral grid scenarios, it is difficult to ensure the accuracy of data mapping and improve search efficiency.
By determining the node boundary of the source mesh, building the background mesh space, and dynamically dividing it, calculating the corner coordinates of the bounding box to update the cell association list, and achieving efficient mapping of the target mesh node to the source mesh hexahedral element.
While ensuring the accuracy of data mapping, it significantly improves search efficiency, especially suitable for data mapping scenarios of large-scale non-regular hexahedral mesh.
Smart Images

Figure CN119962256B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of multi-physical field coupling numerical simulation, and in particular to a mismatched hexahedral grid data mapping method, device, equipment and medium. Background Art
[0002] In data mapping of mismatched grids, nearest neighbor mapping is a common method. However, since it ignores the topological relationship of the source grid and only relies on the closest distance between the interpolation point and the source grid node to establish the mapping relationship, its interpolation accuracy is low. Although the data mapping method based on the topological relationship of the source grid can improve the interpolation accuracy, it is restricted by the interpolation efficiency because this method needs to determine the positional relationship between the interpolation point and the source grid unit (that is, in which unit of the source grid the interpolation point is located). The traditional positional relationship determination method is generally a traversal search, that is, searching all source grid units to determine the unit containing the interpolation point. Therefore, this search algorithm is time-consuming, especially for three-dimensional problems. With the rapid increase in the number of irregular hexahedral grids, the search efficiency also drops sharply.
[0003] As can be seen from the above, how to achieve data mapping in the scenario of large-scale irregular hexahedral grids, ensure data mapping accuracy, and improve search efficiency are problems to be solved in this field. Summary of the invention
[0004] In view of this, the purpose of the present invention is to provide a mismatched hexahedral mesh data mapping method, device, equipment and medium, which can realize data mapping in the scenario of large-scale irregular hexahedral meshes, ensure data mapping accuracy and improve search efficiency. The specific scheme is as follows:
[0005] In a first aspect, the present application discloses a method for mapping mismatched hexahedral mesh data, comprising:
[0006] Determine the node boundaries of the source grid, and construct a background grid space based on the node boundaries, and dynamically divide the background grid space to obtain various background grids;
[0007] Annotate each background grid with an index, calculate a number corresponding to each background grid using the index, and construct an initial unit association list;
[0008] Constructing a bounding box for each irregular hexahedral unit in the source grid, and calculating the coordinates of the corner points of the bounding box, calculating the number of the background grid unit where the corner point coordinates are located using the coordinates of the corner points of the bounding box of the hexahedral unit in the source grid, updating the initial unit association list of the background grid unit with the corresponding number, and storing the number of the hexahedral unit associated with the background grid to obtain an updated unit association list;
[0009] When a node to be interpolated in a target grid that does not match the source grid is mapped with data from the source grid, a grid index calculation is performed using the coordinates of the node to be interpolated in the target grid to obtain a target index corresponding to the coordinates of the node to be interpolated on the background grid, and the background grid number where the node to be interpolated is located is calculated using the target index;
[0010] The hexahedral mapping unit in the source grid is determined from the updated unit association list of the background grid where the node to be interpolated is located, so as to perform data mapping between the hexahedral mapping unit in the source grid and the node to be interpolated in the target grid.
[0011] Optionally, determining the node boundaries of the source grid and constructing the background grid space based on the node boundaries includes:
[0012] Loop through all nodes in the source grid, and calculate the maximum and minimum values of all nodes in different directions by comparison and exchange to obtain the node boundaries of the source grid; the different directions include the horizontal axis direction, the vertical axis direction and the longitudinal axis direction;
[0013] The node boundaries are expanded to construct a background grid space.
[0014] Optionally, the dynamically dividing the background grid space includes:
[0015] Calculating the cell density using the total number of hexahedral cells in the source grid and a preset expected number of cells; the expected number of cells is the number of hexahedral cells of the source grid that each background grid cell is expected to contain;
[0016] Calculate the number of divisions of the background grid in different directions using the cell density, and set a minimum number of divisions and a maximum number of divisions;
[0017] A target number of divisions is calculated based on the number of divisions in different directions, the minimum number of divisions, and the maximum number of divisions, and the background grid space is dynamically divided according to the target number of divisions.
[0018] Optionally, the cell density is calculated as:
[0019] ;
[0020] in, is the cell density, ncell is the total number of hexahedral cells, and excell is the expected number of cells;
[0021] The calculation formula for the number of divisions in different directions is:
[0022] ;
[0023] ;
[0024] ;
[0025] Among them, nx, ny, and nz are the number of divisions in the horizontal axis direction, the number of divisions in the vertical axis direction, and the number of divisions in the vertical axis direction. is the length range of the entire computational domain in the horizontal direction, is the length of the entire computational domain in the longitudinal direction, is the length of the entire computational domain in the vertical axis direction.
[0026] Optionally, the calculating the number corresponding to each background grid by using the index includes:
[0027] Substitute the index and the number of divisions in different directions into the number calculation formula to calculate the number corresponding to each background grid; the number calculation formula is:
[0028] ;
[0029] in, is a number, i, j, k are the indexes of the background grid in the horizontal, vertical and vertical directions.
[0030] Optionally, constructing a bounding box for each irregular hexahedral unit in the source grid, calculating the coordinates of the corner points of the bounding box, calculating the number of the background grid unit where the corner point coordinates are located using the coordinates of the corner points of the bounding box of the hexahedral unit in the source grid, updating the initial unit association list of the background grid unit with the corresponding number, and storing the number of the hexahedral unit associated with the background grid to obtain an updated unit association list, includes:
[0031] Constructing a bounding box for each irregular hexahedral unit in the source grid, obtaining coordinate values of vertices of the hexahedral mapping unit in different directions, and calculating the coordinates of corner points of the bounding box based on the coordinate values;
[0032] The corner point coordinates of the bounding box of the hexahedral unit in the source grid are used to calculate the position number range of the background grid corresponding to each corner point in different directions, and the number of the background grid corresponding to each corner point is calculated based on the number range. Then, the initial unit association list of the background grid unit with the corresponding number is updated, and the number of the hexahedral unit associated with the background grid is stored to obtain an updated unit association list.
[0033] Optionally, determining the hexahedral mapping unit in the source mesh from the updated unit association list of the background mesh where the node to be interpolated is located, so as to perform data mapping between the hexahedral mapping unit in the source mesh and the node to be interpolated in the target mesh, comprises:
[0034] The hexahedral mapping unit in the source grid where the node to be interpolated is located is determined from the updated background grid unit association list corresponding to the background grid number where the node to be interpolated is located in the target grid, the data to be mapped is calculated using the shape function and node load data of the hexahedral mapping unit, and the data to be mapped is mapped to the node to be interpolated in the target grid to complete the data mapping between the hexahedral mapping unit in the source grid and the node to be interpolated.
[0035] In a second aspect, the present application discloses a mismatched hexahedral mesh data mapping device, comprising:
[0036] A dynamic division module, used for determining the node boundaries of the source grid, constructing a background grid space based on the node boundaries, and dynamically dividing the background grid space to obtain various background grids;
[0037] A number calculation module, used to label each background grid with an index, calculate the number corresponding to each background grid using the index, and construct an initial unit association list;
[0038] A list updating module, for constructing a bounding box for each irregular hexahedral unit in the source grid, and calculating the coordinates of the corner points of the bounding box, using the coordinates of the corner points of the bounding box of the hexahedral unit in the source grid to calculate the number of the background grid unit where the corner point coordinates are located, updating the initial unit association list of the background grid unit with the corresponding number, and storing the number of the hexahedral unit associated with the background grid to obtain an updated unit association list;
[0039] A target index calculation module, used for performing grid index calculation using the coordinates of the node to be interpolated in the target grid when data mapping is performed between the node to be interpolated in the target grid that does not match the source grid and the source grid, so as to obtain the target index corresponding to the coordinates of the node to be interpolated on the background grid, and calculating the background grid number where the node to be interpolated is located using the target index;
[0040] The data mapping module is used to determine the hexahedral mapping unit in the source grid from the updated unit association list of the background grid where the node to be interpolated is located, so as to perform data mapping between the hexahedral mapping unit in the source grid and the node to be interpolated in the target grid.
[0041] In a third aspect, the present application discloses an electronic device, comprising:
[0042] Memory, used to store computer programs;
[0043] The processor is used to execute the computer program to implement the aforementioned mismatched hexahedral mesh data mapping method.
[0044] In a fourth aspect, the present application discloses a computer storage medium for storing a computer program; wherein, when the computer program is executed by a processor, the steps of the aforementioned disclosed method for mapping mismatched hexahedral mesh data are implemented.
[0045] It can be seen that the present application provides a method for mapping mismatched hexahedral mesh data, including determining the node boundaries of the source mesh, and constructing a background mesh space based on the node boundaries, and dynamically dividing the background mesh space to obtain each background mesh; marking an index for each background mesh, using the index to calculate the number corresponding to each background mesh, and constructing an initial unit association list; constructing a bounding box for each irregular hexahedral unit in the source mesh, and calculating the corner point coordinates of the bounding box, using the corner point coordinates of the bounding box of the hexahedral unit in the source mesh to calculate the background mesh unit number where the corner point coordinates are located, updating the initial unit association list of the background mesh unit with the corresponding number, and storing The numbers of the hexahedral units associated with the background grid are stored to obtain an updated unit association list; when a node to be interpolated in a target grid that does not match the source grid is to be mapped with the source grid, a grid index calculation is performed using the coordinates of the node to be interpolated in the target grid to obtain a target index corresponding to the coordinates of the node to be interpolated on the background grid, and the number of the background grid where the node to be interpolated is located is calculated using the target index; the hexahedral mapping unit in the source grid is determined from the updated unit association list of the background grid where the node to be interpolated is located, so as to perform data mapping between the hexahedral mapping unit in the source grid and the node to be interpolated in the target grid. The present application determines the node boundary of the source grid, constructs the background grid space, narrows the search range by constructing a rectangular background grid, dynamically divides the background grid space, obtains each background grid, labels an index for each background grid, calculates the number corresponding to each background grid, constructs an initial unit association list, constructs a bounding box for the hexahedral unit, and calculates the corner point coordinates of the bounding box, uses the corner point coordinates to determine the background grid number associated with the hexahedral unit, updates the initial unit association list of the background grid associated with the hexahedral unit, and when the to-be-interpolated node in the target grid that does not match the source grid is mapped with the source grid, the coordinates of the to-be-interpolated node in the target grid are used to perform grid index calculation to obtain the coordinates of the to-be-interpolated node on the background grid corresponding to the background grid. Target index, using the target index to calculate the background grid number, from the updated background grid unit association list corresponding to the background grid number of the target grid node to be interpolated, the subspace where the interpolation node is located and the target hexahedral unit of the potential source grid can be quickly determined, and then the relationship between the interpolation point and these potential units is searched to find the mapping unit, and the data mapping between the hexahedral mapping unit in the source grid and the node to be interpolated in the target grid is completed. The application can effectively improve the search efficiency while ensuring the accuracy of data mapping, and is particularly suitable for data mapping scenarios of large-scale irregular hexahedral grids. It solves the shortcomings of the prior art in multi-physics field coupling data mapping and can provide more effective technical support for the development of multi-physics field coupling numerical simulation. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.
[0047] Figure 1 A flow chart of a mismatched hexahedral mesh data mapping method disclosed in this application;
[0048] Figure 2 A source grid node spatial distribution diagram disclosed in this application;
[0049] Figure 3 (a) is an example diagram of a node boundary of a source grid in the X direction disclosed in this application;
[0050] Figure 3 (b) is an example diagram of a node boundary of a source grid in the Y direction disclosed in this application;
[0051] Figure 3 (c) is an example diagram of a node boundary of a source grid in the Z direction disclosed in this application;
[0052] Figure 4 (a) is a three-dimensional example diagram of a background grid space including all hexahedral units of a source grid disclosed in the present application;
[0053] Figure 4 (b) is a two-dimensional example diagram of a background grid space including all hexahedral units of a source grid disclosed in the present application;
[0054] Figure 5 An index example diagram of various background grids and annotations disclosed in this application;
[0055] Figure 6 This is an example diagram of a background grid global numbering disclosed in this application;
[0056] Figure 7 An example diagram of a source grid hexahedral unit bounding box disclosed in the present application;
[0057] Figure 8 A schematic diagram of a plane of an associated source grid unit and a background grid sub-unit disclosed in the present application;
[0058] Fig. 9 A target node positioning diagram in a background grid disclosed in the present application;
[0059] Fig.10A flowchart of a fast mapping search based on a rectangular background grid disclosed in this application;
[0060] Fig.11 A specific process for realizing the mapping of target mesh nodes to source mesh hexahedral units disclosed in this application;
[0061] Fig.12 A schematic diagram of the structure of a mismatched hexahedral mesh data mapping device disclosed in this application;
[0062] Fig.13 A structural diagram of an electronic device provided for this application. DETAILED DESCRIPTION
[0063] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions 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 are within the scope of protection of the present invention.
[0064] In the data mapping of mismatched grids, nearest neighbor mapping is a relatively common method. However, since it ignores the topological relationship of the source grid and only relies on the nearest distance between the interpolation point and the source grid node to establish the mapping relationship, its interpolation accuracy is low. Although the data mapping method based on the topological relationship of the source grid can improve the interpolation accuracy, it is restricted by the interpolation efficiency because the method needs to determine the positional relationship between the interpolation point and the source grid unit (that is, in which unit of the source grid the interpolation point is located). The traditional positional relationship determination method is generally a traversal search, that is, searching all source grid units to determine the unit containing the interpolation point. Therefore, the search algorithm is time-consuming, especially for three-dimensional problems. With the rapid increase in the number of irregular hexahedral grids, the search efficiency also drops sharply. As can be seen from the above, how to achieve data mapping in the scenario of large-scale irregular hexahedral grids, ensure data mapping accuracy, and improve search efficiency is a problem to be solved in this field.
[0065] See also Figure 1 As shown, the embodiment of the present invention discloses a method for mapping mismatched hexahedral mesh data, which may specifically include:
[0066] Step S11: determining the node boundaries of the source grid, and constructing a background grid space based on the node boundaries, and dynamically dividing the background grid space to obtain various background grids.
[0067] In this embodiment, all nodes in the source grid are traversed in a loop, and the maximum and minimum values of all nodes in different directions are calculated by contrast exchange to obtain the node boundary of the source grid; the different directions include the horizontal axis direction, the vertical axis direction and the longitudinal axis direction; expansion is performed on the node boundary to construct a background grid space, and the cell density is calculated using the total number of hexahedral cells in the source grid and a preset expected number of cells; the expected number of cells is the number of source grid hexahedral cells that each background grid cell is expected to contain; the number of divisions of the background grid in different directions is calculated using the cell density, and the minimum number of divisions and the maximum number of divisions are set; the target number of divisions is calculated based on the number of divisions in different directions, the minimum number of divisions and the maximum number of divisions, and the background grid space is dynamically divided according to the target number of divisions to obtain each background grid.
[0068] The calculation formula of cell density is:
[0069] ;
[0070] in, is the cell density, ncell is the total number of hexahedral cells, and excell is the expected number of cells;
[0071] The calculation formula for the number of divisions in different directions is:
[0072] ;
[0073] ;
[0074] ;
[0075] Among them, nx, ny, and nz are the number of divisions in the horizontal axis direction, the number of divisions in the vertical axis direction, and the number of divisions in the vertical axis direction. is the length range of the entire computational domain in the horizontal direction, is the length of the entire computational domain in the longitudinal direction, is the length of the entire computational domain in the vertical axis direction.
[0076] In this embodiment, the node boundaries of the source grid are first determined: the spatial distribution of the source grid nodes is as follows: Figure 2 As shown in , the source mesh is composed of multiple hexahedral units, each of which consists of 8 nodes. The node boundaries of the source mesh are as follows: Figure 3 As shown, loop through all nodes of the source grid, and use the comparison and exchange method to calculate the maximum and minimum values of all spatial points in the three coordinate directions X, Y, and Z. , Figure 3 (a) is the node boundary of the source grid in the X direction, Figure 3(b) is the node boundary of the source grid in the Y direction, Figure 3 (c) is the node boundary of the source grid in the Z direction. That is, for any spatial point, compared with the existing The value is compared with the X, Y, and Z coordinates of the current node, and then updated according to the comparison results. until the traversal of all source grid nodes is completed. Figure 2 The last updated value of all source grid nodes in It is -1.0, 1.0, -1.0, 1.0, -1.0, 1.0.
[0077] Then, the node boundary is expanded to construct the background grid space: according to the extreme values of the three coordinate directions X, Y, and Z of all spatial points , with a point , , , The 8 points are used as corner points to construct a cuboid space. , , , The value is 0.05. It can be selected according to the specific problem, usually with a value around 0.01, thus obtaining The coordinates of the source grid nodes are (-1.1,-1.1,-1.1), (-1.1,1.1,-1.1), (-1.1,-1.1,1.1), (1.1,1.1,1.1), etc. According to the above steps, for the source grid nodes, expand on the actual boundary of the source grid. In order to eliminate the problem of dividing the space points outside the background grid space caused by numerical errors, a three-dimensional background grid space containing all hexahedral elements of the source grid is constructed. Figure 4 (a) shows a two-dimensional example of a background grid space containing all hexahedral elements of the source grid. Figure 4 As shown in (b), the thin dashed box is the actual boundary of the source grid space, and the thick dashed box is the background grid boundary constructed after expanding the rectangular space where the source grid is located.
[0078] Then, dynamically divide the background grid space to obtain each background grid: the cell density is calculated based on the total number of hexahedral cells in the source grid ncell and the set expected number of cells excell . The expected number of cells excell is the number of hexahedral cells of the source grid that each background grid cell is expected to contain. For example, if the total number of hexahedral cells ncell is 10000 and the expected number of cells excell is set to 20, the cell density is:
[0079] ;
[0080] Next, calculate the number of divisions of the background grid in each direction. The calculation formula is as follows:
[0081] ;
[0082] ;
[0083] ;
[0084] At the same time, set the minimum number of divisions The maximum number of divisions is 2. is 30, and using To update the final number of divisions, the above formula determines that the number of divisions in each direction is 3, 3, 3.
[0085] ;
[0086] ;
[0087] ;
[0088] Finally, the total number of divisions is obtained from the above calculation =27, calculate and determine the background sub-grid size in each direction are 0.733, 0.733, 0.733:
[0089] ;
[0090] ;
[0091] ;
[0092] .
[0093] Step S12: annotate each background grid with an index, calculate a number corresponding to each background grid using the index, and construct an initial unit association list.
[0094] In this embodiment, an index is marked for each background grid, and the index and the number of divisions in different directions are substituted into a number calculation formula to calculate the number corresponding to each background grid and construct an initial unit association list; the number calculation formula is:
[0095] ;
[0096] in, is a number, i, j, k are the indexes of the background grid in the horizontal, vertical and vertical directions.
[0097] In this embodiment, the background grid space is dynamically divided and the position numbering is as follows: Figure 5 As shown, for example, the subunit with position number (1,1,1) is globally numbered 1, the subunit with position number (2,1,1) is globally numbered 2, the subunit with position number (3,1,1) is globally numbered 3, the subunit with position number (1,2,1) is globally numbered 4, the subunit with position number (2,2,1) is globally numbered 5, the subunit with position number (3,2,1) is globally numbered 6, and the subunit with position number (1,3,1) is globally numbered 7. The subunit with the local number of 7 and the position number of (2,3,1) is globally numbered 8, the subunit with the position number of (3,3,1) is globally numbered 9, the subunit with the position number of (1,1,2) is globally numbered 10, the subunit with the position number of (2,1,2) is globally numbered 11, the subunit with the position number of (3,1,2) is globally numbered 12, the subunit with the position number of (1,2,2) is globally numbered 13, the subunit with the position number of (2,2,2) is globally numbered 14. The subunit is globally numbered 14, the subunit with position number (3,2,2) is globally numbered 15, the subunit with position number (1,3,2) is globally numbered 16, the subunit with position number (2,3,2) is globally numbered 17, the subunit with position number (3,3,2) is globally numbered 18, the subunit with position number (1,1,3) is globally numbered 19, the subunit with position number (2,1,3) is globally numbered 20, and the subunit with position number ( The subunit at position (3,1,3) is globally numbered 21, the subunit at position (1,2,3) is globally numbered 22, the subunit at position (2,2,3) is globally numbered 23, the subunit at position (3,2,3) is globally numbered 24, the subunit at position (1,3,3) is globally numbered 25, the subunit at position (2,3,3) is globally numbered 26, and the subunit at position (3,3,3) is globally numbered 27. The background grid is globally numbered as follows Figure 6 shown.
[0098] In addition, each background grid cell also initializes an empty cell association list hexlist.
[0099] Step S13: construct a bounding box for each irregular hexahedral unit in the source grid, and calculate the corner point coordinates of the bounding box, use the corner point coordinates of the bounding box of the hexahedral unit in the source grid to calculate the background grid unit number where the corner point coordinates are located, update the initial unit association list of the background grid unit with the corresponding number, store the number of the hexahedral unit associated with the background grid, to obtain an updated unit association list.
[0100] In this embodiment, a bounding box is constructed for each irregular hexahedral unit in the source grid, and the coordinate values of the vertices of the hexahedral mapping unit in different directions are obtained, and the coordinates of the corner points of the bounding box are calculated based on the coordinate values; the position number range of the background grid corresponding to each corner point in different directions is calculated using the corner point coordinates of the bounding box of the hexahedral unit in the source grid, and the number of the background grid corresponding to each corner point is calculated based on the number range, and then the initial unit association list of the background grid unit with the corresponding number is updated, and the number of the hexahedral unit associated with the background grid is stored to obtain an updated unit association list.
[0101] Since the source mesh hexahedral cells are often irregular, for each hexahedral cell in the source mesh, its bounding box in space is constructed and calculated. The bounding box of the source mesh hexahedral cell is as follows: Figure 7 By obtaining the coordinate values of the eight vertices constituting the hexahedral unit in the three coordinate directions of X, Y, and Z, finding the minimum and maximum values in each direction, the eight corner points of the bounding box corresponding to each source unit are generated, which are , , , , , , , .
[0102] In this embodiment, the steps of updating the initial unit association list are illustrated with a two-dimensional plane figure. The same principle and logic can be extended to the three-dimensional background grid space. The plane diagram of the association source grid unit and the background grid sub-unit is as follows: Figure 8 As shown in the figure, the dotted part is the background sub-grid unit, and the marked numbers are the position indexes in various directions. Traverse each hexahedral unit in the source grid, for example, for a current hexahedral unit A, construct the bounding box of the unit according to the above steps, such as Figure 8 As shown in the dashed box enclosing the hexahedral unit A. Based on the coordinates of the corner points of the bounding box of the hexahedral unit A, the position index of each corner point (x, y, z) in the background grid subunit in the X and Y directions is calculated, and the position number range of the corresponding corner mark in the background grid subunit in the X direction is 2-3, and the position number range of the corresponding corner mark in the background grid subunit in the Y direction is 2-3. Then, the background grid number associated with each node is calculated based on the position number of each node (i.e. Figure 8 Finally, add the number of this hexahedral unit A to the corresponding background grid subunit (i.e. Figure 8 The associated unit number list hexlist of the four background grid units in the upper right corner).
[0103] Step S14: When the node to be interpolated in the target grid that does not match the source grid is mapped with the data between the source grid, the grid index calculation is performed using the coordinates of the node to be interpolated in the target grid to obtain the target index corresponding to the coordinates of the node to be interpolated on the background grid, and the background grid number where the node to be interpolated is located is calculated using the target index.
[0104] In this embodiment, when the nodes to be interpolated in the target grid that do not match the source grid are mapped with the source grid, the number of the rectangular background sub-grid to which each target node belongs is determined according to the spatial coordinate position of the node to be interpolated, and the corresponding relationship between the point and the sub-unit of the background grid to which it belongs is established. The specific process is: by calculating the coordinates of the target node with the boundary and unit size information of the background grid, the corresponding background sub-grid index in the X, Y, and Z directions is obtained. , and then convert the indexes of these three directions into one-dimensional numbers of the background sub-grid And store it in an array. For example, for any point P(0.5,-0.5,0.5) in space, calculate its grid index is (3,1,3) and the global number is 21. The target node is located in the background grid as follows Fig. 9 As shown, record the background grid number of each node.
[0105] ;
[0106] ;
[0107] ;
[0108] .
[0109] Step S15: determining the hexahedral mapping unit in the source mesh from the updated unit association list of the background mesh where the node to be interpolated is located, so as to perform data mapping between the hexahedral mapping unit in the source mesh and the node to be interpolated in the target mesh.
[0110] In this embodiment, the hexahedral mapping unit in the source grid where the node to be interpolated is located is determined from the updated background grid unit association list corresponding to the background grid number where the node to be interpolated is located in the target grid, the data to be mapped is calculated using the shape function and node load data of the hexahedral mapping unit, and the data to be mapped is mapped to the node to be interpolated in the target grid to complete the data mapping between the hexahedral mapping unit in the source grid and the node to be interpolated.
[0111] Specifically, determine the hexahedral unit of the source grid where the node to be interpolated (x, y, z) is located, and the fast mapping search process based on the rectangular background grid is as follows: Fig.10 As shown, for each target node, after obtaining its corresponding background grid subspace number point_index, the source grid hexahedral unit number list hexlist associated with the background grid subspace is accessed. All the hexahedral units involved in hexlist are looped through, and the target hexahedral mapping unit where the node is located is determined based on the geometric relationship between the node coordinates and the vertex coordinates of the hexahedral unit; the data mapping of the node to be interpolated is established. According to the determined target hexahedral mapping unit of the source grid, the shape function and node load data of the target hexahedral mapping unit are used to calculate the data of the node to be interpolated, and the data mapping between the target hexahedral mapping unit and the node to be interpolated is completed.
[0112] In this embodiment, the specific process of implementing the mapping of the target mesh nodes to the source mesh hexahedral units is as follows: Fig.11 As shown, the present invention narrows the search range by constructing a rectangular background grid, quickly determines the subspace where the interpolation node is located and the potential source grid hexahedral units, and then searches the relationship between the interpolation point and these potential units to find the target unit. This method can effectively realize the mapping of the target grid node to the source grid hexahedral unit, while ensuring the accuracy of data mapping, effectively improving the search efficiency, and is particularly suitable for data mapping scenarios of large-scale irregular hexahedral grids. It overcomes the shortcomings of the prior art in multi-physics field coupling data mapping, has high flexibility, is suitable for various types of grid division and interpolation problems, and can provide more effective technical support for the development of multi-physics field coupling numerical simulation.
[0113] In this embodiment, the node boundaries of the source grid are determined, and a background grid space is constructed based on the node boundaries, and the background grid space is dynamically divided to obtain various background grids; an index is marked for each of the background grids, and the index is used to calculate the number corresponding to each of the background grids, and an initial unit association list is constructed; a bounding box is constructed for each irregular hexahedral unit in the source grid, and the corner point coordinates of the bounding box are calculated, and the corner point coordinates of the bounding box of the hexahedral unit in the source grid are used to calculate the background grid unit number where the corner point coordinates are located, and the initial unit association list of the background grid unit with the corresponding number is updated, and the number of the background grid unit associated with the background grid is stored. to obtain an updated unit association list; when a node to be interpolated in a target grid that does not match the source grid is to be mapped with the source grid, a grid index calculation is performed using the coordinates of the node to be interpolated in the target grid to obtain a target index corresponding to the coordinates of the node to be interpolated on the background grid, and the number of the background grid where the node to be interpolated is located is calculated using the target index; the hexahedral mapping unit in the source grid is determined from the updated unit association list of the background grid where the node to be interpolated is located, so as to perform data mapping between the hexahedral mapping unit in the source grid and the node to be interpolated in the target grid. The present application determines the node boundary of the source grid, constructs the background grid space, narrows the search range by constructing a rectangular background grid, dynamically divides the background grid space, obtains each background grid, labels an index for each background grid, calculates the number corresponding to each background grid, constructs an initial unit association list, constructs a bounding box for the hexahedral unit, and calculates the corner point coordinates of the bounding box, uses the corner point coordinates to determine the background grid number associated with the hexahedral unit, updates the initial unit association list of the background grid associated with the hexahedral unit, and when the to-be-interpolated node in the target grid that does not match the source grid is mapped with the source grid, the coordinates of the to-be-interpolated node in the target grid are used to perform grid index calculation to obtain the coordinates of the to-be-interpolated node on the background grid corresponding to the background grid. Target index, using the target index to calculate the background grid number, from the updated background grid unit association list corresponding to the background grid number of the target grid node to be interpolated, the subspace where the interpolation node is located and the target hexahedral unit of the potential source grid can be quickly determined, and then the relationship between the interpolation point and these potential units is searched to find the mapping unit, and the data mapping between the hexahedral mapping unit in the source grid and the node to be interpolated in the target grid is completed. The application can effectively improve the search efficiency while ensuring the accuracy of data mapping, and is particularly suitable for data mapping scenarios of large-scale irregular hexahedral grids. It solves the shortcomings of the prior art in multi-physics field coupling data mapping and can provide more effective technical support for the development of multi-physics field coupling numerical simulation.
[0114] See also Fig.12 As shown, the embodiment of the present invention discloses a mismatched hexahedral mesh data mapping device, which may specifically include:
[0115] A dynamic division module 11 is used to determine the node boundaries of the source grid, and construct a background grid space based on the node boundaries, and dynamically divide the background grid space to obtain various background grids;
[0116] A number calculation module 12 is used to label each background grid with an index, calculate a number corresponding to each background grid using the index, and construct an initial unit association list;
[0117] A list updating module 13 is used to construct a bounding box for each irregular hexahedral unit in the source grid, calculate the coordinates of the corner points of the bounding box, calculate the number of the background grid unit where the corner point coordinates are located using the coordinates of the corner points of the bounding box of the hexahedral unit in the source grid, update the initial unit association list of the background grid unit with the corresponding number, store the number of the hexahedral unit associated with the background grid, so as to obtain an updated unit association list;
[0118] The target index calculation module 14 is used to perform grid index calculation using the coordinates of the node to be interpolated in the target grid when the node to be interpolated in the target grid that does not match the source grid is mapped with the data between the source grid, so as to obtain the target index corresponding to the coordinates of the node to be interpolated on the background grid, and calculate the background grid number where the node to be interpolated is located using the target index;
[0119] The data mapping module 15 is used to determine the hexahedral mapping unit in the source grid from the updated unit association list of the background grid where the node to be interpolated is located, so as to perform data mapping between the hexahedral mapping unit in the source grid and the node to be interpolated in the target grid.
[0120] In some specific embodiments, the dynamic division module 11 may specifically include:
[0121] The node boundary determination module is used to loop through all nodes in the source grid and calculate the maximum and minimum values of all nodes in different directions by comparison and exchange to obtain the node boundary of the source grid; the different directions include the horizontal axis direction, the vertical axis direction and the longitudinal axis direction;
[0122] The node boundary expansion module is used to expand on the node boundary to construct a background grid space.
[0123] In some specific embodiments, the dynamic division module 11 may specifically include:
[0124] A cell density calculation module, used to calculate the cell density using the total number of hexahedral cells in the source grid and a preset expected number of cells; the expected number of cells is the number of hexahedral cells of the source grid that each background grid cell is expected to contain;
[0125] A module for calculating the number of divisions in different directions, used to calculate the number of divisions in different directions of the background grid using the cell density, and to set a minimum number of divisions and a maximum number of divisions;
[0126] The background grid space dynamic division module is used to calculate the target division number based on the number of divisions in different directions, the minimum division number and the maximum division number, and dynamically divide the background grid space according to the target division number.
[0127] In some specific embodiments, the calculation formula of the cell density is:
[0128] ;
[0129] in, is the cell density, ncell is the total number of hexahedral cells, and excell is the expected number of cells;
[0130] The calculation formula for the number of divisions in different directions is:
[0131] ;
[0132] ;
[0133] ;
[0134] Among them, nx, ny, and nz are the number of divisions in the horizontal axis direction, the number of divisions in the vertical axis direction, and the number of divisions in the vertical axis direction. is the length range of the entire computational domain in the horizontal direction, is the length of the entire computational domain in the longitudinal direction, is the length of the entire computational domain in the vertical axis direction.
[0135] In some specific embodiments, the number calculation module 12 may specifically include:
[0136] The division number substitution module is used to substitute the index and the number of divisions in different directions into the number calculation formula to calculate the number corresponding to each background grid; the number calculation formula is:
[0137] ;
[0138] in, is a number, i, j, k are the indexes of the background grid in the horizontal, vertical and vertical directions.
[0139] In some specific embodiments, the list updating module 13 may specifically include:
[0140] A corner point coordinate calculation module, used to construct a bounding box for each irregular hexahedral unit in the source grid, obtain coordinate values of vertices of the hexahedral mapping unit in different directions, and calculate the corner point coordinates of the bounding box based on the coordinate values;
[0141] An initial unit association list updating module is used to calculate the position number range of the background grid corresponding to each corner point in different directions using the corner point coordinates of the bounding box of the hexahedral unit in the source grid, calculate the number of the background grid corresponding to each corner point based on the number range, and then update the initial unit association list of the background grid unit with the corresponding number, store the number of the hexahedral unit associated with the background grid, so as to obtain an updated unit association list.
[0142] In some specific embodiments, the data mapping module 15 may specifically include:
[0143] The data mapping module between the mapping unit and the node is used to determine the hexahedral mapping unit in the source grid where the node to be interpolated is located from the updated background grid unit association list corresponding to the background grid number where the node to be interpolated is located in the target grid, calculate the data to be mapped using the shape function of the hexahedral mapping unit and the node load data, and map the data to be mapped to the node to be interpolated in the target grid to complete the data mapping between the hexahedral mapping unit in the source grid and the node to be interpolated.
[0144] Fig.13 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. The electronic device 20 may specifically include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. The memory 22 is used to store a computer program, which is loaded and executed by the processor 21 to implement the relevant steps in the mismatched hexahedral mesh data mapping method performed by the electronic device disclosed in any of the aforementioned embodiments.
[0145] In this embodiment, the power supply 23 is used to provide working voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and the external device, and the communication protocol it follows is any communication protocol that can be applied to the technical solution of the present application, and is not specifically limited here; the input and output interface 25 is used to obtain external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs and is not specifically limited here.
[0146] In addition, the memory 22, as a carrier for storing resources, can be a read-only memory, a random access memory, a disk or an optical disk, etc. The resources stored thereon include an operating system 221, a computer program 222 and data 223, etc. The storage method can be temporary storage or permanent storage.
[0147] The operating system 221 is used to manage and control the hardware devices and computer programs 222 on the electronic device 20, so as to realize the operation and processing of the data 223 in the memory 22 by the processor 21, which can be Windows, Unix, Linux, etc. In addition to including a computer program that can be used to complete the mismatched hexahedral mesh data mapping method performed by the electronic device 20 disclosed in any of the aforementioned embodiments, the computer program 222 can further include a computer program that can be used to complete other specific tasks. In addition to including data transmitted from an external device received by the mismatched hexahedral mesh data mapping device, the data 223 can also include data collected by its own input and output interface 25, etc.
[0148] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
[0149] Furthermore, an embodiment of the present application also discloses a computer-readable storage medium, in which a computer program is stored. When the computer program is loaded and executed by a processor, the steps of the mismatched hexahedral mesh data mapping method disclosed in any of the aforementioned embodiments are implemented.
[0150] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0151] The above is a detailed introduction to the mismatched hexahedral mesh data mapping method, device, equipment and storage medium provided by the present invention. Specific examples are used in this article to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea; at the same time, for general technical personnel in this field, according to the idea of the present invention, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.
Claims
1. A method for mapping mismatched hexahedral mesh data, characterized in that: include: Determine the node boundaries of the source grid, and construct a background grid space based on the node boundaries, and dynamically divide the background grid space to obtain various background grids; Annotate each background grid with an index, calculate a number corresponding to each background grid using the index, and construct an initial unit association list; Constructing a bounding box for each irregular hexahedral unit in the source grid, and calculating the coordinates of the corner points of the bounding box, calculating the number of the background grid unit where the corner point coordinates are located using the coordinates of the corner points of the bounding box of the hexahedral unit in the source grid, updating the initial unit association list of the background grid unit with the corresponding number, and storing the number of the hexahedral unit associated with the background grid to obtain an updated unit association list; When a node to be interpolated in a target grid that does not match the source grid is mapped with data from the source grid, a grid index calculation is performed using the coordinates of the node to be interpolated in the target grid to obtain a target index corresponding to the coordinates of the node to be interpolated on the background grid, and the background grid number where the node to be interpolated is located is calculated using the target index; The hexahedral mapping unit in the source grid is determined from the updated unit association list of the background grid where the node to be interpolated is located, so as to perform data mapping between the hexahedral mapping unit in the source grid and the node to be interpolated in the target grid.
2. The method for mapping mismatched hexahedral mesh data according to claim 1, characterized in that: The step of determining the node boundaries of the source grid and constructing the background grid space based on the node boundaries includes: Loop through all nodes in the source grid, and calculate the maximum and minimum values of all nodes in different directions by comparison and exchange to obtain the node boundaries of the source grid; the different directions include the horizontal axis direction, the vertical axis direction and the longitudinal axis direction; The node boundaries are expanded to construct a background grid space.
3. The mismatched hexahedral mesh data mapping method according to claim 1, characterized in that: The dynamically dividing the background grid space includes: Calculating the cell density using the total number of hexahedral cells in the source grid and a preset expected number of cells; the expected number of cells is the number of hexahedral cells of the source grid that each background grid cell is expected to contain; Calculate the number of divisions of the background grid in different directions using the cell density, and set a minimum number of divisions and a maximum number of divisions; A target number of divisions is calculated based on the number of divisions in different directions, the minimum number of divisions, and the maximum number of divisions, and the background grid space is dynamically divided according to the target number of divisions.
4. The method for mapping mismatched hexahedral mesh data according to claim 3, characterized in that: The calculation formula for cell density is: ; in, is the cell density, ncell is the total number of hexahedral cells, and excell is the expected number of cells; The calculation formula for the number of divisions in different directions is: ; ; ; Among them, nx, ny, and nz are the number of divisions in the horizontal axis direction, the number of divisions in the vertical axis direction, and the number of divisions in the vertical axis direction. is the length range of the entire computational domain in the horizontal direction, is the length of the entire computational domain in the longitudinal direction, is the length of the entire computational domain in the vertical axis direction.
5. The mismatched hexahedral mesh data mapping method according to claim 4, characterized in that: The step of calculating the number corresponding to each background grid by using the index comprises: Substitute the index and the number of divisions in different directions into the number calculation formula to calculate the number corresponding to each background grid; the number calculation formula is: ; in, is a number, i, j, k are the indexes of the background grid in the horizontal, vertical and vertical directions.
6. The mismatched hexahedral mesh data mapping method according to claim 1, characterized in that: The step of constructing a bounding box for each irregular hexahedral unit in the source grid and calculating the coordinates of the corner points of the bounding box, calculating the number of the background grid unit where the corner point coordinates are located using the coordinates of the corner points of the bounding box of the hexahedral unit in the source grid, updating the initial unit association list of the background grid unit with the corresponding number, and storing the number of the hexahedral unit associated with the background grid to obtain an updated unit association list includes: Constructing a bounding box for each irregular hexahedral unit in the source grid, obtaining coordinate values of vertices of the hexahedral mapping unit in different directions, and calculating the coordinates of corner points of the bounding box based on the coordinate values; The corner point coordinates of the bounding box of the hexahedral unit in the source grid are used to calculate the position number range of the background grid corresponding to each corner point in different directions, and the number of the background grid corresponding to each corner point is calculated based on the number range. Then, the initial unit association list of the background grid unit with the corresponding number is updated, and the number of the hexahedral unit associated with the background grid is stored to obtain an updated unit association list.
7. The method for mapping mismatched hexahedral mesh data according to any one of claims 1 to 6, characterized in that: The step of determining the hexahedral mapping unit in the source grid from the updated unit association list of the background grid where the node to be interpolated is located, so as to perform data mapping between the hexahedral mapping unit in the source grid and the node to be interpolated in the target grid, comprises: The hexahedral mapping unit in the source grid where the node to be interpolated is located is determined from the updated background grid unit association list corresponding to the background grid number where the node to be interpolated is located in the target grid, the data to be mapped is calculated using the shape function and node load data of the hexahedral mapping unit, and the data to be mapped is mapped to the node to be interpolated in the target grid to complete the data mapping between the hexahedral mapping unit in the source grid and the node to be interpolated.
8. A mismatched hexahedral mesh data mapping device, characterized in that: include: A dynamic division module, used for determining the node boundaries of the source grid, constructing a background grid space based on the node boundaries, and dynamically dividing the background grid space to obtain various background grids; A number calculation module, used to label each background grid with an index, calculate the number corresponding to each background grid using the index, and construct an initial unit association list; A list updating module, for constructing a bounding box for each irregular hexahedral unit in the source grid, and calculating the coordinates of the corner points of the bounding box, using the coordinates of the corner points of the bounding box of the hexahedral unit in the source grid to calculate the number of the background grid unit where the corner point coordinates are located, updating the initial unit association list of the background grid unit with the corresponding number, and storing the number of the hexahedral unit associated with the background grid to obtain an updated unit association list; A target index calculation module, used for performing grid index calculation using the coordinates of the node to be interpolated in the target grid when data mapping is performed between the node to be interpolated in the target grid that does not match the source grid and the source grid, so as to obtain the target index corresponding to the coordinates of the node to be interpolated on the background grid, and calculating the background grid number where the node to be interpolated is located using the target index; The data mapping module is used to determine the hexahedral mapping unit in the source grid from the updated unit association list of the background grid where the node to be interpolated is located, so as to perform data mapping between the hexahedral mapping unit in the source grid and the node to be interpolated in the target grid.
9. An electronic device, characterized in that: include: Memory, used to store computer programs; A processor, configured to execute the computer program to implement the mismatched hexahedral mesh data mapping method as claimed in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: Used to store a computer program; wherein, when the computer program is executed by a processor, the method for mapping mismatched hexahedral mesh data as described in any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Uniform grid division method capable of reducing construction difficulty of stiffness matrix
CN110868325A
Three-dimensional geologic model dynamic visualization method, system and device and storage medium
CN117765189A