Spatial Curve Calculation Result Mapping Method for Multi-Physical Field Numerical Calculation Software
By obtaining line points on the spatial curve in the multi-physics numerical calculation software, calculating the arc length value and result value, and performing two-dimensional mapping, the problem of low visualization efficiency of spatial curves in traditional technology is solved, and efficient visualization and accurate result mapping are achieved.
Patent Information
- Application Number
- CN202510460651.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-14
- Publication Date
- 2025-06-27
- Estimated Expiration
- 2045-04-14
AI Technical Summary
Traditional multiphysics numerical calculation software is less efficient when processing spatial curve visualization, resulting in insufficient visualization efficiency and accuracy of processing results.
By obtaining multiple line points on the spatial curve, the arc length value of each line point to the initial point of the curve is calculated, and the result value of each line point is determined according to the grid cell, and a two-dimensional mapping process is performed to obtain the target mapping result of the spatial curve.
The visualization efficiency and accuracy of spatial curve processing results are improved, and efficient mapping and visualization of any spatial curve picked up in multi-physics numerical calculation software is realized.
Smart Images

Figure CN119989444B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular, to a method, device, computer device, storage medium, and computer program product for mapping the calculation results of space curves of a multi-physical field numerical calculation software. Background Art
[0002] Currently, multi-physical field calculation technology is an effective means to improve product quality, shorten the design cycle, and enhance product competitiveness, and has broad application prospects and industrial value in assisting the industrial manufacturing industry to achieve a higher level of intelligent transformation and optimizing the maintenance strategies of aerospace equipment.
[0003] In traditional technologies, the processing results of space curves by multi-physical field numerical calculation software usually display three-dimensional model data, which requires a long visualization processing time, resulting in low visualization efficiency of the processing results of space curves. Summary of the Invention
[0004] Based on this, in view of the above technical problems, it is necessary to provide a method, device, computer device, computer-readable storage medium, and computer program product for mapping the calculation results of space curves of a multi-physical field numerical calculation software, which can improve the visualization effect of the processing results of space curves.
[0005] In a first aspect, the present application provides a method for mapping the calculation results of space curves of a multi-physical field numerical calculation software. The method includes:
[0006] Obtain a space curve picked up in the multi-physical field numerical calculation software, and arrange a plurality of line points on the space curve;
[0007] Determine a curve starting point from the endpoints of the space curve, and obtain the arc length value of each line point to the curve starting point;
[0008] According to the target grid cell to which each line point belongs in the grid cell of the multi-physical field numerical calculation software, determine the result value of each line point;
[0009] Perform two-dimensional mapping processing on the arc length value and the result value to obtain the target mapping result of the space curve.
[0010] In one of the embodiments, obtaining a space curve picked up in the multi-physical field numerical calculation software includes:
[0011] In response to a selection operation triggered by a space scene in the multi-physical field numerical calculation software, obtain the position coordinates corresponding to the selection operation;
[0012] Convert the position coordinates into a ray in the world coordinate system, and determine the intersection points of the ray with all curves in the spatial scene through ray tracing processing;
[0013] Filter out the target intersection point closest to the ray from the intersection points;
[0014] Use the curve where the target intersection point is located as the picked spatial curve.
[0015] In one embodiment, before determining the result value of each line point according to the target grid cell to which each line point belongs in the grid cell of the multi-physics field numerical calculation software, it further includes:
[0016] Obtain the grid information in the multi-physics field numerical calculation software; the grid information includes cell information;
[0017] Obtain the grid cells in the multi-physics field numerical calculation software according to the cell information;
[0018] In the grid cells, determine the target grid cell to which each line point belongs.
[0019] In one embodiment, determining the result value of each line point according to the target grid cell to which each line point belongs in the grid cell of the multi-physics field numerical calculation software includes:
[0020] Obtain the shape function corresponding to the target grid cell to which each line point belongs;
[0021] Perform interpolation processing on the cell result value corresponding to the target grid cell to which each line point belongs through the shape function to obtain the result value of each line point.
[0022] In one embodiment, performing two-dimensional mapping processing on the arc length value and the result value to obtain the target mapping result of the spatial curve includes:
[0023] Use the arc length value from each line point to the starting point of the curve as the abscissa, and use the result value of each line point as the ordinate to plot a two-dimensional scatter plot of the arc length value and the result value;
[0024] Obtain the target mapping result of the spatial curve according to the two-dimensional scatter plot.
[0025] In one embodiment, arranging multiple line points on the spatial curve includes:
[0026] Determine the first line point and the last line point on the spatial curve;
[0027] Obtain a plurality of line points on the space curve according to the first line point, the last line point, and a preset number of line points.
[0028] In a second aspect, the present application further provides a spatial curve calculation result mapping device for a multi-physical field numerical calculation software. The device includes:
[0029] A line point acquisition module, configured to acquire a space curve picked up in the multi-physical field numerical calculation software, and arrange a plurality of line points on the space curve;
[0030] An arc length value acquisition module, configured to determine an initial curve point from the endpoints of the space curve, and acquire the arc length value of each line point to the initial curve point;
[0031] A result value acquisition module, configured to determine the result value of each line point according to the target grid cell to which each line point belongs in the grid cells of the multi-physical field numerical calculation software;
[0032] A mapping processing module, configured to perform two-dimensional mapping processing on the arc length value and the result value to obtain a target mapping result of the space curve.
[0033] In a third aspect, the present application further provides a computer device. The computer device includes a memory and a processor. The memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:
[0034] Acquire a space curve picked up in the multi-physical field numerical calculation software, and arrange a plurality of line points on the space curve;
[0035] Determine an initial curve point from the endpoints of the space curve, and acquire the arc length value of each line point to the initial curve point;
[0036] Determine the result value of each line point according to the target grid cell to which each line point belongs in the grid cells of the multi-physical field numerical calculation software;
[0037] Perform two-dimensional mapping processing on the arc length value and the result value to obtain a target mapping result of the space curve.
[0038] In a fourth aspect, the present application further provides a computer-readable storage medium. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the following steps are implemented:
[0039] Acquire a space curve picked up in the multi-physical field numerical calculation software, and arrange a plurality of line points on the space curve;
[0040] Determine the initial point of the curve from the end points of the space curve, and obtain the arc length value of each line point to the initial point of the curve;
[0041] According to the target grid cell to which each line point belongs in the grid cell of the multi-physics numerical calculation software, determine the result value of each line point;
[0042] Perform two-dimensional mapping processing on the arc length value and the result value to obtain the target mapping result of the space curve.
[0043] In a fifth aspect, the present application also provides a computer program product. The computer program product includes a computer program, and when the computer program is executed by a processor, the following steps are implemented:
[0044] Obtain the space curve picked up in the multi-physics numerical calculation software, and arrange a plurality of line points on the space curve;
[0045] Determine the initial point of the curve from the end points of the space curve, and obtain the arc length value of each line point to the initial point of the curve;
[0046] According to the target grid cell to which each line point belongs in the grid cell of the multi-physics numerical calculation software, determine the result value of each line point;
[0047] Perform two-dimensional mapping processing on the arc length value and the result value to obtain the target mapping result of the space curve.
[0048] The above-mentioned method, device, computer device, storage medium and computer program product for mapping the calculation result of the space curve of the multi-physics numerical calculation software obtain the space curve picked up in the multi-physics numerical calculation software, and arrange a plurality of line points on the space curve; determine the initial point of the curve from the end points of the space curve, and obtain the arc length value of each line point to the initial point of the curve; according to the target grid cell to which each line point belongs in the grid cell of the multi-physics numerical calculation software, determine the result value of each line point; perform two-dimensional mapping processing on the arc length value and the result value to obtain the target mapping result of the space curve. By using this method, the mapping of the processing result of any space curve picked up in the multi-physics numerical calculation software is realized, and the visualization efficiency and accuracy of the processing result of the space curve are effectively improved. Description of the Drawings
[0049] Figure 1 It is a schematic flow chart of the method for mapping the calculation result of the space curve of the multi-physics numerical calculation software in an embodiment;
[0050] Figure 2 It is a schematic flow chart of the step of determining the target grid cell to which each line point belongs in an embodiment;
[0051] Figure 3 Schematic diagram of the triangular area coordinate representation of line points in an embodiment;
[0052] Figure 4 Schematic diagram of a two-dimensional scatter plot drawn according to arc length values and result values in an embodiment;
[0053] Figure 5 Schematic diagram of the connected two-dimensional scatter plot in an embodiment;
[0054] Figure 6 Schematic flowchart of the method for mapping the calculation results of space curves of multi-physics numerical calculation software in another embodiment;
[0055] Figure 7 Schematic flowchart of the method for mapping the calculation results of space curves of multi-physics numerical calculation software in yet another embodiment;
[0056] Figure 8 Structural block diagram of the device for mapping the calculation results of space curves of multi-physics numerical calculation software in an embodiment;
[0057] Figure 9 Internal structure diagram of a computer device in an embodiment. Detailed implementation manners
[0058] In order to make the objectives, technical solutions and advantages of the present application clearer and more understandable, the present application will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0059] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in the present application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data need to comply with relevant regulations.
[0060] In one embodiment, as Figure 1 shown, a method for mapping the calculation results of space curves of multi-physics numerical calculation software is provided. In this embodiment, the method is exemplified by being applied to a terminal. It can be understood that the method can also be applied to a server, and can also be applied to a system including a terminal and a server, and is implemented through the interaction between the terminal and the server. In this embodiment, the method includes the following steps:
[0061] Step S101, obtain the space curve picked up in the multi-physics numerical calculation software, and arrange a plurality of line points on the space curve.
[0062] Among them, the multi-physics field numerical calculation software can be finite element simulation software. Finite Element Analysis (FEA) is a computer-aided engineering (CAE) software based on the finite element method, used to simulate and analyze various engineering problems. Finite element simulation discretizes a complex physical system into multiple small elements (i.e., finite elements), and each element is approximately solved through a mathematical model to achieve the analysis and prediction of the entire system.
[0063] Among them, picking a space curve means selecting and defining a curve that continuously moves in three-dimensional space in the multi-physics field numerical calculation software. This curve can be of any shape as long as it continuously changes in three-dimensional space.
[0064] Among them, a line point refers to a specific point (or spatial point) on the space curve.
[0065] Specifically, in software development, picking a space curve usually involves a graphical user interface (GUI) and three-dimensional graphics processing technology. In the multi-physics field numerical calculation software, the geometry engine can save and render the space curve in the form of a parametric equation, such as a Bezier curve, a B-spline curve, etc.; graphics rendering generally uses graphics APIs such as OpenGL, DirectX, Vulkan, etc. for three-dimensional graphics rendering. In a multi-physics field numerical calculation software containing a geometry engine, the user can select the space curve by means of mouse clicks, etc., and then the terminal takes the space curve selected by the user in the multi-physics field numerical calculation software as the picked space curve.
[0066] Furthermore, it is generally known that a line is composed of countless points. When analyzing the distribution of result values on a space curve, the analysis of result values on the space curve is generally simplified to the analysis of result values at several points. Therefore, it is necessary to distribute points on the space curve. Multiple line points can be distributed on the space curve through the parametric equation of the space curve.
[0067] Step S102, determine the curve starting point from the endpoints of the space curve, and obtain the arc length value from each line point to the curve starting point.
[0068] Among them, the curve starting point refers to the point where the space curve begins in three-dimensional space. The curve starting point is usually an important reference point for determining the shape and direction of the space curve. The arc length value refers to the curve length from the curve starting point of the space curve along the space curve to the specified line point.
[0069] Specifically, the terminal can specify one of the endpoints of the space curve as the curve starting point, or obtain the curve starting point specified by the user for the picked space curve. For example, the coordinates at t = a can be set as the curve starting point of the space curve, then the curve starting point The calculation method is as follows:
[0070]
[0071] The arc length value l from the i-th line point to the initial point of the curve can be calculated by integration i , such as the following integral formula:
[0072]
[0073] In addition to the above integral formula, common numerical integration methods can also be used to calculate the arc length value l from the i-th line point to the initial point of the curve i , such as the trapezoidal method, Simpson's rule, Boole's rule, Gauss-Legendre formula, etc. Taking the Gauss-Legendre method as an example, the four-point Gauss-Legendre formula is used to calculate the above arc length value l i The process is as follows:
[0074]
[0075] In the formula, j represents the index variable in the summation; the value range of j is from 1 to 4, that is, j = 1, 2, 3, 4.
[0076] Among them:
[0077]
[0078]
[0079]
[0080]
[0081]
[0082]
[0083]
[0084] The terminal calculates the arc length value from each line point to the initial point of the curve in sequence.
[0085] Step S103, according to the target grid cell to which each line point belongs in the grid cell of the multi-physics numerical calculation software, determine the result value of each line point.
[0086] Among them, the result value of the line point refers to the numerical result of the physical quantity obtained through multi-physics calculation at a specific position (i.e., the line point). For example, the result value can be the numerical result of physical quantities such as displacement, velocity, stress, temperature, etc.
[0087] Among them, a line point belonging to a certain target grid cell means that the line point is within this target grid cell.
[0088] Specifically, the terminal can first read the grid data in the multi-physics field numerical calculation software to determine which grid cells there are; then judge in which grid cell each line point is located to obtain the target grid cell to which each line point belongs; finally, calculate the result value of each line point according to the cell result value corresponding to the target grid cell.
[0089] Step S104: Perform two-dimensional mapping processing on the arc length value and the result value to obtain the target mapping result of the space curve.
[0090] Among them, the target mapping result refers to the visual representation result of converting the arc length value and the result value into a two-dimensional image.
[0091] Specifically, the terminal maps the arc length value and the result value into a two-dimensional distribution map to characterize the target mapping result of the space curve through the distribution map. By analyzing the distribution map corresponding to the target mapping result, the distribution of the result values of the line points along the space curve can be accurately and clearly analyzed.
[0092] In the above method for mapping the calculation result of the space curve of the multi-physics field numerical calculation software, a space curve picked up in the multi-physics field numerical calculation software is obtained, and multiple line points are arranged on the space curve; the curve starting point is determined from the end points of the space curve, and the arc length value of each line point to the curve starting point is obtained; according to the target grid cell to which each line point belongs in the grid cells of the multi-physics field numerical calculation software, the result value of each line point is determined; two-dimensional mapping processing is performed on the arc length value and the result value to obtain the target mapping result of the space curve. By using this method, the mapping of the processing result of any space curve picked up in the multi-physics field numerical calculation software is realized, effectively improving the visualization efficiency and accuracy of the processing result of the space curve.
[0093] In one embodiment, step S101, obtaining the space curve picked up in the multi-physics field numerical calculation software, specifically includes the following content: in response to a selection operation triggered by the space scene in the multi-physics field numerical calculation software, obtaining the position coordinates corresponding to the selection operation; converting the position coordinates into a ray in the world coordinate system, and determining the intersection points of the ray and all the curves in the space scene through ray tracing processing; screening out the target intersection point closest to the ray from the intersection points; taking the curve where the target intersection point is located as the picked-up space curve.
[0094] Specifically, the terminal responds to a selection operation triggered by the user in the spatial scene of the multi-physics field numerical calculation software. For example, the user can trigger the selection operation for the spatial scene by clicking the mouse. Then, the terminal captures the mouse click event and obtains the position coordinates of the click location. The terminal converts the position coordinates into a ray in the world coordinate system, and then uses ray tracing technology to calculate the intersection points of the ray and all curves in the spatial scene. Finally, the terminal can select the target intersection point closest to the ray and obtain the curve where the target intersection point is located, which is the spatial curve to be picked up.
[0095] In this embodiment, through the selection operation between the user and the spatial scene in the multi-physics field numerical calculation software, the position coordinates corresponding to the selection operation can be accurately captured, so as to accurately process and obtain the spatial curve corresponding to the position coordinates of the selection operation, and then effectively obtain the spatial curve to be picked up, so as to perform calculation processing and visualization of the processing results on the spatial curve selected by the user in the subsequent steps.
[0096] In one embodiment, as Figure 2 shown, before step S103 of determining the result value of each line point according to the target grid cell to which each line point belongs in the grid cell of the multi-physics field numerical calculation software, the following steps are further included:
[0097] Step S201, obtaining grid information in the multi-physics field numerical calculation software; the grid information includes cell information.
[0098] Specifically, in multi-physics field calculation and analysis, the grid information includes node information and cell information. Among them, the node information includes node coordinates and node numbers; the cell information includes cell types (two-node line elements, three-node line elements, three-node triangular elements, etc.) and node connection information (which nodes each cell is composed of, usually represented in the form of a node number list). Multi-physics field calculation software usually uses specific file formats to store grid data. Common formats include:
[0099] (1) ABAQUS INP format: Widely used in ABAQUS software, text format;
[0100] (2) ANSYS CDB format: Binary grid file format supported by ANSYS software;
[0101] (3) NASTRAN BDF / DAT format: File format supported by NASTRAN software, text format;
[0102] (4) VTK format: Format for visualization, supporting multiple multi-physics field calculation software.
[0103] Furthermore, the terminal can parse and read the corresponding grid information in the multi-physics field numerical calculation software through the file format.
[0104] Step S202: Obtain the grid cells in the multi-physics field numerical calculation software according to the cell information.
[0105] Specifically, by analyzing the cell information, the terminal can know which grid cells are included in the spatial scene of the multi-physics field numerical calculation software.
[0106] Step S203: In the grid cells, determine the target grid cell to which each line point belongs.
[0107] Specifically, there are many types of grid cells in the multi-physics field numerical calculation software. For example, the type of grid cell can be a triangle. Taking the triangular grid cell as an example, the area method, the sum of interior angles method, the same-side method, and / or the centroid method can be used to determine whether a line point is inside the triangular grid cell, so as to obtain the target grid cell to which each line point belongs:
[0108] (1) Area method: Calculate the sum of the areas of the three small triangles formed by the line point P and the three vertices A, B, and C of the triangle ABC. If this sum is equal to the area of the large triangle ABC, then the line point P is inside the triangle; otherwise, the line point P is outside the triangle. That is, for the triangle and any line point P as shown in, denote as the area of the triangle. If, then the line point P is outside the triangle; otherwise, it is inside the triangle. Among them, the area can be calculated by Heron's formula or the vector method. Figure 3 as shown for the triangle if , then the line point P is outside the triangle; otherwise, it is inside the triangle. Among them, the area can be calculated by Heron's formula or the vector method.
[0109] (2) Sum of interior angles method: Construct three line segments PA, PB, and PC from the line point P to the three vertices A, B, and C of the triangle ABC. If the sum of the angles between these three line segments and the sides of the triangle ABC is equal to 180°, then the line point P is inside the triangle; otherwise, the line point P is outside. Among them, the angle can be calculated by the dot product of vectors.
[0110] (3) Same-side method: Determine whether the line point P is on the same side with respect to the three sides AB, BC, and CA of the triangle ABC. If the directions of the line point P with respect to these three sides are the same, then the line point P is inside the triangle; otherwise, the line point P is outside. Among them, the cross product of vectors can be used to determine whether the direction of the line point P is the same as that of the three sides of the triangle.
[0111] (4) Centroid method: Use the vectors of any two sides as basis vectors to represent the coordinates of the line point P, and judge whether the line point P is inside the triangle through the value of the coefficient. Taking the triangle and the line point P as an example, represent the vector A1P in the following form: Figure 2 for the triangle and the line point P, represent the vector A1P in the following form:
[0112]
[0113] Substituting the coordinate values of points A1, A2, A3 and the line point P into the above formula, the values of u and v can be obtained. If the coefficients u and v satisfy:
[0114]
[0115] then the line point P is inside the triangle; otherwise, the line point P is outside the triangle.
[0116] For any line point, by using one of the above methods to judge all grid cells one by one, the target grid cell where the line point is located can be obtained.
[0117] In this embodiment, first obtain the grid cells in the multi-physics field numerical calculation software, and then judge the target grid cell to which each line point belongs from the grid cells, which lays a foundation for analyzing the result values of the line points in the subsequent steps and is beneficial to improving the accuracy of the processing results of the space curve.
[0118] In one embodiment, in the above step S103, according to the target grid cell to which each line point belongs in the grid cells of the multi-physics field numerical calculation software, determine the result value of each line point, which specifically includes the following content: obtain the shape function corresponding to the target grid cell to which each line point belongs; through the shape function, perform interpolation processing on the element result value corresponding to the target grid cell to which each line point belongs to obtain the result value of each line point.
[0119] The result value refers to the data generated after the multi-physics field calculation and analysis, which contains the response information of the model under different analysis conditions. These data are usually used to evaluate the performance of the structure, verify the design, optimize the model, etc.
[0120] Among them, the result values can be divided into two categories: node result values and element result values. The node result value indicates that there is a result value at each node, such as node displacement, node stress, etc.; the element result value indicates that there is a result value on each element, such as element strain energy, etc. In practical applications, multi-physics field calculation software usually generates specific result file formats, such as:
[0121] (1) ABAQUS ODB file: The result file format of ABAQUS software;
[0122] (2) ANSYS RST file: The result file format of ANSYS software;
[0123] (3) NASTRAN OP2 / PCH file: The result file format of NASTRAN software;
[0124] (4) and some custom result data file formats.
[0125] Specifically, after determining the target grid cell to which each line point belongs, the terminal can parse and read the result data file corresponding to the target grid cell through the file format specification corresponding to the target grid cell, and then extract the cell result value from the result data file.
[0126] For each line point, obtain the shape function corresponding to the target grid cell where it is located, and combine the result values at all grid nodes in the target grid cell where it is located. Through shape function interpolation, obtain the result value at the line point. Among them, the shape functions of different cell types can be obtained by referring to relevant books. There are many types of multi-physics field grids. Here, the plane triangular element is taken as an example to illustrate the calculation method of the result value of the line point.
[0127] Figure 3 is a schematic diagram of the triangular area coordinate representation of the line point. Assume Figure 3 in the plane triangle The node coordinates are A1(x1, y1), A2(x2, y2), A3(x3, y3) respectively. The shape function of any point P(x, y) in the three-node triangular element is as follows:
[0128]
[0129] In the formula, a n , b n , c n represent coefficients, which can be calculated from the node coordinates ; Δ represents the area of the triangular element. Among them, a n , b n , c n and the calculation methods of Δ are as follows:
[0130]
[0131]
[0132]
[0133]
[0134]
[0135]
[0136] Assume that the result values at the three nodes A1, A2, and A3 are F1, F2, and F3 respectively. Then the result value F at any point P(x, y) in the three-node triangular element can be calculated by the following formula:
[0137]
[0138] The result value at the line point can be calculated through the above formula at the terminal.
[0139] In this embodiment, through the shape function corresponding to the target grid cell to which each line point belongs, the unit result value corresponding to the target grid cell to which each line point belongs is interpolated, and the result value of each line point is calculated, realizing the accurate calculation of the result value of each line point, and providing a reliable data basis for the subsequent result analysis of the space curve.
[0140] In one embodiment, in the above step S104, a two-dimensional mapping process is performed on the arc length value and the result value to obtain the target mapping result of the space curve, which specifically includes the following contents: taking the arc length value from each line point to the initial point of the curve as the abscissa, and taking the result value of each line point as the ordinate, and plotting a two-dimensional scatter plot of the arc length value and the result value; connecting the adjacent scatter points in the two-dimensional scatter plot to obtain the connected two-dimensional scatter plot; and obtaining the target mapping result of the space curve according to the two-dimensional scatter plot and the connected two-dimensional scatter plot.
[0141] Specifically, taking the arc length value from each line point to the initial point of the curve as the abscissa and the result value of each line point as the ordinate, a two-dimensional scatter plot of the arc length value - result value is plotted, and this two-dimensional scatter plot is the distribution diagram of the multi-physical field calculation results along the specified space curve. That is, through the calculation method described above, let the arc length value of the i-th line point on the space curve L from the initial point of the curve be l i , and the result value at the i-th line point be F i , then the scatter value of the distribution diagram of the multi-physical field calculation results along the specified space curve is (l i , F i ), and the two-dimensional scatter plot drawn according to the arc length value and the result value is as shown in Figure 4 .
[0142] Furthermore, the adjacent scatter points in the two-dimensional scatter plot are connected by straight lines to obtain the connected two-dimensional scatter plot, Figure 5 which is a schematic diagram of the connected two-dimensional scatter plot. Connecting the adjacent scatter points by straight lines also means that the result value at the space point between the line points is obtained by linearly interpolating the result values at the adjacent line points, and its accuracy is often not as good as the result value obtained by using the shape function interpolation. Therefore, the more line points are arranged on the curve L, the more accurate the distribution diagram of the obtained result values along the curve is.
[0143] In this embodiment, by analyzing the distribution map corresponding to the target mapping result, the distribution of the result values of the line points along the space curve can be accurately and clearly analyzed, effectively improving the visualization efficiency and accuracy of the processing result of the space curve.
[0144] In one embodiment, in step S101 above, arranging a plurality of line points on the space curve specifically includes the following: determining the first line point and the last line point on the space curve; obtaining a plurality of line points on the space curve according to the first line point, the last line point, and the preset number of line points.
[0145] Specifically, assume that the parametric equation form of the space curve L picked up and saved in the file is as follows:
[0146]
[0147] In the case of evenly arranging N (i.e., the preset number of line points) line points on the space curve L, with t = a as the first line point and t = b as the last line point, the coordinate calculation method of the i-th line point is as follows:
[0148]
[0149] Where:
[0150]
[0151] Based on this, the terminal can calculate and obtain a plurality of line points on the space curve. In addition, it should be noted that the number of line points on the space curve will directly affect the accuracy of the processing result of the space curve. The more line points arranged on the space curve L, the more accurate the distribution map of the obtained result values along the space curve.
[0152] In this embodiment, by the first line point, the last line point, and the preset number of line points on the space curve, a plurality of line points on the space curve are calculated, laying a foundation for the subsequent steps of analyzing the processing result of the space curve based on the line points.
[0153] In one embodiment, as Figure 6 shown, another method for mapping the calculation result of the space curve of the multi-physics field numerical calculation software is provided. Taking this method applied to the terminal as an example for description, it includes the following steps:
[0154] Step S601, in response to a selection operation triggered by a space scene in the multi-physics field numerical calculation software, obtain the position coordinates corresponding to the selection operation.
[0155] Step S602: Convert the position coordinates into a ray in the world coordinate system. Through ray tracing processing, determine the intersection points of the ray and all curves in the spatial scene; from the intersection points, filter out the target intersection point closest to the ray.
[0156] Step S603: Take the curve where the target intersection point is located as the picked spatial curve.
[0157] Step S604: Arrange multiple line points on the spatial curve.
[0158] Step S605: Determine the initial point of the curve from the endpoints of the spatial curve, and obtain the arc length value from each line point to the initial point of the curve.
[0159] Step S606: Obtain the shape functions corresponding to the target grid cells where each line point belongs; through the shape functions, perform interpolation processing on the cell result values corresponding to the target grid cells where each line point belongs to obtain the result values of each line point.
[0160] Step S607: Take the arc length value from each line point to the initial point of the curve as the abscissa, and take the result value of each line point as the ordinate to plot a two-dimensional scatter plot of the arc length value and the result value.
[0161] Step S608: Connect the adjacent scatter points in the two-dimensional scatter plot to obtain the connected two-dimensional scatter plot.
[0162] Step S609: Obtain the target mapping result of the spatial curve according to the two-dimensional scatter plot and the connected two-dimensional scatter plot.
[0163] The above method for mapping the calculation results of spatial curves in a multi-physics field numerical calculation software can achieve the following beneficial effects: It realizes the mapping of the processing results of any picked spatial curve in the multi-physics field numerical calculation software, and effectively improves the visualization efficiency and accuracy of the processing results of spatial curves.
[0164] To more clearly illustrate the method for mapping the calculation results of spatial curves in the multi-physics field numerical calculation software provided by the embodiments of the present disclosure, the following specifically describes the above method for mapping the calculation results of spatial curves in the multi-physics field numerical calculation software with a specific embodiment. As Figure 7 shown, another method for mapping the calculation results of spatial curves in a multi-physics field numerical calculation software is provided, which can be applied to a terminal and specifically includes the following content:
[0165] I. Picking a spatial curve, including:
[0166] 1. Capture the mouse click event and obtain the screen coordinates of the click position.
[0167] 2. Convert the screen coordinates into a ray in the world coordinate system.
[0168] 3. Use ray tracing technology to calculate the intersection points of the rays with all the curves in the scene.
[0169] 4. Select the intersection point closest to the ray and obtain the curve where the intersection point is located, which is the curve to be picked up.
[0170] II. Curve point layout. According to the parametric equation of the curve, several line points can be arranged on the curve.
[0171] III. Arc length value calculation of line points. Designate one of the endpoints of the curve as the initial point and calculate the arc length value from each line point to the initial point of the curve.
[0172] IV. Read grid data. Furthermore, the terminal can parse and read the corresponding grid information in the multi-physics field numerical calculation software through the file format.
[0173] V. Determine in which grid cell each line point is located. The terminal can use methods such as the area method, the sum of interior angles method, the same-side method, and the centroid method to determine whether a line point is inside the grid cell.
[0174] VI. Read result data. After determining the target grid cell to which each line point belongs, the terminal can parse and read the result data file corresponding to the target grid cell through the file format specification corresponding to the target grid cell, and then extract the cell result value from the result data file.
[0175] VII. Result value calculation at line points. For each line point, obtain the shape function corresponding to its target grid cell, and combine the result values at all grid nodes in its target grid cell to obtain the result value at the line point through shape function interpolation.
[0176] VIII. Using the arc length value from each line point to the initial point of the curve as the abscissa and the result value of each line point as the ordinate, plot a two-dimensional scatter plot of arc length value - result value, which is the distribution diagram of the multi-physics field calculation results along the specified space curve.
[0177] In this embodiment, accurate, efficient, and grid-based result analysis of multi-physics field calculation results on any space curve in the result space is realized.
[0178] It should be understood that although the steps in the flowcharts involved in the above-described embodiments are sequentially shown according to the arrows, these steps are not necessarily executed sequentially in the order indicated by the arrows. Unless there is a clear indication in this article, there is no strict order limit for the execution of these steps, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-described embodiments may include multiple steps or multiple stages. These steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be executed alternately or in turn with at least a part of other steps or steps or stages in other steps.
[0179] Based on the same inventive concept, an embodiment of the present application further provides a spatial curve calculation result mapping device for a multi-physical field numerical calculation software for implementing the spatial curve calculation result mapping method described above. The solution provided by this device to solve the problem is similar to the solution described in the above method. Therefore, the specific limitations in one or more embodiments of the spatial curve calculation result mapping device for a multi-physical field numerical calculation software provided below can refer to the limitations on the spatial curve calculation result mapping method for a multi-physical field numerical calculation software in the above text, and will not be repeated here.
[0180] In one embodiment, as Figure 8 shown, a spatial curve calculation result mapping device 800 for a multi-physical field numerical calculation software is provided, including: a line point acquisition module 801, an arc length value acquisition module 802, a result value acquisition module 803, and a mapping processing module 804, where:
[0181] The line point acquisition module 801 is used to acquire a spatial curve picked up in the multi-physical field numerical calculation software and arrange a plurality of line points on the spatial curve.
[0182] The arc length value acquisition module 802 is used to determine a curve starting point from the endpoints of the spatial curve and acquire the arc length value of each line point to the curve starting point.
[0183] The result value acquisition module 803 is used to determine the result value of each line point according to the target grid cell to which each line point belongs in the grid cell in the multi-physical field numerical calculation software.
[0184] The mapping processing module 804 is used to perform two-dimensional mapping processing on the arc length value and the result value to obtain the target mapping result of the spatial curve.
[0185] In one embodiment, the line point acquisition module 801 is further configured to, in response to a selection operation triggered by a spatial scene in the multi-physics field numerical calculation software, acquire the position coordinates corresponding to the selection operation; convert the position coordinates into a ray in the world coordinate system, and determine the intersection points of the ray and all the curves in the spatial scene through ray tracing processing; screen out the target intersection point closest to the ray from the intersection points; and use the curve where the target intersection point is located as the picked spatial curve.
[0186] In one embodiment, the spatial curve calculation result mapping device 800 of the multi-physics field numerical calculation software further includes a cell judgment module, configured to acquire the grid information in the multi-physics field numerical calculation software; the grid information includes cell information; obtain the grid cells in the multi-physics field numerical calculation software according to the cell information; and determine the target grid cell to which each line point belongs in the grid cells.
[0187] In one embodiment, the result value acquisition module 803 is further configured to acquire the shape functions corresponding to the target grid cells to which each line point belongs; and perform interpolation processing on the cell result values corresponding to the target grid cells to which each line point belongs through the shape functions, so as to obtain the result value of each line point.
[0188] In one embodiment, the mapping processing module 804 is further configured to use the arc length value from each line point to the initial point of the curve as the abscissa, and use the result value of each line point as the ordinate to plot a two-dimensional scatter plot of the arc length value and the result value; and obtain the target mapping result of the spatial curve according to the two-dimensional scatter plot.
[0189] In one embodiment, the line point acquisition module 801 is further configured to determine the first line point and the last line point on the spatial curve; and obtain a plurality of line points on the spatial curve according to the first line point, the last line point, and a preset number of line points.
[0190] Each module in the above-mentioned spatial curve calculation result mapping device of the multi-physics field numerical calculation software can be implemented in whole or in part by software, hardware, and their combination. The above-mentioned modules can be embedded in the processor in the computer device in the form of hardware or be independent of the processor, or be stored in the memory in the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above-mentioned modules.
[0191] In one embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as Figure 9As shown in the figure. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit, and an input device. Among them, the processor, the memory, and the input / output interface are connected through a system bus, and the communication interface, the display unit, and the input device are connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and external devices. The communication interface of the computer device is used to communicate with external terminals in a wired or wireless manner, and the wireless manner can be implemented through WIFI, a mobile cellular network, NFC (Near Field Communication), or other technologies. When the computer program is executed by the processor, it implements a method for mapping the calculation results of space curves of a multi-physics field numerical calculation software. The display unit of the computer device is used to form a visually visible picture, which can be a display screen, a projection device, or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen. The input device of the computer device can be a touch layer covering the display screen, or a button, a trackball, or a touchpad provided on the shell of the computer device, or an external keyboard, touchpad, or mouse, etc.
[0192] Those skilled in the art can understand that Figure 9 the structure shown in the figure is only a block diagram of some structures related to the solution of this application, and does not constitute a limitation on the computer device to which the solution of this application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine some components, or have a different component layout.
[0193] In one embodiment, a computer device is further provided, including a memory and a processor. A computer program is stored in the memory, and when the processor executes the computer program, the steps in the above method embodiments are implemented.
[0194] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by the processor, the steps in the above method embodiments are implemented.
[0195] In one embodiment, a computer program product is provided, including a computer program. When the computer program is executed by the processor, the steps in the above method embodiments are implemented.
[0196] Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be completed by instructing relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above methods. Among them, any reference to a memory, database, or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memories. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc. The databases involved in the embodiments provided in the present application can include at least one of relational databases and non-relational databases. Non-relational databases can include distributed databases based on blockchain, etc., without limitation. The processors involved in the embodiments provided in the present application can be general-purpose processors, central processors, graphics processors, digital signal processors, programmable logic devices, data processing logics based on quantum computing, etc., without limitation.
[0197] The technical features of the above embodiments can be combined arbitrarily. For the sake of brevity of description, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, it should be considered as the scope described in this specification.
[0198] The above-described embodiments merely represent several implementation manners of the present application. The description thereof is relatively specific and detailed, but it should not be construed as a limitation on the patent scope of the present application. It should be noted that for those of ordinary skill in the art, without departing from the concept of the present application, several modifications and improvements can still be made, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the appended claims.
Claims
1. A method for mapping spatial curve calculation results of multi-physics field numerical calculation software, characterized in that: The method comprises: In response to a selection operation triggered by a spatial scene in the multi-physics field numerical calculation software, obtaining position coordinates corresponding to the selection operation; Convert the position coordinates into rays in a world coordinate system, and determine the intersection points of the rays with all curves in the space scene through ray tracing; From the intersection points, select the target intersection point closest to the ray; The curve where the target intersection point is located is used as the picked space curve; Arranging a plurality of line points on the space curve; Determine the initial point of the curve from the endpoints of the space curve, and obtain the arc length value from each line point to the initial point of the curve; Obtaining grid information in the multi-physics field numerical calculation software; the grid information includes unit information; According to the unit information, a grid unit in the multi-physics field numerical calculation software is obtained; In the grid unit, determining the target grid unit to which each of the line points belongs; Obtaining a shape function corresponding to a target grid unit to which each of the line points belongs; By using the shape function, interpolation processing is performed on the unit result value corresponding to the target grid unit to which each of the line points belongs, so as to obtain the result value of each of the line points; A two-dimensional mapping process is performed on the arc length value and the result value to obtain a target mapping result of the space curve.
2. The method according to claim 1, characterized in that The performing two-dimensional mapping processing on the arc length value and the result value to obtain the target mapping result of the space curve includes: Using the arc length value from each line point to the initial point of the curve as the abscissa, and using the result value of each line point as the ordinate, a two-dimensional scatter plot of the arc length value and the result value is drawn; According to the two-dimensional scatter plot, a target mapping result of the space curve is obtained.
3. The method according to claim 1, characterized in that The step of arranging a plurality of line points on the space curve comprises: Determine the first line point and the last line point on the space curve; A plurality of line points on the space curve are obtained according to the first line point, the last line point and a preset number of line points.
4. A spatial curve calculation result mapping device for multi-physics field numerical calculation software, characterized in that: The device comprises: A line point acquisition module is used to respond to a selection operation triggered by a spatial scene in the multi-physics field numerical calculation software, obtain the position coordinates corresponding to the selection operation; convert the position coordinates into rays in a world coordinate system, and determine the intersections of the rays with all curves in the spatial scene through ray tracing processing; select the nearest target intersection of the rays from the intersections; use the curve where the target intersection is located as the picked spatial curve; and arrange multiple line points on the spatial curve; An arc length value acquisition module, used to determine the initial point of the curve from the endpoints of the space curve, and obtain the arc length value from each line point to the initial point of the curve; A unit judgment module is used to obtain grid information in the multi-physics field numerical calculation software; the grid information includes unit information; according to the unit information, a grid unit in the multi-physics field numerical calculation software is obtained; in the grid unit, a target grid unit to which each line point belongs is determined; A result value acquisition module is used to acquire a shape function corresponding to the target grid unit to which each of the line points belongs; interpolate the unit result value corresponding to the target grid unit to which each of the line points belongs through the shape function to obtain the result value of each of the line points; A mapping processing module is used to perform two-dimensional mapping processing on the arc length value and the result value to obtain a target mapping result of the space curve.
5. The device according to claim 4, characterized in that The mapping processing module is also used to use the arc length value from each line point to the initial point of the curve as the horizontal coordinate, and the result value of each line point as the vertical coordinate, to draw a two-dimensional scatter plot of the arc length value and the result value; based on the two-dimensional scatter plot, the target mapping result of the spatial curve is obtained.
6. The device according to claim 4, characterized in that The line point acquisition module is further used to determine the first line point and the last line point on the space curve; and obtain multiple line points on the space curve according to the first line point, the last line point and a preset number of line points.
7. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 3 are implemented.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 3 are implemented.
9. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 3 are implemented.
Citation Information
Patent Citations
Irregular mesh mapping method used in electromagnetic field-flow field-temperature field coupling calculation
CN103617367A
Grid mapping method and device for multi-physics field coupling of reactor core
CN119378422A