1. Field of the Invention
The present invention relates to a device, a method, and a program for generating a grid for the use of analyzing a physical quantity relating to the geometry of an object by using a computer.
2. Description of the Related Art
In recent years, a technology for an analysis (or simulation) of a physical quantity relating to the geometry of an object using a computer has been developed. For example, such analyses as three-dimensional fluid analysis, thermal analysis, and electromagnetic field analysis of the surroundings of a target object.
In such kinds of analysis, a grid (or a mesh), as shown in
Grids are generated in consideration of the orientation or posture of a target object (hereinafter referred to as a “component”) defined by a computer. The physical quantity relating to the geometry of the component is analyzed by providing parameters to each cell acquired from the grids and by solving equations corresponding to the model to be analyzed. In order to enhance arithmetic accuracy of the analysis, it is desirable to generate grid lines, which define each cell, so as to run through a feature point (for example, a vertex) of the component geometry at this point.
Grids used for the above analysis are, for example, generated as by the following procedure. First, a plurality of polygon data for specifying the geometry of the component is generated, and as shown in
In Patent Document 1 (Japanese laid-open unexamined patent publication No. 11-259684 (especially FIG. 1, paragraphs 0021-0027 of the specification)), a technology of a device for generating a mesh for analyzing a three-dimensional geometry model and effective performance of the generation is described.
In the above analysis, the grid lines (including the base grid lines and the auxiliary grid lines) are placed at even intervals, and, when the aspect ratio of each cell is favorable, arithmetic accuracy can be improved. Here, “the aspect ratio of a cell” means the ratio of the lengths of the X direction, the Y direction and the Z direction (the ratio of the length of the X direction and the Y direction in a two-dimensional model), and the arithmetic accuracy is higher as the ratio of one cell is closer to that of the others.
As explained above, the base grid line can be automatically generated. However, when automatically generating the base grid line, the intervals of the grid lines may be excessively narrow for some components, depending on the geometry of the component. In such a case, cells with a poor aspect ratio are generated, and consequently, the arithmetic accuracy is reduced. It is possible to improve the aspect ratio by generating auxiliary grid lines on the basis of the narrowest base grid intervals. However, by so doing, the geometry of some components may require generation of an enormous number of auxiliary grid lines, resulting in an increase in the amount of calculation.
The auxiliary grid lines, as explained above, require manual setting by a user. At such a time, the user has to set each auxiliary grid line one by one using a keyboard, a mouse and so forth. Thus, the task is time-consuming and troublesome.
It is an object of the present invention to provide a method for facilitated generation of a grid, which bears a highly precise analysis result in a technology for analyzing a physical quantity relating to the geometry of an object by using a computer.
The grid generation method of the present invention, which generates a grid for the use of an analysis of a physical quantity relating to the geometry of an object using a computer, the method comprising: generating a plurality of base grid elements, each of which passes through each of a plurality of feature points, which specify the geometry of the object, and generating an auxiliary grid element of the number designated by grid element number information, and arranging the generated auxiliary grid element between the base grid elements.
According to the method, after generating the base grid elements, by inputting the grid element number information without individually setting the auxiliary grid elements, the auxiliary grid elements are generated in the number a user requests, and are arranged between the base grid elements. The grid element is a concept of a grid line in a two-dimensional model and of a grid plane in a three-dimensional model.
In the above grid generation method, the base grid element can be deleted or added according to the shortest interval information designating the shortest interval between the base grid elements. According to the method, the grid interval will not fall below a prescribed value (i.e. interval designated by the shortest interval information). Thus, deterioration of the aspect ratio of the grid can be prevented. Consequently, the accuracy of analysis is improved.
According to the present invention, generation of a grid, which produces highly accurate analysis results in an analysis technology for a physical quantity relating to the geometry of an object using a computer, can be facilitated.
In the system with the above configuration, the method relating to the present invention generates a grid for the use of software of the analysis of a physical quantity relating to the geometry of an object or a plurality of objects (hereinafter referred to as “component(s)”) defined by the computer 1.
As described in
In the two-dimensional model, a rectangular grid is generated by performing the above procedures for each of the X direction and the Y direction. In the three-dimensional model, a cuboid grid is generated by performing the above procedure for each of the X direction, the Y direction and the Z direction. When performing the analysis, no distinction should be made between the base grid lines and the auxiliary grid lines.
In step S1, by detecting the coordinate of each vertex, the base grid lines are generated. In step S2, the shortest interval information designating the shortest interval of the base grid lines is acquired. The shortest interval information is input by the user. When the input is not provided by the user, a default value prepared in advance is acquired. In step S3, according to the shortest interval information, a base grid line is deleted (if needed). In other word, when the interval between two adjacent base grid lines is shorter than the shortest interval designated by the shortest interval information, one of the base grid lines is deleted. Here, it is possible to add a base grid line according to the shortest interval information. However, when the base grid lines have already been generated for all vertices, an additional base grid line cannot be added.
In step S4, grid number information, which designates the number of the auxiliary grid lines to be generated (or the number of all grid lines), is acquired. The grid number information is input by the user. When the input is not provided by the user, a default value prepared in advance is acquired. In step S5, an auxiliary grid line is generated (or added/deleted), and is inserted between the relevant base grid lines.
The grid comprises “grid lines” in the two-dimensional model, whereas the grid comprises “grid planes” in the three-dimensional model. However, in this description, for ease of explanation, the concept including the grid line and the grid plane is generally referred to as the “grid line”.
As described in
Next, a dialog box shown in
When the shortest grid interval is designated, in
If the user changes the shortest grid interval value after the base grid line is deleted as described above, and the changed shorted grid interval value is shorter than the interval D2, the base grid line B3 is added and the arrangement of the grid is in the original state shown in
As described above, in the grid generation method of the embodiment, the base grid line is automatically deleted or added after the base grid line is generated, based on the shortest grid interval value designated by the user. Consequently, the method prevents the grid from becoming finer than necessary, and also prevents deterioration of the aspect ratio of a cell formed by the grid. As a result, accuracy of the analysis performed using the grid is improved. User-friendliness is achieved by the fact that a simple operation of the slider allows the user to designate the shortest grid interval value.
A dialog box shown in
The slider 21 can designate any value from the smallest number of lines to a predetermined value. The value designated by the slider 21 is displayed in an area 23. The designation of the number of grid lines can be performed individually in the X direction and in the Y direction. It is also possible for the user to input a desired number of grid lines directly into the area 23 using the keyboard 2.
The auxiliary grid line is inserted into the region where the grid interval is the longest. When a plurality of the auxiliary grid lines are generated each auxiliary grid line is inserted in descending order of grid interval. In the following description, a case in which three auxiliary grid lines are inserted is explained.
In
In
In addition, in
As described above, in the grid generation method of the embodiment, the designation of the number of grid lines alone enables arrangement of the grid lines at essentially equal intervals. In other words, a grid with homogenous spacing throughout the entire range can be generated without concerning users of complicated operations.
In the following description, details of the grid generation method of the embodiment are set forth.
In step S11, a variable C for sequentially defining components is initialized. In step S12, coordinate data of each vertex of a specified component is acquired from the component definition table, and is registered in a list. In step S13, the next component is specified by incrementing the variable C. In step S14, whether or not any component, on which the processing of step S12 is to be performed, remains is checked. If such a component remains, the process returns to step S12; however, if the processing of step S12 is finished for all components, the process proceeds to step S15.
In step S15, coordinate data is rearranged in ascending order of the coordinate data for each of the X coordinates, the Y coordinates and the Z coordinates, and is registered in a grid table. Base grid lines are generated according to the grid table in step S16. By so doing, base grid lines passing through each vertex are generated.
In
In the grid generation method of the present embodiment, when there is a plurality of components, the user can assign a priority to each component. The priority of each component is registered in a priority table shown in
In step S21, a user instruction input using the slider 11 is acquired. That is, the position of the tab 12 is detected. In step S22, the shortest grid interval is calculated based on the position of the tab 12. In step S23, all base grid lines are set to an OFF state. In other words, in the grid table shown in
In step S24, in the grid table, ON is set in a record for “variable N=1” as the “Presence/absence of grid line”. By so doing, a first base grid line is generated.
In step S25, the coordinates of the Nth and the N+1th vertices are acquired from the grid table. In step S26, first, the difference between the coordinates of the Nth and the N+1th vertices (i.e. the interval) is calculated. This interval and the shortest grid interval calculated in step S22 are compared. When the result shows that the interval between the Nth vertex and the N+1th vertex is shorter than the shortest grid interval, “N+1” is incremented, while “N” is fixed and the process returns to step S25. By so doing, the interval between the Nth vertex and the N+2th vertex can be compared with the shortest grid interval. steps S25 and S26 are carried out, subsequently, until a vertex bearing a longer interval than the shortest grid interval is found.
In step S27, ON is set in “Presence/absence of grid line” of the grid table for all vertices detected in steps S25 and S26. By so doing, a base grid line passing through a vertex, which satisfies the condition of step S26 is generated. In step S28, whether or not steps S25 through S27 have been performed on all vertices is checked. If any unprocessed vertex remains, the process returns to step S25 after incrementing the variable N.
In such a way, according to the grid generation method of the present embodiment, a base grid line is generated so as to prevent the interval of the base grid lines from being smaller than the shortest grid interval designated by a user. In other words, when the user reduces the shortest grid interval by operating the slider 11, base grid lines are deleted so as to meet the above conditions, as necessary. Meanwhile, when the user increases the shortest grid interval by operating the slider 11, base grid lines are added within a range, which meets the above conditions, as necessary. It is desirable that the drawing of the base grid line on the display device 4 is performed in real time upon operation of the slider 11.
In step S31, with reference to the priority table, a list, which rearranges the data relating to each vertex according to priority, is produced. In step S32, processing in a flowchart shown in
In step S33, the next component is selected according to its priority. In the following description, each vertex belonging to a component selected in step S33 is represented by a variable M. In step S34, the coordinate of the Mth vertex is acquired. In step S35, with reference to the grid table, the coordinates of vertices (both a vertex on the positive side and a vertex on the negative side) adjacent to the Mth vertex are acquired. At that time, a vertex adjacent to the Mth vertex is extracted from among the vertices of which the grid line setting is ON.
In step S36, the interval between the Mth vertex and the adjacent vertex is compared with the shortest grid interval. When both the interval between the Mth vertex and the adjacent vertex on the positive side and the interval between the Mth vertex and the adjacent vertex on the negative side are longer than the shortest grid interval, the grid of the Mth vertex is set to ON in step S37. By so doing, a grid passing through the Mth vertex is generated. Step S38 is established to perform processing in steps S34 through S37 for all vertices belonging to the selected component. Step S39 is established to perform processing in steps S34 through S37 for all components.
As described above, according to the processing in the flowchart, when deletion of a base grid line is necessary, a base grid line, which passes through a vertex of a component with low priority, is to be deleted. Therefore, the accuracy of the analysis relating to a component with high priority is not decreased. It is desirable that the drawing of the base grid line on the display device 4 is performed in real time upon the operation of the slider 11.
In step S41, an instruction input by the user using the slider 21 is acquired. That is, change in the position of the tab 22 is detected. In step S42, the number of auxiliary grid lines to be added or to be deleted (the increased number ΔM) is calculated based on the direction of movement and the distance of movement of the tab 22. In this description, the tab 22 of the slider 21 in
Steps S44 through S48 are processing for detecting the region where the grid interval is the longest. In step S44, a variable N for identifying vertices, a variable Nmax for identifying a vertex of which the interval to the adjacent vertex is the longest, and a variable Dmax representing the interval value corresponding to the variable Nmax are initialized. In step S45, a grid interval d(N) between the base grid line passing through the Nth vertex (hereinafter referred to as the base grid line N) and its adjacent base grid line (hereinafter referred to as the base grid line N+1) is calculated. The equation used for the calculation is “d(N)=D(N)/{n(N)+1}”. D(N) represents the interval between the base grid line N and the base grid line N+1. n(N) represents the number of auxiliary grid lines which have previously arranged between the base grid line N and the base grid line N+1. In step S46, the newly calculated grid interval d(N) is compared with the maximum value of the grid interval Dmax, which was previously calculated. When the newly calculated grid interval d(N) is longer than the Dmax, then, the maximum value Dmax is updated.
In step S49, the grid number in the region where the grid interval is the longest is incremented. In other words, when the grid interval in a region between the Nth vertex and the N+1th vertex is the longest, “1” is added to the grid number of the record of the Nth vertex in the grid table shown in
In such a way, according to the grid generation method of the present embodiment, upon receiving an instruction to increase the number of grid lines, the region where the grid interval is the longest is detected, and the new auxiliary grid line is automatically added to the region. Thus, a grid with homogenous spacing throughout the entire range can be acquired while reducing the burden on the user.
In step S51, the total number of grid lines M_all is calculated along with the deletion or addition of base grid lines in response to the operation of the slider 11. The processing of deleting or adding base grid lines is the same as in the explanation provided with reference to
In step S52, the variable n, representing the total number of the auxiliary grid lines inserted between the base grid lines, is initialized. Processing in steps S53 through S58 is basically the same as the processing in steps S44 through S49. That is, a region where the grid interval is the longest is detected, and the number of auxiliary grid lines to be incremented n(i) in the region is determined. Then using step S59, the processing in steps S53 through S58 is repeatedly performed until the variable M for counting the grid lines reaches the total number M_all.
The above functions or procedures are realized by executing a program, in which the process shown in the above flowcharts is described, by a computer. The program relating to the present invention is provided by a method shown in
(1) Provided after being installed in the computer 1. In such a case, the program is preinstalled in the memory of the computer 1 before the shipping of the computer, for example.
(2) Provided after being stored in the portable recording media 101. In such a case, the program stored in the portable recoding media is basically installed in a memory device via a recording media driver. A semiconductor assembly (such as a PC card), media to which information is input/output by magnetic effects (such as a flexible disk or magnetic tape), and media to which information is input/output optically (such as an optical disk) are appropriate for the portable recording media 101.
(3) Provided from a program server 102 provided in a network. In such a case, the computer 1 acquires an appropriate program by downloading from a program server 102. Alternatively, the computer 1 can use programs stored on the program server 102 without downloading them.
Number | Date | Country | Kind |
---|---|---|---|
2005-186748 | Jun 2005 | JP | national |