A symmetric non-uniform FDTD grid generation method based on dynamic constraints
By introducing dynamic constraints and symmetry in the generation of FDTD mesh, the simulation instability caused by non-uniform mesh is solved, and more efficient simulation results and grid generation efficiency are achieved.
Patent Information
- Application Number
- CN202411188136.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-28
- Publication Date
- 2024-12-06
- Estimated Expiration
- 2044-08-28
AI Technical Summary
The non-uniform FDTD grid may introduce numerical dispersion in the simulation, resulting in unstable simulation results.
Using a symmetric non-uniform FDTD grid generation method based on dynamic constraints, the minimum number of segments in which the three-dimensional model is divided in each dimension is determined, and the length of each segment is calculated to ensure the network Grids are symmetrical and have the minimum number of grids.
The stability and efficiency of simulation results are improved, the optimal simulation results on the symmetric structural model are ensured, and the number of grids is reduced through dynamic constraints and Newton iterations, which improves the performance of the algorithm.
Smart Images

Figure CN118690619B_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the field of simulation design, and in particular to a symmetrical non-uniform FDTD grid generation method based on dynamic constraints. Background Art
[0002] The finite difference time domain (FDTD) method is one of the important methods for numerical calculation of electromagnetic fields. This method uses the central difference quotient to replace the partial differential of the field quantity with respect to time and space, and then recursively simulates the propagation process of the electromagnetic field in the time domain to obtain the field distribution. As a time domain method, the FDTD operation method can calculate multiple frequency ranges simultaneously in one simulation run, and can naturally handle various linear material properties.
[0003] Chinese patent CN105279320A discloses a method for generating FDTD meshes by dividing the model into triangular face elements and then converting them into FDTD meshes. In the FDTD method, iterative calculations are performed on hexahedral meshes, which can be uniform or non-uniform. Figure 3a and Figure 3b As shown in the figure, the characteristic of uniform grid is that all grid cells have the same size, while the cell sizes of non-uniform grid are different. Among them, non-uniform grid can better adapt to the specific shape of the model, but it may also introduce numerical dispersion, resulting in unstable simulation results.
[0004] The present invention aims to solve the stability problem that may be caused by non-uniform grids. Summary of the invention
[0005] In order to solve the above problems, the present invention proposes a symmetric non-uniform FDTD grid generation method based on dynamic constraints. The method ensures that the grid is symmetric about the model center on the basis of satisfying other asymmetric grid constraints.
[0006] The present invention proposes a symmetric non-uniform FDTD grid generation method based on dynamic constraints, comprising:
[0007] Set dynamic constraints for meshing;
[0008] According to the dynamic constraint condition, determining the minimum number of segments into which the space of the three-dimensional model is divided in each dimension, and calculating the length of each segment;
[0009] According to the minimum number of segments and the length of each segment, grid lines are set in each dimension of the three-dimensional model to obtain a final grid of the three-dimensional model, wherein the final grid is a symmetric non-uniform FDTD grid, and the final grid satisfies dynamic constraints and has a minimum number of grids.
[0010] In one embodiment, the space of the three-dimensional model in each dimension is divided into multiple segments, each grid corresponds to a segment, and in the same dimension, the dynamic constraint conditions include:
[0011] The length of each grid is not less than the minimum grid constant;
[0012] The length of each grid is no greater than the maximum grid constant;
[0013] The lengths of the two grids that are symmetrical to each other are equal;
[0014] The ratio of two adjacent grids is within the preset range;
[0015] The length of the grid at the two ends is equal to the minimum grid constant.
[0016] In one embodiment, let the total length of the space of the three-dimensional model in one dimension be L, and divide the space with the total length L into n segments, each with a length of L. i ;
[0017] The length of each grid is not less than the minimum grid constant: L i ≥minSize;
[0018] The length of each grid is no greater than the maximum grid constant: L i ≤maxSize;
[0019] The lengths of the two grids that are symmetrical to each other are equal: L i =L n-1-i ;
[0020] The ratio of the two adjacent grids is within a preset range: , 0 <i<n;
[0021] The length of the grid at both ends is equal to the minimum grid constant: L0=L n-1 =minSize;
[0022] The minimum number of segments by which the space of the three-dimensional model is divided in each dimension is determined as follows: N = min{n | n satisfies the dynamic constraint condition};
[0023] Among them, minSize is the minimum grid constant, maxSize is the maximum grid constant, r is a proportional constant ratio greater than 1, L is the total length of the space in one dimension, n is the number of segments into which the space is divided in one dimension, N is the minimum number of segments, i is the segment number, and 0≤i<n.
[0024] In one embodiment, a method for determining the minimum number of segments into which the space of the three-dimensional model is divided in each dimension comprises the following steps:
[0025] Step 11, let the number of segments n be the minimum possible value of n;
[0026] Step 12, determine whether n is less than the maximum possible value of n, if so, proceed to step 13, otherwise the solution fails;
[0027] Step 13, solve the number of segments n, if there is a solution, the solution is successful, otherwise, set n=n+1 and return to step 12;
[0028] Wherein, in step 11, the method for obtaining the minimum possible value of n is: dividing the total length L by the maximum grid constant maxSize and rounding up the result;
[0029] In step 12, the maximum possible value of n is obtained by dividing the total length L by the minimum grid constant minSize and rounding the result down.
[0030] In step 13, the number of segments n is solved by determining whether n satisfies the dynamic constraint condition.
[0031] In one embodiment, calculating the length of each segment includes: calculating n half When n is an odd or even number, n half = ;
[0032] The calculation of n half segment lengths, including: constructing a segment length calculation function to calculate n half The segment length calculation function includes:
[0033] If n is an odd number, solve the following equation (1) while satisfying the dynamic constraints:
[0034] (1);
[0035] If n is an even number, solve the following equation (2) while satisfying the dynamic constraints:
[0036] (2).
[0037] In one embodiment, the calculation n half Segment lengths include:
[0038] The n to be solved half The segment length is divided into two sections: Nv variable length segments and n half -Nv fixed-length segments, each of which has a length of maxSize;
[0039] Solve the specific lengths of Nv variable-length segments: solve the minimum value minVariableN of the number of variable-length segments Nv, traverse Nv using minVariableN, and solve the specific division of Nv variable-length segments.
[0040] In one embodiment, the step of solving the minimum value minVariableN of the number Nv of variable length segments comprises the following steps:
[0041] Step 21, initialize the values of the total grid length Lsum, the minimum grid constant minSize and minVariableN: initialize the total grid length Lsum to the minimum grid constant minSize, initialize the current grid segment length l to the minimum grid constant minSize, initialize the minimum value of the number of variable length segments Nv as minVariableN to 1, and the total grid length Lsum is the total length of all variable length segments so far;
[0042] Step 22, if the current grid segment length l is less than maxSize, and the total grid length Lsum is less than half of the total length of the space in one dimension L / 2, then execute step 23, otherwise end and return minVariableN;
[0043] Step 23, if minVariableN=n half and n is an odd number, then update the grid segment length l to (l*ratio) / 2, and go to step 24; otherwise, update the grid segment length l to l*ratio, and go to step 24;
[0044] Step 24, update the value of the total grid length Lsum to the current total grid length plus the current grid segment length l, update the minimum value minVariableN of the number of variable length segments Nv to the current minimum value minVariableN plus one, and return to step 22 to continue iteration.
[0045] In one embodiment, the method of traversing Nv by using minVariableN to solve the specific division of Nv variable-length segments includes the following steps:
[0046] Step 31, initializing the number of variable length segments Nv to minVariableN;
[0047] Step 32, determine whether Nv is less than n, if so, proceed to step 33, otherwise the solution fails;
[0048] Step 33, solving the specific division of Nv variable length segments;
[0049] Step 34, determine whether there is a solution, if there is a solution, the solution is successful, otherwise the number of variable length segments Nv is increased by one to update the number of variable length segments Nv, and return to step 32 to continue iteration.
[0050] In one embodiment, in step 33, solving the specific division of Nv variable-length segments specifically includes the following steps:
[0051] Step 331, initialize i to Nv;
[0052] Step 332, determine the length L of all variable length segments m Are they all non-updatable states, where 0≤m<Nv, if not, proceed to step 333, if yes, the solution fails;
[0053] Step 333, determine whether i is less than 0, if so, update i to Nv, and return to step 332 to restart the loop, otherwise go to step 334;
[0054] Step 334, determine the current segment length L i Is it possible to update? If not, then i is subtracted by one to update i, and the process returns to step 332; if yes, then the process proceeds to step 335;
[0055] Step 335: Use Newton's method to solve the equation and update the current segment length L i To the new value L temp , and for L temp With constraints imposed, the Newton method solves the equation as , where f c Represents f in the segment length calculation function e or f0;
[0056] Step 336, determine L i Is it equal to L temp If yes, mark L m If it is not updatable, i is subtracted by 1 to update i, and the process returns to step 332; otherwise, the process proceeds to step 337;
[0057] Step 337, update L i For L temp , all L m Mark as updateable;
[0058] Step 338, determine whether the solution is successful, the successful solution is L i Satisfies the segment length calculation function. If so, the solution is successful. Otherwise, i is reduced by one to update i, and the process returns to step 332 to continue iteration.
[0059] In one embodiment, in step 335, L tempThe calculation method of the constraint value in the imposed constraint is:
[0060] , 0<i<Nv;
[0061] , i=0;
[0062] , 0≤i<Nv-1;
[0063] , i=Nv-1;
[0064] Among them, the is the minimum length of the i-th variable length segment, is the maximum value of the length of the i-th variable length segment, and ratio is a proportional constant;
[0065] In step 335, L temp The process of imposing constraints is:
[0066] ;
[0067] as well as, ;
[0068] Among them, 0≤i<Nv.
[0069] The beneficial effects of the symmetric non-uniform FDTD grid generation method based on dynamic constraints of the present invention are:
[0070] 1. Optimize simulation results and mesh generation efficiency:
[0071] The existing FDTD grid automatic generation algorithm uses a linear increasing or decreasing method to generate a symmetric grid. The present invention can ensure the best simulation results on a symmetric structure model. The generation of symmetric grids not only improves the simulation accuracy, but also reduces the number of grids due to the good matching of the grids and the model structure, thereby improving the simulation efficiency.
[0072] 2. Dynamic constraints and algorithm stability:
[0073] In the iterative process, the present invention uses dynamic constraints on the variables to be solved and decouples the constraint dependencies between the variables, which makes the solution process more flexible and efficient. The completeness of the mathematical theory only requires solving the thread equation, and has a non-zero constant first-order differential, and the numerical error is small, which ensures the stability and efficiency of the solution process. The algorithm is simple, easy to implement and maintain, making the whole process stable and efficient, and easy to understand and operate.
[0074] 3. Flexible Newton iteration and mesh optimization:
[0075] In the Newton iteration of the present invention, the equations for solving the equations and calculating the differentials are different. Different equations are used for the cases where the number of segment divisions is an odd number and an even number, and in particular, the last term in the case of an odd number is processed by summing its half, while keeping the differential formula unchanged, so that when updating the variable L i In addition, by using a gradient algorithm and using more maximum mesh sizes to the greatest extent possible, the number of meshes is reduced, the simulation efficiency is improved, and the stability of the simulation is enhanced, thereby improving the performance of the algorithm as a whole. BRIEF DESCRIPTION OF THE DRAWINGS
[0076] Figure 1 A schematic diagram of a flow chart of a symmetric non-uniform FDTD grid generation method based on dynamic constraints according to an embodiment of the present invention;
[0077] Figure 2 It is a schematic diagram of the spatial segmentation of a three-dimensional model in one dimension;
[0078] Figure 3a is a schematic diagram of a uniform grid;
[0079] Figure 3b is a schematic diagram of a non-uniform grid;
[0080] Figure 3c It is a schematic diagram of a model symmetrical about the Z axis;
[0081] Figure 3d It is a schematic diagram of a non-uniform symmetric grid about the origin;
[0082] Figure 4 A schematic flow chart of a method for solving a minimum number of segments into which a space of a three-dimensional model is divided in each dimension according to an embodiment of the present invention;
[0083] Figure 5 Schematic diagram of a flow chart of a method for calculating a minimum value minVariableN of the number Nv of variable segments according to an embodiment of the present invention;
[0084] Figure 6 It is a flowchart of using minVariableN to traverse Nv to solve the specific division of Nv variable-length segments according to an embodiment of the present invention;
[0085] Figure 7 A schematic diagram of a specific flow chart for solving the specific division of Nv variable-length segments according to an embodiment of the present invention;
[0086] Figure 8a This is a schematic diagram of the results of meshing a disk object using a general asymmetric algorithm;
[0087] Figure 8bThis is a schematic diagram of the result of meshing a disk object using a symmetric non-uniform FDTD mesh generation method based on dynamic constraints according to an embodiment of the present invention;
[0088] Figure 9a It is a schematic diagram of some simulation results of general asymmetric algorithms;
[0089] Figure 9b It is a schematic diagram of some simulation results of a symmetric non-uniform FDTD grid generation method based on dynamic constraints according to an embodiment of the present invention. DETAILED DESCRIPTION
[0090] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the invention and are not used to limit the invention.
[0091] In order to overcome the stability problem that may be caused by non-uniform grids, the present invention introduces many constraints on the grid, such as the ratio of adjacent grid sizes, the aspect ratio of the grid, and the maximum and minimum grid sizes. Figure 3c and 3d ), if the grid can be guaranteed to be symmetrical, the consistency and stability of the results will be increased. The present invention proposes a symmetrical non-uniform FDTD grid generation method based on dynamic constraints, which ensures that the grid is symmetrical about the center of the model on the basis of satisfying other asymmetric grid constraints.
[0092] like Figure 1 As shown, the present invention proposes a symmetric non-uniform FDTD grid generation method based on dynamic constraints, comprising:
[0093] Set dynamic constraints for meshing;
[0094] According to the dynamic constraint conditions, determine the minimum number of segments that the space of the three-dimensional model is divided into in each dimension, and calculate the length of each segment;
[0095] According to the minimum number of segments in each dimension of the three-dimensional model and the length of each segment, grid lines are set to obtain the final grid of the three-dimensional model. The final grid is a symmetrical non-uniform FDTD grid that satisfies dynamic constraints and has the minimum number of grids.
[0096] Furthermore, the space of the 3D model in each dimension is divided into multiple segments, and each grid corresponds to a segment. In the same dimension, the dynamic constraints include:
[0097] The length of each grid is not less than the minimum grid constant;
[0098] The length of each grid is no greater than the maximum grid constant;
[0099] The lengths of the two grids that are symmetrical to each other are equal;
[0100] The ratio of the lengths of two adjacent grids is within a preset range;
[0101] The length of the grid at the two ends is equal to the minimum grid constant.
[0102] Specifically, Figure 2 As shown, let the total length of the space of the three-dimensional model in one dimension be L, divide the space with a total length of L into n segments, each grid corresponds to a segment, and the length of each segment is L i , Among the dynamic constraints mentioned above:
[0103] The length of each grid is not less than the minimum grid constant L i ≥minSize;
[0104] The length of each grid is no greater than the maximum grid constant L. i ≤maxSize;
[0105] The length of the two grids that are symmetrical to each other is equal to L i =L n-1-i ;
[0106] The ratio of two adjacent grids is within the preset range. , 0 <i<n;
[0107] The length of the grid at both ends is equal to the minimum grid constant L0=L n-1 =minSize.
[0108] Among them, minSize is the minimum grid constant, maxSize is the maximum grid constant, and r is a proportional constant ratio greater than 1. These are all input values, which are known quantities set by the user or generated by other algorithms. In addition, L is the total length of the space in one dimension, n is the total number of segments divided in one dimension, and i represents the segment number of the segment.
[0109] The method for determining the minimum number of segments that the space of the three-dimensional model is divided into in each dimension is as follows: let the minimum number of segments be N, N = min{n | n satisfies the dynamic constraint condition}. Specifically, if Figure 4 As shown, the method for solving the minimum number of segments into which the space of the three-dimensional model is divided in each dimension includes the following steps:
[0110] Step 11: Let the number of segments \(n\) be the smallest possible value of \(n\). The method for obtaining the smallest possible value of \(n\) is as follows: round up the result of dividing the total length \(L\) by the maximum grid constant \(maxSize\), that is, the smallest possible value of \(n=\lceil L / maxSize\rceil\). \(\lceil L / maxSize\rceil\) means rounding up the result of dividing \(L\) by \(maxSize\) to get the smallest integer not less than this quotient.
[0111] Step 12: Determine whether \(n\) is less than the largest possible value of \(n\). If so, proceed to Step 13. Otherwise, the solution fails. The method for obtaining the largest possible value of \(n\) is as follows: round down the result of dividing the total length \(L\) by the minimum grid constant \(minSize\), that is, the largest possible value of \(n = \lfloor L / minSize\rfloor\). \(\lfloor L / minSize\rfloor\) means rounding down the result of dividing \(L\) by \(minSize\) to get the largest integer not greater than this quotient.
[0112] Step 13: Solve for the number of segments \(n\). If there is a solution, the solution is successful, and the obtained number of segments \(n\) at this time is the minimum number of segments \(N\). Otherwise, let \(n=n + 1\) and return to Step 12. In this embodiment, solving for the number of segments \(n\) is to determine whether \(n\) satisfies the dynamic constraint condition.
[0113] Specifically, in Step 13, the following steps are included:
[0114] Check whether the number of segments \(n\) satisfies the dynamic constraint condition;
[0115] If the number of segments \(n\) satisfies the dynamic constraint condition, then the number of segments \(n\) is the minimum number of segments \(N\);
[0116] If the number of segments \(n\) does not satisfy the dynamic constraint condition, then update the number of segments \(n=n + 1\) and return to Step 12.
[0117] In other words, the value range of \(n\) is \(\lceil L / maxSize\rceil < n\leqslant\lfloor L / minSize\rfloor\). Just try to solve for \(n\) from small to large until a feasible solution is found, and then the minimum number of segments \(N\) that satisfies the constraint and the length \(L\) of each segment can be obtained. i .
[0118] For solving the length \(L\) of each segment i , since it is required that the grid must be symmetric, only half of the grid length needs to be solved. Therefore, calculating the length \(L\) of each segment i can be converted to: calculating \(n\) half segment lengths \(L\) i . Among them, when \(n\) is odd or even, \(n\) half = .
[0119] In this embodiment, the length of each segment \(L\) is calculated by constructing a segment length calculation function for \(n\) halfThe segment length calculation function includes:
[0120] If n is an odd number, solve the following equation (1) while satisfying the dynamic constraints:
[0121] (1);
[0122] If n is an even number, solve the following equation (2) while satisfying the dynamic constraints:
[0123] (2).
[0124] Among them, f0 and f e are all functions in the segment length calculation function. The purpose of this segment length calculation function is to try to find a length distribution when n is an odd or even number, so that the sum of the lengths of half of the grids (except the middle grid) plus half of the length of the middle grid equals half of the total length L. In other words, it tries to ensure that the grid is symmetrical in the middle and the total lengths of the left and right sides are equal. In the subsequent solution process, this application will also use branches to handle two different situations.
[0125] Furthermore, for the n to be solved half The segment length can be divided into two sections: Nv variable length segments and (n half -Nv) fixed-length segments, the length of the fixed-length segment is maxSize. Then the specific lengths of the Nv variable-length segments can be solved. Let the minimum value of the number of variable-length segments Nv be minVariableN. In this embodiment, the specific division of the Nv variable-length segments can be further solved by solving the minimum value of the number of variable-length segments Nv, minVariableN.
[0126] like Figure 5 As shown, the calculation method of minVariableN includes the following steps:
[0127] Step 21, initialize the total grid length Lsum, the minimum grid constant minSize and the value of minVariableN: initialize the total grid length Lsum to the minimum grid constant minSize, initialize the current grid segment length l (lowercase L) to the minimum grid constant minSize, and initialize the minimum value of the number of variable length segments Nv as minVariableN to 1. That is, Lsum:=minSize, l:=minSize, minVariableN:=1 as shown in the figure. It should be noted that the total grid length Lsum here is the total length of all variable length segments so far (i.e., the grid segments considered in the iteration process).
[0128] Step 22: If the current grid segment length l is less than maxSize, and the total grid length Lsum is less than half of the total spatial length L in one dimension (i.e., L / 2), then execute step 23. Otherwise, the process ends and returns the value of minVariableN. The value of minVariableN returned here is the minimum value minVariableN of the number of variable-length segments Nv finally obtained in this embodiment.
[0129] Step 23, if minVariableN=n half If n is an odd number, the grid segment length l is updated to (l*ratio) / 2, that is, l:=(l*ratio) / 2, and the process proceeds to step 24. Otherwise, the grid segment length l is updated to l*ratio, that is, l:=l*ratio, and the process proceeds to step 24.
[0130] Step 24, update the value of the total grid length Lsum to the current total grid length Lsum plus the current grid segment length l, update the minimum value minVariableN of the number of variable length segments Nv to the current minimum value plus one, that is, Lsum:=Lsum+l, minVariableN:=minVariableN+1, and return to step 22 to continue iteration.
[0131] After obtaining the minimum value minVariableN of the number of variable length segments Nv, traverse Nv until a solution for the specific division of Nv variable length segments is found, that is, the specific length of Nv variable length segments. Figure 6 As shown, traverse Nv until a solution for the specific division of Nv variable-length segments is found, which specifically includes the following steps:
[0132] Step 31, initialize the number of variable length segments Nv to minVariableN, that is, Nv:=minVariableN.
[0133] Step 32, determine whether Nv is less than n, according to the above description, n is the total number of segments in which the space is divided in one dimension. If yes, proceed to step 33, otherwise the solution fails.
[0134] Step 33, solving the specific division of Nv variable length segments. This step is to find the specific length of the variable length segment that meets all constraints under the given Nv.
[0135] Step 34, determine whether there is a solution, if there is a solution, the solution is successful, otherwise the number of variable length segments is increased by one to update the number of variable length segments, that is, Nv=Nv+1, and return to step 32 to continue iteration.
[0136] Specifically, Figure 7 As shown, in step 33, solving the specific division of Nv variable-length segments includes the following steps:
[0137] Step 331, initialize i to Nv, that is, i:=Nv in the figure. This step initializes the loop variable i and sets i to Nv for traversing each variable length segment L in the next step. m (where 0≤m < Nv).
[0138] Step 332, determine the length L of all variable length segments m Are they all non-updatable states, where 0≤m<Nv. If not, proceed to step 333, otherwise the solution fails.
[0139] Step 333, determine whether i is less than 0, if so, update i to Nv, and return to step 332 to restart the loop, otherwise enter step 334. If i is less than 0, it means that all variable length segments have been iterated, and the algorithm will restart the loop to ensure that all variable length segments are optimized.
[0140] Step 334, determine the current segment length L i Is it possible to update? If not, then i is updated by reducing i by 1, that is, i=i-1, and the process returns to step 332 to continue iterating and try to find a better solution. Otherwise, the process proceeds to step 335.
[0141] Step 335, calculate L i The new value L temp , for L temp In this embodiment, Newton's method is used to solve the equation to calculate L temp ,Newton’s method is an iterative optimization algorithm used to find the local minimum of a function.
[0142] Step 336, determine L i Is it equal to L temp If yes, mark L m If L is not updatable, then i is subtracted by 1 to update i, i.e., i=i-1, and the process returns to step 332. This step means that if L i Equal to L temp , indicating that L i The optimal state has been reached and no further optimization is required. m Mark as not updatable. Otherwise, proceed to step 337.
[0143] Step 337, update L i For L temp , all L m Mark as updateable.
[0144] Step 338, determine whether the solution is successful, if so, the solution is successful, otherwise, i is updated by reducing i by 1, that is, i=i-1, and return to step 332 to continue iteration. In this embodiment, the solution is successful: L i It satisfies the segment length calculation function described above, namely, equation (1) and equation (2).
[0145] The above steps are a key part of the entire algorithm process, which ensures that each variable length segment is optimized so that the entire grid reaches the optimal state.
[0146] Among them, in step 335, Newton's method is used to solve the equation to calculate L temp , it is obvious that for any i , is no longer calculated in the algorithm, and 1 is used directly. , where f c represents the f in the segment length calculation function described above e or f0.
[0147] Due to L i_temp The imposed constraints change with each iteration, so they are called dynamic constraints. temp The constraint value for an imposed constraint is calculated as:
[0148] , 0<i<Nv. Among them, for the first variable length segment, that is, when i=0, i-1 has no meaning, so The calculation method of is specially processed. .
[0149] , 0≤i<Nv-1. When i=Nv-1, The calculation method of is also a special treatment. Specifically: when i=Nv-1, .
[0150] Among them, the is the minimum length of the i-th variable length segment, is the maximum value of the length of the i-th variable length segment, and ratio is a proportional constant.
[0151] This step calculates the maximum and minimum allowed values for each segment. and , and then use these two values as constraints and apply them in the following steps superior.
[0152] The steps to impose constraints are:
[0153] ;
[0154] as well as, .
[0155] This step is a key part of the entire algorithm flow, which ensures that each new grid segment length L temp All are within the range of dynamic constraints, making the entire mesh generation process more stable and efficient.
[0156] Figure 8a and Figure 8b They are the meshing results of a disk object using a general asymmetric algorithm and this method. In the meshing result of the general asymmetric algorithm, the mesh sizes at the symmetric positions may be unequal, while in the meshing result of this method, the mesh sizes at the symmetric positions are equal. Figure 9a and Figure 9b They are the differences in their corresponding partial simulation results. The results in the asymmetric grid will be asymmetric, while the results in the symmetric grid are symmetric.
[0157] The beneficial effects of the symmetric non-uniform FDTD grid generation method based on dynamic constraints of the present invention are:
[0158] 1. Optimize simulation results and mesh generation efficiency:
[0159] The existing FDTD grid automatic generation algorithm uses a linear increasing or decreasing method to generate a symmetric grid. The present invention can ensure the best simulation results on a symmetric structure model. The generation of symmetric grids not only improves the simulation accuracy, but also reduces the number of grids due to the good matching of the grids and the model structure, thereby improving the simulation efficiency.
[0160] 2. Dynamic constraints and algorithm stability:
[0161] In the iterative process, the present invention uses dynamic constraints on the variables to be solved and decouples the constraint dependencies between the variables, which makes the solution process more flexible and efficient. The completeness of the mathematical theory only requires solving the thread equation, and has a non-zero constant first-order differential, and the numerical error is small, which ensures the stability and efficiency of the solution process. The algorithm is simple, easy to implement and maintain, making the whole process stable and efficient, and easy to understand and operate.
[0162] 3. Flexible Newton iteration and mesh optimization:
[0163] In the Newton iteration of the present invention, the equations for solving the equations and calculating the differentials are different. Different equations are used for the cases where the number of segment divisions is an odd number and an even number, and in particular, the last term in the case of an odd number is processed by summing its half, while keeping the differential formula unchanged, so that when updating the variable L iIn addition, by using a gradient algorithm and using more maximum mesh sizes to the greatest extent possible, the number of meshes is reduced, the simulation efficiency is improved, and the stability of the simulation is enhanced, thereby improving the performance of the algorithm as a whole.
[0164] Although the above methods are illustrated and described as a series of actions for simplicity of explanation, it should be understood and appreciated that these methods are not limited by the order of the actions, because according to one or more embodiments, some actions may occur in a different order and / or concurrently with other actions from those illustrated and described herein or not illustrated and described herein but understandable to those skilled in the art.
[0165] The above-described embodiments are only further explanations of the present invention, and are not intended to limit the present invention in other forms. The present invention may also have other various embodiments. Without departing from the spirit and essence of the present invention, those skilled in the art may make various corresponding modifications and changes according to the present invention, but these corresponding modifications and changes should all fall within the protection scope of the present invention.
Claims
1. A symmetric non-uniform FDTD grid generation method based on dynamic constraints, characterized in that: include: Set dynamic constraints for meshing; According to the dynamic constraint condition, determining the minimum number of segments into which the space of the three-dimensional model is divided in each dimension, and calculating the length of each segment; According to the minimum number of segments and the length of each segment, grid lines are set in each dimension of the three-dimensional model to obtain a final grid of the three-dimensional model, wherein the final grid is a symmetric non-uniform FDTD grid, and the final grid satisfies dynamic constraints and has a minimum number of grids; The space of the three-dimensional model in each dimension is divided into multiple segments, and each grid corresponds to a segment. Let the total length of the space of the three-dimensional model in one dimension be L, and divide the space with a total length of L into n segments, each with a length of L. i , the calculating the length of each segment includes: the calculating the length of each segment includes: calculating n half When n is an odd or even number, n half = ; The calculation of n half segment lengths, including: constructing a segment length calculation function to calculate n half The segment length calculation function includes: If n is an odd number, solve the following equation (1) while satisfying the dynamic constraints: (1); If n is an even number, solve the following equation (2) while satisfying the dynamic constraints: (2)。 2. The method for generating a symmetrical non-uniform FDTD grid based on dynamic constraints according to claim 1, characterized in that: In the same dimension, the dynamic constraints include: The length of each grid is not less than the minimum grid constant: L i ≥minSize; The length of each grid is no greater than the maximum grid constant: L i ≤maxSize; The lengths of two grids that are symmetrical to each other are equal: L i =L n-1-i ; The ratio of two adjacent grids is within the preset range: , 0 <i<n; The length of the grid at the two ends is equal to the minimum grid constant: L0=L n-1 =minSize; Determine the minimum number of segments that the space of the 3D model is divided into in each dimension: N = min{n | n satisfies the dynamic constraint}; Among them, minSize is the minimum grid constant, maxSize is the maximum grid constant, r is a proportional constant ratio greater than 1, L is the total length of the space in one dimension, n is the number of segments into which the space is divided in one dimension, N is the minimum number of segments, i is the segment number, and 0≤i<n.
3. The method for generating a symmetrical non-uniform FDTD grid based on dynamic constraints according to claim 2, characterized in that: The method for solving the minimum number of segments into which the space of the three-dimensional model is divided in each dimension comprises the following steps: Step 11, let the number of segments n be the minimum possible value of n; Step 12, determine whether n is less than the maximum possible value of n, if so, proceed to step 13, otherwise the solution fails; Step 13, solve the number of segments n, if there is a solution, the solution is successful, otherwise, set n=n+1 and return to step 12; Wherein, in step 11, the method for obtaining the minimum possible value of n is: dividing the total length L by the maximum grid constant maxSize and rounding up the result; In step 12, the maximum possible value of n is obtained by dividing the total length L by the minimum grid constant minSize and rounding down the result; In step 13, the number of segments n is solved by determining whether n satisfies the dynamic constraint condition.
4. The method for generating a symmetrical non-uniform FDTD grid based on dynamic constraints according to claim 1, characterized in that: The calculation of n half Segment lengths include: The n to be solved half The segment length is divided into two sections: Nv variable length segments and n half -Nv fixed-length segments, each of which has a length of maxSize; Solve the specific lengths of Nv variable-length segments: solve the minimum value minVariableN of the number of variable-length segments Nv, traverse Nv using minVariableN, and solve the specific division of Nv variable-length segments.
5. The method for generating symmetrical non-uniform FDTD grids based on dynamic constraints according to claim 4, characterized in that: The method of solving the minimum value minVariableN of the number Nv of variable length segments comprises the following steps: Step 21, initialize the values of the total grid length Lsum, the minimum grid constant minSize and minVariableN: initialize the total grid length Lsum to the minimum grid constant minSize, initialize the current grid segment length l to the minimum grid constant minSize, initialize the minimum value of the number of variable length segments Nv as minVariableN to 1, and the total grid length Lsum is the total length of all variable length segments so far; Step 22, if the current grid segment length l is less than maxSize, and the total grid length Lsum is less than half of the total length of the space in one dimension L / 2, then execute step 23, otherwise end and return minVariableN; Step 23, if minVariableN=n half and n is an odd number, then update the grid segment length l to (l*ratio) / 2, and go to step 24; otherwise, update the grid segment length l to l*ratio, and go to step 24; Step 24, update the value of the total grid length Lsum to the current total grid length plus the current grid segment length l, update the minimum value minVariableN of the number of variable length segments Nv to the current minimum value minVariableN plus one, and return to step 22 to continue iteration.
6. The method for generating symmetrical non-uniform FDTD grids based on dynamic constraints according to claim 4, characterized in that: The method of traversing Nv by using minVariableN to solve the specific division of Nv variable-length segments includes the following steps: Step 31, initializing the number of variable length segments Nv to minVariableN; Step 32, determine whether Nv is less than n, if so, proceed to step 33, otherwise the solution fails; Step 33, solving the specific division of Nv variable length segments; Step 34, determine whether there is a solution, if there is a solution, the solution is successful, otherwise the number of variable length segments Nv is increased by one to update the number of variable length segments Nv, and return to step 32 to continue iteration.
7. The method for generating a symmetrical non-uniform FDTD grid based on dynamic constraints according to claim 6, characterized in that: In step 33, solving the specific division of Nv variable-length segments specifically includes the following steps: Step 331, initialize i to Nv; Step 332, determine the length L of all variable length segments m Are they all non-updatable states, where 0≤m<Nv, if not, proceed to step 333, if yes, the solution fails; Step 333, determine whether i is less than 0, if so, update i to Nv, and return to step 332 to restart the loop, otherwise go to step 334; Step 334, determine the current segment length L i Is it possible to update? If not, then i is subtracted by one to update i, and the process returns to step 332; if yes, then the process proceeds to step 335; Step 335: Use Newton's method to solve the equation and update the current segment length L i To the new value L temp , and for L temp With constraints imposed, the Newton method solves the equation as , where f c Represents f in the segment length calculation function e or f0; Step 336, determine L i Is it equal to L temp If yes, mark L m If it is not updatable, i is subtracted by 1 to update i, and the process returns to step 332; otherwise, the process proceeds to step 337; Step 337, update L i For L temp , all L m Mark as updateable; Step 338, determine whether the solution is successful, the successful solution is L i Satisfies the segment length calculation function. If so, the solution is successful. Otherwise, i is reduced by one to update i, and the process returns to step 332 to continue iteration.
8. The method for generating symmetrical non-uniform FDTD grids based on dynamic constraints according to claim 7, characterized in that: In step 335, L temp The calculation method of the constraint value in the imposed constraint is: ,0<i<Nv; ,i=0; ,0≤i<Nv-1; ,i=Nv-1; Among them, the is the minimum length of the i-th variable length segment, is the maximum value of the length of the i-th variable length segment, and ratio is a proportional constant; In step 335, L temp The process of imposing constraints is: ; as well as, ; Among them, 0≤i<Nv.
