Disclosure of Invention
Therefore, the embodiment of the application provides a hexahedron volume calculation method and system based on a digital twin body, and the problem that the number of times of calculation for calculating the hexahedron volume floating point number is large is solved. The volume of the quadrangular hexahedron is decomposed into the sum of six sub-volumes, then the calculation formula is further simplified, the floating point number operation frequency of the hexahedron volume is reduced to 72 steps, the calculation steps can be greatly reduced, the calculation time is shortened, the calculation efficiency is improved, and the method can be applied to digital twin solving calculation.
In order to achieve the above object, the embodiments of the present application provide the following technical solutions:
according to a first aspect of embodiments of the present application, there is provided a digital twin-based hexahedral volume calculation method, the method including:
numbering eight vertexes of the target hexahedron according to a set numbering rule;
determining coordinates of eight vertexes of the target hexahedron;
calculating the diagonal vector coordinate of each surface of the target hexahedron according to the coordinate of the vertex;
forming diagonal vectors into a matrix, and calculating a matrix determinant;
and adding the matrix determinant results of each surface to obtain the volume of the target hexahedron.
Optionally, the diagonal vector coordinates of each face of the target hexahedron are calculated according to the coordinates of the vertex, and the diagonal vector coordinates of each face are respectively:
wherein,
respectively, the coordinates of the eight vertices of the target hexahedron.
Optionally, the result of the matrix determinant of each face is added to obtain the volume of the target hexahedron, according to the following formula:
VTH=V1375+V4576+V2376+V0231+V0451+V0462
wherein, V1375、V4576、V2376、V0231、V0451、V0462Respectively, the volumes of the six faces of the target hexahedron.
Optionally, the V1375Calculated according to the following formula:
the V is4576Calculated according to the following formula:
the V is2376Calculated according to the following formula:
optionally, the V0231Calculated according to the following formula:
the V is0451Calculated according to the following formula:
the V is0231Calculated according to the following formula:
optionally, the method further comprises: will vector V1Defined as the Jacobian of the conversion of the xc point from logical space to physical space, then vector V1Expressed according to the following formula:
further simplifying as follows:
further transformation is as follows:
unfolding and binding V by the property of determinantTHThe formula yields:
optionally, the method further comprises: according to 16V after simplification1Equation and 12VTHThe formula obtains the volume formula of the target hexahedron:
according to a second aspect of embodiments of the present application, there is provided a digital twin-based hexahedral volume calculation system, the system including:
the numbering module is used for numbering eight vertexes of the target hexahedron according to a set numbering rule;
the coordinate module is used for determining coordinates of eight vertexes of the target hexahedron;
the diagonal coordinate module is used for calculating the diagonal vector coordinate of each surface of the target hexahedron according to the coordinate of the vertex;
the matrix determinant module is used for forming the diagonal vectors into a matrix and calculating a matrix determinant;
and the hexahedron volume module is used for adding the matrix determinant results of each surface to obtain the volume of the target hexahedron.
Optionally, the diagonal vector coordinates of each face in the diagonal coordinate module are respectively:
wherein,
respectively, the coordinates of the eight vertices of the target hexahedron.
Optionally, the hexahedral volume module is specifically calculated according to the following formula:
VTH=V1375+V4576+V2376+V0231+V0451+V0462
wherein, V1375、V4576、V2376、V0231、V0451、V0462Respectively, the volumes of the six faces of the target hexahedron.
Optionally, the V1375Calculated according to the following formula:
the V is4576According to the following formulaAnd (3) calculating:
the V is2376Calculated according to the following formula:
optionally, the V0231Calculated according to the following formula:
the V is0451Calculated according to the following formula:
the V is0231Calculated according to the following formula:
optionally, the hexahedral volume module is further configured to:
will vector V1Defined as the Jacobian of the conversion of the xc point from logical space to physical space, then vector V1Expressed according to the following formula:
further simplifying as follows:
further transformation is as follows:
unfolding and binding V by the property of determinantTHThe formula yields:
optionally, the hexahedral volume module is further configured to:
according to 16V after simplification1Equation and 12VTHThe formula obtains the volume formula of the target hexahedron:
according to a third aspect of embodiments herein, there is provided an apparatus comprising: the device comprises a data acquisition device, a processor and a memory; the data acquisition device is used for acquiring data; the memory is to store one or more program instructions; the processor is configured to execute one or more program instructions to perform the method of any of the first aspect.
According to a fourth aspect of embodiments herein, there is provided a computer-readable storage medium having one or more program instructions embodied therein for performing the method of any of the first aspects.
In summary, the embodiment of the present application provides a hexahedron volume calculation method and system based on a digital twin body, and eight vertexes of a target hexahedron are numbered by setting a numbering rule; determining coordinates of eight vertexes of the target hexahedron; further calculating the diagonal vector coordinate of each surface of the target hexahedron according to the coordinate of the vertex; forming diagonal vectors into a matrix, and calculating a matrix determinant; and finally, adding the matrix determinant results of each surface to obtain the volume of the target hexahedron. Aiming at the problems that the existing calculation of the floating point number of the hexahedron volume is complicated, a large amount of calculation resources are consumed, and the like, starting from the construction of the four-corner hexahedron, the volume of the four-corner hexahedron is decomposed into the sum of six sub-volumes, and the number of floating point number calculation times for calculating the hexahedron volume is reduced.
Detailed Description
The present invention is described in terms of particular embodiments, other advantages and features of the invention will become apparent to those skilled in the art from the following disclosure, and it is to be understood that the described embodiments are merely exemplary of the invention and that it is not intended to limit the invention to the particular embodiments disclosed. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Fig. 1 shows a flow chart of a digital twin-based hexahedron volume calculation method provided by an embodiment of the application, and the method includes the following steps:
step 101: numbering eight vertexes of the target hexahedron according to a set numbering rule;
step 102: determining coordinates of eight vertexes of the target hexahedron;
step 103: calculating the diagonal vector coordinate of each surface of the target hexahedron according to the coordinate of the vertex;
step 104: forming diagonal vectors into a matrix, and calculating a matrix determinant;
step 105: and adding the matrix determinant results of each surface to obtain the volume of the target hexahedron.
As shown in fig. 2, the hexahedral volumetric region is specified by the positions of eight nodes. Since nodes are allowed to move independently of each other in physical simulation, four edges around one face of a logical cube are not generally coplanar, and thus a plane boundary of a hexahedral cell is constructed by dividing the hexahedral face into triangles. Each face is divided into four triangles and the hexahedron is defined by a 24-sided triangular polyhedron called a 24-sided hexahedron. As shown in fig. 3. The center of gravity divides each surface into four triangles, and such a hexahedron is called a quadrangular hexahedron (TH).
In a possible implementation manner, in step 103, the diagonal vector coordinates of each face of the target hexahedron are calculated according to the coordinates of the vertex, and the diagonal vector coordinates of each face are respectively shown in formula group (1):
wherein,
respectively, the coordinates of the eight vertices of the target hexahedron.
In a possible embodiment, in step 105, the result of the matrix determinant for each face is added to obtain the volume of the target hexahedron, according to the following formula (2):
VTH=V1375+V4576+V2376+V0231+V0451+V0462formula (2)
Wherein, V1375、V4576、V2376、V0231、V0451、V0462Respectively, the volumes of the six faces of the target hexahedron.
In one possible embodiment, said V1375Calculated according to the following equation (3):
the V is4576Calculated according to the following equation (4):
the V is2376Calculated according to the following equation (5):
in one possible embodiment, said V0231Calculated according to the following equation (6):
the V is0451Calculated according to the following equation (7):
the V is0231Calculated according to the following equation (8):
in one possible embodiment, the method further comprises: will vector V1Defined as xc points from logical space to physical spaceConverted jacobian, vector V1Expressed by the following formula (9):
further simplified to formula (10):
further transformed into formula (11):
unfolding and binding V by the property of determinantTHThe formula yields formula (12):
in one possible embodiment, the method further comprises: according to 16V after simplification1Equation and 12VTHThe formula obtains the volume formula of the target hexahedron, such as formula (13):
the embodiment of the application aims at the problem that the number of times of calculation of the hexahedron volume floating point number is large, starting from the construction of a four-cornered hexahedron, the volume of the four-cornered hexahedron is decomposed into the sum of six sub-volumes, then the calculation formula is further simplified, and the number of times of calculation of the hexahedron volume floating point number is reduced. The number of floating point number operations of the hexahedron volume is reduced to 72 steps, and the calculation efficiency is improved. And can be applied to digital twin solving calculations.
The methods provided in the examples of the present application are further illustrated below with reference to specific illustrations:
as shown in fig. 4, the sum of the volumes of two tetrahedrons can be considered for a rectangular pyramid. The tetrahedral volume calculation formula (14) is:
as shown in fig. 5, the volume of a polyhedron formed by vertices 0,1,3,5,7 is:
for convenience will
It is briefly described as
Substituting formula set (1) into (16) to simplify:
the same can be obtained:
for a plane S including node 00231The volume can be simplified as:
the same principle is that:
the volume of the whole tetragonal hexahedron is as follows:
VTH=V1375+V4576+V2376+V0231+V0451+V0462formula (23)
Will vector V1Defined as the jacobian of the transition of the xc point from logical space to physical space.
The simplification is as follows:
the transform of equation (25) is written as:
and (3) expanding the matrix by using the property of the determinant and comparing the matrix with the matrix to obtain:
substituting (25) into (27) to obtain
In recent years, with the dramatic increase and progress of the internet of things and sensing technology, a novel monitoring technology enters the visual field of people, namely a digital twin technology. The first formal definition of digital twins came from the research of NASA in the united states in 2010 and pointed out that this is one of the biggest challenges in the next 10-20 years, and the digital twins technology is a comprehensive multi-physics, multi-scale, probabilistic, super-reality simulation that uses the most appropriate physical models, sensory data, and historical data to mirror real-world machine devices and reflect their real-time operating states. Fig. 6 shows a specific application of the hexahedral cell volume efficient calculation method provided by the embodiment of the present application in the digital twins.
As shown in fig. 6, the smooth finite element method is involved in solving the mathematical model of the twin. In the calculation step of the smoothing finite element method, VIJ(VIJTo contain the volume of the I, J point units) involves volume calculations of hexahedrons. The need to calculate the hexahedral volume consumes computational resources. The traditional hexahedron volume calculation method needs a large number of floating point number operations.
The efficient hexahedron volume calculation method adopted by the invention can reduce the calculation times of floating point numbers and is beneficial to efficiently solving the digital twin problem.
The following is a simple hexahedral volume calculation example. As shown in FIG. 7, the coordinates of each point are
x0(0,0,0)x1(2,0,0)x2(0,2,0)x3(2,2,0)
x4(0,0,2)x5(2,0,2)x6(0,2,2)x7(2,2,2)
According to formula (29) and formula (30):
equal to the hexahedral actual volume.
The floating point number count number comparison is according to equation (31) and equation (32) as follows:
the traditional method comprises the following steps:
the invention comprises the following steps:
FIG. 8 shows a comparison of the number of floating-point operations required by the method of the present invention versus the conventional method. The floating-point number operation times required by the traditional method is 264, and the floating-point number operation times required by the method is only 72 times, which is reduced by 72.7 percent compared with the traditional method. The computing resources of the computer are greatly saved, and the efficient solving of the digital twin model is facilitated.
The embodiment of the application aims at the problem that the number of times of calculation of the hexahedron volume floating point number is large, starting from the construction of a four-cornered hexahedron, the volume of the four-cornered hexahedron is decomposed into the sum of six sub-volumes, then the calculation formula is further simplified, and the number of times of calculation of the hexahedron volume floating point number is reduced. The number of floating point number operations of the hexahedron volume is reduced to 72 steps, and the calculation efficiency is improved. Can be applied to digital twin solving calculations.
In summary, the embodiment of the present application provides a hexahedron volume calculation method based on a digital twin body, in which eight vertexes of a target hexahedron are numbered by setting a numbering rule; determining coordinates of eight vertexes of the target hexahedron; further calculating the diagonal vector coordinate of each surface of the target hexahedron according to the coordinate of the vertex; forming diagonal vectors into a matrix, and calculating a matrix determinant; and finally, adding the matrix determinant results of each surface to obtain the volume of the target hexahedron. Aiming at the problems that the existing calculation of the floating point number of the hexahedron volume is complicated, a large amount of calculation resources are consumed, and the like, starting from the construction of the four-corner hexahedron, the volume of the four-corner hexahedron is decomposed into the sum of six sub-volumes, and the number of floating point number calculation times for calculating the hexahedron volume is reduced.
Based on the same technical concept, the embodiment of the present application further provides a digital twin-based hexahedron volume calculation system, as shown in fig. 9, the system includes:
a numbering module 901, configured to number eight vertexes of the target hexahedron according to a set numbering rule;
a coordinate module 902, configured to determine coordinates of eight vertices of the target hexahedron;
a diagonal coordinate module 903, configured to calculate a diagonal vector coordinate of each face of the target hexahedron according to the coordinates of the vertex;
a matrix determinant module 904, configured to form diagonal vectors into a matrix, and calculate a matrix determinant;
and a hexahedron volume module 905, configured to add the results of the matrix determinant for each surface to obtain a volume of the target hexahedron.
In one possible embodiment, the diagonal vector coordinates of each surface in the diagonal coordinate module 903 are respectively shown in formula group (1).
In one possible embodiment, the hexahedral volume module 905 is calculated according to equation (2).
In one possible embodiment, the hexahedral volume module 905 is further configured to: will vector V1Defined as the Jacobian of the conversion of the xc point from logical space to physical space, then vector V1Expressed according to formula (9).
In one possible embodiment, the hexahedral volume module 905 is further configured to: according to 16V after simplification1Equation and 12VTHThe formula obtains the volume formula (13) of the target hexahedron.
Based on the same technical concept, an embodiment of the present application further provides an apparatus, including: the device comprises a data acquisition device, a processor and a memory; the data acquisition device is used for acquiring data; the memory is to store one or more program instructions; the processor is configured to execute one or more program instructions to perform the method.
Based on the same technical concept, the embodiment of the present application also provides a computer-readable storage medium, wherein the computer-readable storage medium contains one or more program instructions, and the one or more program instructions are used for executing the method.
In the present specification, each embodiment of the method is described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments. Reference is made to the description of the method embodiments.
It is noted that while the operations of the methods of the present invention are depicted in the drawings in a particular order, this is not a requirement or suggestion that the operations must be performed in this particular order or that all of the illustrated operations must be performed to achieve desirable results. Additionally or alternatively, certain steps may be omitted, multiple steps combined into one step execution, and/or one step broken down into multiple step executions.
Although the present application provides method steps as in embodiments or flowcharts, additional or fewer steps may be included based on conventional or non-inventive approaches. The order of steps recited in the embodiments is merely one manner of performing the steps in a multitude of orders and does not represent the only order of execution. When an apparatus or client product in practice executes, it may execute sequentially or in parallel (e.g., in a parallel processor or multithreaded processing environment, or even in a distributed data processing environment) according to the embodiments or methods shown in the figures. The terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, the presence of additional identical or equivalent elements in a process, method, article, or apparatus that comprises the recited elements is not excluded.
The units, devices, modules, etc. set forth in the above embodiments may be implemented by a computer chip or an entity, or by a product with certain functions. For convenience of description, the above devices are described as being divided into various modules by functions, and are described separately. Of course, in implementing the present application, the functions of each module may be implemented in one or more software and/or hardware, or a module implementing the same function may be implemented by a combination of a plurality of sub-modules or sub-units, and the like. The above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units is only one logical division, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
Those skilled in the art will also appreciate that, in addition to implementing the controller as pure computer readable program code, the same functionality can be implemented by logically programming method steps such that the controller is in the form of logic gates, switches, application specific integrated circuits, programmable logic controllers, embedded microcontrollers and the like. Such a controller may therefore be considered as a hardware component, and the means included therein for performing the various functions may also be considered as a structure within the hardware component. Or even means for performing the functions may be regarded as being both a software module for performing the method and a structure within a hardware component.
The application may be described in the general context of computer-executable instructions, such as program modules, being executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, classes, etc. that perform particular tasks or implement particular abstract data types. The application may also be practiced in distributed computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed computing environment, program modules may be located in both local and remote computer storage media including memory storage devices.
From the above description of the embodiments, it is clear to those skilled in the art that the present application can be implemented by software plus necessary general hardware platform. Based on such understanding, the technical solutions of the present application may be embodied in the form of a software product, which may be stored in a storage medium, such as a ROM/RAM, a magnetic disk, an optical disk, or the like, and includes several instructions for enabling a computer device (which may be a personal computer, a mobile terminal, a server, or a network device) to execute the method according to the embodiments or some parts of the embodiments of the present application.
The embodiments in the present specification are described in a progressive manner, and the same or similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments. The application is operational with numerous general purpose or special purpose computing system environments or configurations. For example: personal computers, server computers, hand-held or portable devices, tablet-type devices, multiprocessor systems, microprocessor-based systems, set top boxes, programmable electronic devices, network PCs, minicomputers, mainframe computers, distributed computing environments that include any of the above systems or devices, and the like.
The above-mentioned embodiments are further described in detail for the purpose of illustrating the invention, and it should be understood that the above-mentioned embodiments are only illustrative of the present invention and are not intended to limit the scope of the present invention, and any modifications, equivalent substitutions, improvements, etc. made within the spirit and principle of the present invention should be included in the scope of the present invention.