Conformal mesh generation parallel optimization method and system suitable for FDTD algorithm
By obtaining the structural mesh information and surface triangular metadata of the target object, calculating intersection points and conformal area, identifying Yee cells that do not require conformal, solving the problem of difficulty in generating high-quality mesh in the prior art, and achieving efficient parallel mesh generation and simulation.
Patent Information
- Application Number
- CN202510627009.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-15
- Publication Date
- 2025-08-15
AI Technical Summary
The existing conformal mesh generation technology is difficult to generate high-quality mesh when processing complex geometric structures, with low computational efficiency and low parallelism, and it is impossible to process multi-model files at the same time.
By obtaining the structural mesh information of the target object and the surface triangular metadata, calculate the intersection point between the grid line and the surface triangular metadata, determine whether the Yee cell vertex is located inside the target object, improve the Yee cell plane information, calculate the conformal area, and identify Yee cells that do not need to be conformal, and use parallel computing technology to optimize the mesh generation.
It improves simulation accuracy, reduces calculation amount, saves computing resources, optimizes the grid generation process, improves the overall simulation efficiency, has high parallelism, and can handle large-scale complex problems.
Smart Images

Figure CN120495576A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of electromagnetic field simulation, and in particular relates to a conformal grid subdivision parallel optimization method and system suitable for FDTD algorithm. Background Art
[0002] Finite-Difference Time-Domain (FDTD) is a numerical computational method widely used in fields such as electromagnetic field simulation, acoustics simulation, and optical design. This method discretizes continuous space and time and uses difference equations to approximate the solution of Maxwell's equations or other partial differential equations. The advantages of the FDTD method lie in its intuitive physical meaning, wide applicability, and ability to handle complex geometries.
[0003] However, the computational efficiency and accuracy of the FDTD method rely heavily on mesh generation technology. The basic mesh unit of the FDTD algorithm is the Yee cell, a regular hexahedral structure. Before performing electromagnetic calculations on any simulation target, the FDTD algorithm requires fitting the target's geometric shape with several Yee cell structures. This structural grid performs well when dealing with simple geometric shapes, but when faced with complex geometric structures, especially curved and inclined structures, regular rectangular grids cannot achieve complete fitting, resulting in step approximation errors. This error significantly reduces the accuracy of the simulation. To overcome this problem, conformal mesh generation technology came into being. Conformal meshes can better fit complex geometric surfaces, reduce step errors, and thus significantly improve simulation accuracy. By adopting conformal mesh technology, more accurate electromagnetic field calculations can be achieved in the simulation of complex geometric structures, thereby improving the overall performance and reliability of the FDTD method.
[0004] Among the existing conformal mesh generation technologies, there are mainly the following methods: 1. Voxel-based conformal mesh generation: by voxelizing the geometric structure, a mesh conformal to the geometric surface is generated; 2. Surface mesh-based conformal mesh generation: this method first generates a surface mesh, and then generates a structural mesh based on the surface mesh; 3. Adaptive mesh-based conformal mesh generation: a conformal mesh is generated based on the adaptively generated structural mesh.
[0005] While the aforementioned methods have made some progress in improving FDTD simulation accuracy, they still suffer from certain shortcomings: difficulty generating high-quality meshes when processing complex geometries, low computational efficiency, inability to process multiple model files simultaneously, and low parallelism. Therefore, the present invention aims to address the shortcomings and deficiencies of existing conformal mesh generation techniques when processing complex geometries, and proposes the following technical solutions. Summary of the Invention
[0006] The purpose of the present invention is to overcome the problem that existing conformal mesh generation technology is difficult to generate high-quality meshes when processing complex geometric structures, resulting in low computational efficiency and low parallelism, and to provide a conformal mesh generation parallel optimization method and system suitable for the FDTD algorithm.
[0007] In order to achieve the above object, the present invention adopts the following technical solutions:
[0008] In a first aspect, the present invention provides a parallel optimization method for conformal meshing applicable to the FDTD algorithm, comprising the following steps:
[0009] Obtain the structural mesh information and surface triangle metadata of the target object;
[0010] Based on the acquired structural mesh information and triangular facet data of the target object, the intersection points of the mesh lines and the surface triangular facets are calculated to obtain the attributes of each intersection point and the conformal side length;
[0011] Based on the attributes of each intersection point and the conformal edge length, determine whether each vertex of the Yee cell is located inside the target object, and improve the plane information of the Yee cell;
[0012] Calculate the conformal area of the Yee cell based on the improved Yee cell plane information;
[0013] Based on the conformal area of the Yee cells, identify the Yee cells that do not need to be conformal.
[0014] The specific method of calculating the intersection points of the grid lines and the surface triangle elements based on the obtained structural grid information and triangle facet data of the target object and obtaining the attributes of each intersection point and the conformal side length is as follows:
[0015] Calculate the intersection of the grid line and the plane where the triangle element is located;
[0016] Determine whether the intersection point is inside the triangle and discard the intersection points that are not inside the triangle;
[0017] Assign in and out attributes to the intersection points inside the triangle surface element according to the direction vector of the triangle surface element's outer normal;
[0018] The intersection edge length is stored based on the in and out attributes of each intersection point, and the stored intersection edge length is used as the conformal edge length.
[0019] In the step of judging whether the intersection point is inside the triangle element and discarding the intersection point that is not inside the triangle element, the right-hand screw rule is used for judgment. If the calculation result is 0, the corresponding intersection point is regarded as inside the triangle element.
[0020] In the step of assigning entry and exit attributes to the intersection points inside the triangle element according to the direction vector of the outer normal of the triangle element, the specific method is as follows:
[0021] Using the ray tracing method, when a ray passes through the target object, there is an angle between the ray and the external normal vector; if the angle is acute, it is considered to be the exit point, otherwise it is the entry point.
[0022] When calculating the intersection points between grid lines and surface triangles, a greedy algorithm is used to achieve parallel computing.
[0023] In the step of determining whether each vertex of the Yee cell is located inside the target object based on the attributes of each intersection point and the conformal edge length, and improving the plane information of the Yee cell, the specific method is as follows:
[0024] Using the ray tracing method, when a ray passes through the target object, n pairs of entry and exit points are obtained. The vertices between the entry and exit points are considered to be inside the target object, and the intersection and vertex distribution of each face of the Yee cell are obtained; otherwise they are discarded.
[0025] In the step of calculating the conformal area of the Yee cell based on the improved Yee cell plane information, the directed area method is used for calculation.
[0026] In the step of identifying Yee cells that do not need to be conformal based on the conformal area of the Yee cells, the specific method is as follows:
[0027] Subtract the Yee cells that need to be conformal from all the Yee cells to obtain the Yee cells that do not need to be conformal.
[0028] When only a part of the target object is conformal, this type of cell is named Yee1. The specific method is as follows:
[0029] Traverse all structural grids of the target object;
[0030] Exclude all conformal Yee cells. If all diagonal vertices of a Yee cell are inside the target object, then the Yee cell does not need to be conformal.
[0031] Perform conformal conformation on the adjacent Yee cells of the Yee cells that do not need to be conformal, and store the result in Yee1.
[0032] In a second aspect, the present invention provides a conformal meshing parallel optimization system suitable for the FDTD algorithm, comprising:
[0033] An acquisition module is used to obtain the structural mesh information and surface triangle metadata of the target object;
[0034] The first calculation module is used to calculate the intersection points of the grid lines and the surface triangle elements based on the obtained structural grid information and triangle facet data of the target object, and obtain the attributes of each intersection point and the conformal side length;
[0035] The judgment module is used to judge whether each vertex of the Yee cell is located inside the target object based on the attributes of each intersection point and the conformal edge length, and to improve the plane information of the Yee cell;
[0036] The second calculation module is used to calculate the conformal area of the Yee cell based on the improved Yee cell plane information;
[0037] The optimization module is used to identify Yee cells that do not need to be conformal based on the conformal area of the Yee cells.
[0038] Compared with the prior art, the present invention has the following beneficial effects:
[0039] The present invention provides a conformal meshing parallel optimization method suitable for the FDTD algorithm, comprising the following steps: obtaining structural mesh information and surface triangle facet data of a target object; calculating the intersection points of mesh lines and surface triangle facets based on the obtained structural mesh information and triangle facet data of the target object, obtaining the attributes of each intersection point and the conformal side length; judging whether each vertex of a Yee cell is located inside the target object based on the attributes of each intersection point and the conformal side length, and improving the plane information of the Yee cell; calculating the conformal area of the Yee cell based on the improved Yee cell plane information; and identifying Yee cells that do not need to be conformal based on the conformal area of the Yee cell. The present invention takes into account the actual geometric shape and the situation of multiple intersection points for each Yee cell plane, achieves a high degree of fitting of fine structures, generates high-quality meshes for complex models, improves simulation accuracy, can better handle complex model structures, and is suitable for numerical simulation of large-scale complex problems.
[0040] Furthermore, the present invention can identify cells that do not require conformal processing, greatly reducing the amount of calculation, and only performing precise calculations on areas that require conformal processing, saving computing resources. Through efficient calculation of conformal side lengths and areas, the grid generation process is optimized and the overall simulation efficiency is improved.
[0041] Furthermore, by introducing parallel computing technology, we can fully utilize the parallel computing capabilities of modern multi-core processors and distributed computing resources, adopt different allocation methods according to the characteristics of each module, and improve the computational efficiency of conformal grid generation. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] Figure 1 Flow chart of the method of the present invention;
[0043] Figure 2 Schematic diagram of the area defined by the spatial triangular surface element in the present invention;
[0044] Figure 3 Schematic diagram of the distribution of intersection points relative to triangular facets in the present invention;
[0045] Figure 4 Schematic diagram of the intersection of surface triangle elements and grid lines in the present invention;
[0046] Figure 5 A schematic diagram of the storage intercept required for entering and exiting the intersection in the present invention;
[0047] Figure 6 It is a schematic diagram of the situation of multiple intersections in the present invention;
[0048] Figure 7 Schematic diagram of the Yee cell in the present invention;
[0049] Figure 8 Schematic diagram of the Yee cell intersection distribution in the present invention;
[0050] Figure 9 This is a schematic diagram of the intersection storage format in the present invention;
[0051] Figure 10 This is a functional flow chart of finding the intersection point in the present invention;
[0052] Figure 11 Schematic diagram of the complexity of two-dimensional triangle surface elements in the present invention;
[0053] Figure 12 This is a flowchart for implementing the greedy algorithm in the present invention;
[0054] Figure 13 This is a schematic diagram of rays passing through an object in the present invention;
[0055] Figure 14 Schematic diagram of the process of determining endpoints in the present invention;
[0056] Figure 15 Schematic diagram of geometric polygon division in the present invention;
[0057] Figure 16 A schematic diagram showing the storage of a Yee cell plane drawing in the present invention;
[0058] Figure 17 Schematic diagram of the process of calculating conformal area in the present invention;
[0059] Figure 18 Schematic diagram of pointxyz arrays of different models in the present invention;
[0060] Figure 19 This is a schematic diagram of the pointxyz array merging process in the present invention;
[0061] Figure 20 Schematic diagram of the Yee1 cell in the present invention;
[0062] Figure 21 This is a functional flow chart of the present invention for identifying non-conformal Yee cell modules;
[0063] Figure 22 This is a schematic diagram of balanced distribution based on Cartesian coordinates in the present invention. DETAILED DESCRIPTION
[0064] In order to further understand the content of the present invention, the present invention is described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be understood that the embodiments are only for explaining the present invention and are not intended to limit it.
[0065] Example 1
[0066] like Figure 1 As shown in FIG, a parallel optimization method for conformal meshing suitable for FDTD algorithm includes the following steps:
[0067] S1: Obtain the structural mesh information and surface triangle metadata of the target object;
[0068] S2: Based on the obtained structural mesh information and triangular facet data of the target object, the intersection points of the mesh lines and the surface triangular facets are calculated to obtain the attributes of each intersection point and the conformal edge length;
[0069] S3: Based on the attributes of each intersection point and the conformal edge length, determine whether each vertex of the Yee cell is located inside the target object, and improve the Yee cell plane information;
[0070] S4: Calculate the conformal area of the Yee cell based on the improved Yee cell plane information;
[0071] S5: Based on the conformal area of Yee cells, identify Yee cells that do not need to be conformal.
[0072] Specifically, in S1, the structural grid information (grid line coordinates in three dimensions and attribute numbers corresponding to each grid) and the surface triangle metadata provided by the STL file are used as input files.
[0073] Specifically, in S2, based on the obtained structural mesh information and triangular facet data of the target object, the intersection points of the mesh lines and the surface triangular facets are calculated to obtain the attributes of each intersection point and the conformal edge length; the specific method is as follows:
[0074] Calculate the intersection points of the grid lines with the triangles, that is, calculate the intersection points of the grid lines with the plane containing the triangles. The two-point plane equation is A(x1-x2)+B(y1-y2)+C(z1-z2)=0, where (A, B, C) is the normal vector of the plane. If A=0, the plane is parallel to the x-axis. In this case, the plane has zero or infinite intersection points with the grid lines in the x-direction. Therefore, for a plane with A=0, there is no need to calculate its x-direction intersection points. Similarly, for a plane with B=0, there is no need to calculate its y-direction intersection points, and for a plane with C=0, there is no need to calculate its z-direction intersection points. If A=B=0, the plane is parallel to the XOY plane. In this case, the plane has zero or infinite intersection points with the grid lines in the x and y directions. Therefore, for a plane with A=B=0, there is no need to calculate its x and y-direction intersection points. Similarly, for the plane where A=C=0, there is no need to find the intersection points in the x and z directions; for the plane where B=C=0, there is no need to find the intersection points in the y and z directions.
[0075] The intersection point can be calculated by the plane equation and the line equation. Take the intersection point (x1, y1, z1) in the x direction as an example. Since the information of the grid line is known, that is, y1 and z1 are known, let the coordinates of a vertex of the triangle surface element be (x2, y2, z2), then x1=x2-(B×(y1-y2)+C×(z1-z2)) / A. In order to improve the calculation efficiency, the spatial triangle surface element can be confined to a rectangular parallelepiped according to its coordinates, such as Figure 2 As shown, it is only necessary to calculate the intersection points of the grid lines and the triangular face elements in the cuboid.
[0076] Since the intersection of a line and a plane is calculated, it is necessary to determine whether the intersection is inside the triangle and discard the intersection that is not inside. Figure 3 Taking ΔABC as an example, P1 and P2 are the intersection points. If points A, B, and C are arranged counterclockwise (clockwise) and connected in sequence to PA, PB, and PC, then the three cross products in equation (1) simultaneously satisfy the right-hand (left-hand) screw rule, that is, the three cross products have the same sign. Based on this principle, it can be determined that point P1 is inside the triangle element, while point P2 is not. If the intersection point is located on the edge of the triangle element, the calculation result is 0, and it is considered to be inside the triangle element.
[0077]
[0078] At the same time, the intersection point is assigned entry and exit attributes according to the direction vector of the external normal of the triangle element. When the ray (positive direction of the coordinate axis) passes through the target object, there is an angle between the ray and the external normal vector. If the angle is acute, it is considered to be an exit point, otherwise it is an entry point. Figure 4 As shown, the yellow vector is the positive direction of the coordinate axis, and the blue vector is the external normal vector of the surface triangle element. According to the angles α1 and α2, point P1 can be identified as the entry point and point P2 as the exit point. The intersection length is stored according to the entry and exit attributes, as shown in Figure 5 As shown in (a) and (b), point E is the entry point and exit point respectively, so the BE and AE segments are stored in sequence. If there is an edge with two intersection points, the length of the intersection side is the distance between the two intersection points, that is, Figure 5 (c) Middle EF segment.
[0079] Since the target is composed of triangular facets, for some arc structures, there is a certain error between the triangular facet data we obtain and the target itself, or the Yee cell is too large relative to the triangular facet, and there may be a situation where one edge of the Yee cell has multiple intersections, such as Figure 6 (a) In order to simplify the calculation, it is assumed that each edge has at most two intersection points, and the case with more than two points is approximated as two points. Figure 6 (b) shown.
[0080] In order to minimize duplicate storage, Figure 7 As an example, each Yee cell is required to store only three edges and three faces related to its smallest point, that is, Figure 7 The red edges in (a): edge AD, edge AB, edge AE, and Figure 7 The purple faces in (b) are: face ABCD (XOY face), face ABFE (YOZ face), and face ADHE (ZOX face). Therefore, for each Yee cell, it is only necessary to store the intersection points of the edges associated with these three faces. To complete the assignment of intersection numbers for the associated faces, it is necessary to search for information from adjacent cells: let the cell be numbered (i, j, k), then the intersection information of edges BC and BF is stored in cell (i+1, j, k), edges CD and DH in (i, j+1, k), and edges EH and EF in (i, j, k+1).
[0081] The specific storage method is: each Yee cell plane is divided into Figure 8 The 12 points shown in the figure are endpoints, and the points numbered 3, 6, 9, and 12 are endpoints, and the rest are vertices. The (i, j, k) information of the Yee cell is stored in the array Yee; each Yee cell corresponds to three faces: XOY face, YOZ face, and ZOX face, and the information of the points corresponding to these three faces is placed in the array Sum_of_point; all calculated intersections are placed in the array pointxyz, and the row number of the intersection is the number of the intersection. Thus, the number of each intersection can be stored in the corresponding position in the array Sum_of_point. At the same time, it is necessary to determine whether the vertex is inside the model. If it is inside, the coordinates of the vertex are also stored in the pointxyz array, and the label is stored in the corresponding position. As shown in the figure, Figure 9The following table shows some of the stored information. Columns 1 through 3 in the Yee array represent the i, j, and k information of the Yee cells, respectively. The sum_of_point array contains three groups of cells, each corresponding to the XOY, YOZ, and ZOX planes of the cells in the Yee array. Columns 1 through 12 represent the information of each intersection / vertex, respectively.
[0082] Furthermore, the parallel implementation of this module is as follows:
[0083] When calculating the intersection of grid lines and triangles, the triangles must be confined within the cuboid and all the intersections of grid lines and triangles inside the cuboid must be calculated. Therefore, the amount of calculation is proportional to the load (complexity) of the triangles. Figure 11 As shown in Figure 2, the higher the complexity, the greater the amount of computation. To ensure an even distribution of tasks between processes, this software uses a greedy algorithm to implement parallel processing.
[0084] Depend on Figure 11 As we can see, the number of grids occupied by each triangle is not consistent, so the triangles can be traversed in order. According to the complexity of the triangles, they are assigned to the first process with the least current load, and then the total load of the process is updated before the next triangle is determined. The specific implementation effect is as follows Figure 12 As shown in the figure: Assume that there are 3 processes, and the initial load of each process is 0; there are 7 triangles S1 to S7, and their complexity is 10, 35, 20, 40, 15, 20, and 10, respectively. For triangle S1, since the loads of the three processes are all 0, triangle S1 (that is, its complexity) is assigned to process 0; for triangle S2, the first process with the smallest load is process 1, so S2 is assigned to process 1, and so on, the assignment of all triangles can be completed, thus obtaining the global optimal solution. After the triangles are assigned to each process through the greedy algorithm, each process is assigned according to Figure 10 The process shown is to calculate the intersection points of related triangle elements.
[0085] Specifically, in S3, based on the attributes of each intersection point and the conformal edge length, it is determined whether each vertex of the Yee cell is located inside the target object, the plane information of the Yee cell is improved, and the conformal area of the Yee cell is calculated based on the improved plane information of the Yee cell. The specific method is as follows:
[0086] Depend on Figure 8It can be seen that for the Sum_of_point array corresponding to each Yee cell, in addition to storing the intersection information, it is also necessary to determine whether the vertices of each face are located inside the target object, and store the vertices located inside the target object. This algorithm implements this function through ray tracing. When a ray passes through the target object, n pairs of entry and exit points will be obtained. The vertices located between the entry and exit points are considered to be inside the target object, otherwise they are discarded. Figure 13 As shown in the figure, according to the principle proposed in step 1, A and C are entry points, and B and D are exit points. Therefore, the vertices located in the AB and CD segments are considered to be inside the target, and the vertices located in the BC segment are discarded. Due to the existence of singular points, their entry and exit properties will lead to misjudgment of the endpoints. Therefore, all singular points need to be discarded before judgment. The implementation process is as follows: Figure 14 shown.
[0087] Furthermore, the parallel implementation of this module is as follows:
[0088] For each Yee cell, the task volume of determining the endpoint attributes of each cell plane is consistent. Therefore, in order to ensure a balanced distribution of tasks among processes, each process can be evenly distributed according to the number of Yee cells.
[0089] Specifically, in S4, the conformal area of the Yee cell is calculated based on the improved Yee cell plane information. The specific method is as follows:
[0090] The above steps reveal the intersection and vertex distribution of each face of the Yee cell. The storage structure indicates that all points are sorted counterclockwise. For example, if the Yee cell is located in row n of the Yee array, its XOY, YOZ, and ZOX face information is located in rows 3*n-2 through 3*n of the sum_of_point array, respectively. Extract all non-zero values from row 3*n-2 and find the corresponding point's coordinates in the pointxyz array based on the index value.
[0091] Depend on Figure 6 It can be seen that each Yee cell plane is a polygon, so this paper adopts an area solution formula that is applicable to any polygon. It is known that the area of a triangle can be obtained by vector product. Here we introduce the concept of directed area: directed area is an area with both direction and size. Its size is equal to the area in the ordinary sense, and the direction can be determined by the right-hand screw rule. Specifically, if the three vertices of a triangle are arranged in a clockwise order, the directed area of the triangle is negative, otherwise it is positive. Figure 15 As shown in (a), the area of the triangle should satisfy:
[0092]
[0093] Take any point D in the triangle and split it into three triangles, and arrange the three endpoints A, B, and C in counterclockwise order, that is, like Figure 15 (a), then the area of the triangle satisfies:
[0094]
[0095] Similarly, any point can be selected outside the triangle. In order to facilitate calculation, point D can be selected at the origin, such as Figure 15 (b) shows that the vector subtraction operation can be reduced. In this case, the area of the triangle satisfies:
[0096]
[0097] Arrange the vertices of an N-gon (N>=3) counterclockwise and connect the origin with each vertex in sequence to divide it into N triangles, such as Figure 15 (c) shows that the area of the polygon is:
[0098]
[0099] Since all faces of the Yee cell are perpendicular to the coordinate axis, it can be viewed as a two-dimensional polygon area solution problem. The cross product calculation in the above area formula can be simplified. For example, let the polygon be perpendicular to the z axis. but:
[0100]
[0101] Since it is perpendicular to the z-axis, it can be directly projected onto the XOY plane, that is, directly set z1 and z2 to 0, then:
[0102]
[0103] This can simplify the formula for calculating area and improve calculation efficiency.
[0104] After calculating the conformal area, you can draw a diagram of each Yee cell plane that needs to be conformal. It is known that each Yee cell is a spatial polygon. In MATLAB, you can use the patch function to draw each cell plane. One or more polygons can be created through patch('Faces',F,'Vertices',V), where V specifies the value of the vertex and F defines the vertices to be connected. In order to clearly define which endpoints each cell plane is composed of, this software introduces two documents named V and F, where V stores the numbers of the points that make up each cell plane in the pointxyz array. The intersection points and endpoints are sorted counterclockwise, so F can be filled directly in order, such as Figure 16 shown.
[0105] Furthermore, the parallel implementation of this module is as follows:
[0106] For different models (different STL files) and different processes, there will be a pointxyz array. Therefore, when processing the array V, the numbering of each point needs to take into account both the offset of the process and the offset of the model. Figure 18 As shown in the figure, the pointxyz arrays of each model and process are represented by different colors. Because this software extracts conformal information in the order of the models, it is necessary to broadcast the data volume of each model to each process after processing it. That is, first calculate the offset between different processes of the same model, and then calculate the offset between different models, as shown in the figure. Figure 19 shown.
[0107] Specifically, in S5, the data of the structured grid includes Yee cells that need to be conformal and Yee cells that do not need to be conformal. By finding the intersection points, all the Yee cells that need to be conformal can be obtained. Therefore, the Yee cells that do not need to be conformal can be obtained by subtracting the Yee cells that need to be conformal from all cells. However, as can be seen from the storage method, since each Yee cell only stores the valid information of three faces, there will be Figure 20 In the example shown, the three smallest faces associated with the cell need to be conformal, while the other three faces do not. This type of cell is named Yee1. To meet the requirements of drawing, the algorithm makes special handling for this situation.
[0108] Assuming a cell is numbered (i, j, k), the remaining three faces of the cell are stored in cells (i+1, j, k), (i, j+1, k), and (i, j, k+1). All Yee cells are traversed. If the cell (i, j, k) can be found in the Yee array, the cell is determined to be conformal. If any of the three cells (i+1, j, k), (i, j+1, k), and (i, j, k+1) can be found in the Yee cell array, the cell is also determined to be conformal, and the Yee cell that meets this condition is stored in the array Yee1. If the cell is only found in the structure grid array, it is considered to belong to the target object but does not need to be conformal. The Yee cells that meet this condition are stored in the array myyee_nonconformal. At the same time, to improve efficiency, the diagonal vertices of the completely non-conformal Yee cells are all inside the target object, so those that meet this condition are directly discarded. Implementation process such as Figure 21 shown.
[0109] Furthermore, the parallel implementation of this module is as follows:
[0110] Since the structural grid is evenly distributed according to Cartesian coordinates, such as Figure 22 As shown in Figure 2. Therefore, to conserve communication resources, this section adopts the same principle. The conformal meshes obtained from the above steps are evenly distributed to each process based on Cartesian coordinates. Within each process, all non-conformal cell information is obtained by excluding all conformal meshes from the overall structured mesh.
[0111] Preferably, the present invention divides the extraction of conformal information into five steps, and these five steps do not affect each other for different models. Therefore, it is possible to process multi-model simulation targets, and the implementation steps are as follows:
[0112] Export the simulation target to multiple STL files according to the material properties, perform the above five steps on each STL file, and finally merge all the data. This allows the simultaneous processing of multiple model files, meeting the needs of multi-model file processing in practical applications.
[0113] Example 2
[0114] A conformal meshing parallel optimization system suitable for FDTD algorithm, comprising:
[0115] An acquisition module is used to obtain the structural mesh information and surface triangle metadata of the target object;
[0116] The first calculation module is used to calculate the intersection points of the grid lines and the surface triangle elements based on the obtained structural grid information and triangle facet data of the target object, and obtain the attributes of each intersection point and the conformal side length;
[0117] The judgment module is used to judge whether each vertex of the Yee cell is located inside the target object based on the attributes of each intersection point and the conformal edge length, and to improve the plane information of the Yee cell;
[0118] The second calculation module is used to calculate the conformal area of the Yee cell based on the improved Yee cell plane information;
[0119] The optimization module is used to identify Yee cells that do not need to be conformal based on the conformal area of the Yee cells.
[0120] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit it. Although the present invention has been described in detail with reference to the above embodiments, ordinary technicians in the field should understand that the specific implementation methods of the present invention can still be modified or replaced by equivalents. Any modification or equivalent replacement that does not depart from the spirit and scope of the present invention should be covered by the scope of protection of the claims of the present invention.
Claims
1. A parallel optimization method for conformal meshing suitable for FDTD algorithm, characterized by: The steps include: Obtain the structural mesh information and surface triangle metadata of the target object; Based on the acquired structural mesh information and triangular facet data of the target object, the intersection points of the mesh lines and the surface triangular facets are calculated to obtain the attributes of each intersection point and the conformal side length; Based on the attributes of each intersection point and the conformal edge length, determine whether each vertex of the Yee cell is located inside the target object, and improve the plane information of the Yee cell; Calculate the conformal area of the Yee cell based on the improved Yee cell plane information; Based on the conformal area of the Yee cells, identify the Yee cells that do not need to be conformal.
2. A conformal mesh generation parallel optimization method suitable for FDTD algorithm according to claim 1, characterized in that: The specific method of calculating the intersection points of the grid lines and the surface triangle elements based on the obtained structural grid information and triangle facet data of the target object and obtaining the attributes of each intersection point and the conformal side length is as follows: Calculate the intersection of the grid line and the plane where the triangle element is located; Determine whether the intersection point is inside the triangle and discard the intersection points that are not inside the triangle; Assign in and out attributes to the intersection points inside the triangle surface element according to the direction vector of the triangle surface element's outer normal; The intersection edge length is stored based on the in and out attributes of each intersection point, and the stored intersection edge length is used as the conformal edge length.
3. The method for parallel optimization of conformal meshing suitable for FDTD algorithm according to claim 2, characterized in that: In the step of judging whether the intersection point is inside the triangle element and discarding the intersection point that is not inside the triangle element, the right-hand screw rule is used for judgment. If the calculation result is 0, the corresponding intersection point is regarded as inside the triangle element.
4. The method for parallel optimization of conformal meshing suitable for FDTD algorithm according to claim 2, characterized in that: In the step of assigning entry and exit attributes to the intersection points inside the triangle element according to the direction vector of the outer normal of the triangle element, the specific method is as follows: Using the ray tracing method, when a ray passes through the target object, there is an angle between the ray and the external normal vector; if the angle is acute, it is considered to be the exit point, otherwise it is the entry point.
5. The method for parallel optimization of conformal meshing suitable for FDTD algorithm according to claim 2, characterized in that: When calculating the intersection points between grid lines and surface triangles, a greedy algorithm is used to achieve parallel computing.
6. The method for parallel optimization of conformal meshing suitable for FDTD algorithm according to claim 1, characterized in that: In the step of determining whether each vertex of the Yee cell is located inside the target object based on the attributes of each intersection point and the conformal edge length, and improving the plane information of the Yee cell, the specific method is as follows: Using the ray tracing method, when a ray passes through the target object, n pairs of entry and exit points are obtained. The vertices between the entry and exit points are considered to be inside the target object, and the intersection and vertex distribution of each face of the Yee cell are obtained; otherwise they are discarded.
7. The method for parallel optimization of conformal meshing suitable for FDTD algorithm according to claim 1, characterized in that: In the step of calculating the conformal area of the Yee cell based on the improved Yee cell plane information, the directed area method is used for calculation.
8. The method for parallel optimization of conformal meshing suitable for FDTD algorithm according to claim 1, characterized in that: In the step of identifying Yee cells that do not need to be conformal based on the conformal area of the Yee cells, the specific method is as follows: Subtract the Yee cells that need to be conformal from all the Yee cells to obtain the Yee cells that do not need to be conformal.
9. The method for parallel optimization of conformal meshing suitable for FDTD algorithm according to claim 8, characterized in that: When only a part of the target object is conformal, this type of cell is named Yee1. The specific method is as follows: Traverse all structural grids of the target object; Exclude all conformal Yee cells. If all diagonal vertices of a Yee cell are inside the target object, then the Yee cell does not need to be conformal. Perform conformal conformation on the adjacent Yee cells of the Yee cells that do not need to be conformal, and store the result in Yee1.
10. A conformal mesh generation parallel optimization system applicable to the FDTD algorithm, based on the conformal mesh generation parallel optimization method applicable to the FDTD algorithm according to any one of claims 1 to 9, characterized in that: include: An acquisition module is used to obtain the structural mesh information and surface triangle metadata of the target object; The first calculation module is used to calculate the intersection points of the grid lines and the surface triangle elements based on the obtained structural grid information and triangle facet data of the target object, and obtain the attributes of each intersection point and the conformal side length; The judgment module is used to judge whether each vertex of the Yee cell is located inside the target object based on the attributes of each intersection point and the conformal edge length, and to improve the plane information of the Yee cell; The second calculation module is used to calculate the conformal area of the Yee cell based on the improved Yee cell plane information; The optimization module is used to identify Yee cells that do not need to be conformal based on the conformal area of the Yee cells.