Calculation method of Gaussian integral and Hammer integral
A unified interface and base class structure for Gaussian and Hammer integrals transforms integral intervals to standard or arbitrary shapes, addressing the limitations of existing methods and enhancing computational efficiency in finite element analysis.
Patent Information
- Application Number
- CN202410970934.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-19
- Publication Date
- 2024-12-06
AI Technical Summary
Existing Gaussian and Hammer integral methods have different calculation thresholds and lack a unified interface, making them difficult to apply to irregular areas and requiring specific integral intervals, which limits their versatility and efficiency.
A unified interface and basic parameters are constructed for Gaussian and Hammer integrals, allowing for the transformation of integral intervals to standard or arbitrary shapes, and using a two-level base class structure to unify the integration algorithm, enabling flexible application to various integral ranges.
This approach simplifies the calculation process by unifying Gaussian and Hammer integrals, reducing the difficulty and threshold for integral calculations, especially in finite element simulation, and ensuring computational efficiency across different mesh orders.
Smart Images

Figure CN119089076A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the technical field of integral algorithms, and in particular to a calculation method of Gaussian integral and Hammer integral. Background Art
[0002] Gaussian integral can be used to efficiently calculate one-dimensional integrals, rectangular intervals, and cuboid interval integrals, while Hammer integral can be used to calculate isosceles right triangle intervals and regular tetrahedron interval integrals. The basic principle of the two numerical integrals is to transform a complex integral problem into a simple summation problem.
[0003] Therefore, when solving integrals, the two methods have a high threshold for use due to differences in calculation methods. In addition, since the two algorithms are different, there is a lack of a unified interface when they are applied. Summary of the invention
[0004] Based on this, it is necessary to provide a calculation method for Gaussian integral and Hammer integral to address the above technical problems.
[0005] In a first aspect, the present application provides a method for calculating Gaussian integral and Hammer integral, the method comprising:
[0006] Constructing basic parameters required for a unified interface and an integral algorithm, wherein the basic parameters include basic parameters required for a Gaussian integral class and a Hammer integral class;
[0007] Using the unified interface and basic parameters required by the integration algorithm, an initial interval range integral is obtained, wherein the interval range integral represents a standard interval range integral or an arbitrary interval range integral;
[0008] If the interval range integral is a standard interval range integral:
[0009] According to the upper and lower limits of the integral of the standard interval range, a plurality of standard integral points are obtained;
[0010] Transforming the integral interval for the upper and lower limits of the integral within the standard interval range, and selecting one of the transformed standard integral points as the first standard integral point;
[0011] If the interval range integral is an arbitrary interval range integral:
[0012] According to the integration of the arbitrary interval range, a plurality of non-standard integration points are obtained;
[0013] Converting the plurality of non-standard integral points to obtain a shape characteristic area;
[0014] Performing the integral interval transformation on the shape feature area, and selecting one of the non-standard integral points after the transformation as the first non-standard integral point;
[0015] For the first standard integration point or the first non-standard integration point, an integration object is called to obtain a first integration result, wherein the integration object represents the Gaussian integration class or the Hammer integration class;
[0016] According to the first standard integration point or the first non-standard integration point, correspondingly searching for an adjacent second standard integration point or a second non-standard integration point, and for the second integration point, calling the integration object to obtain a second integration result;
[0017] The first integration result and the second integration result are output.
[0018] In some practicable ways, the step of constructing the basic parameters required for the unified interface and the integration algorithm includes:
[0019] According to the MFC base class framework, a unified interface is constructed, wherein the unified interface represents a base class and a basic interface having a unified class.
[0020] In some practicable manners, the step of obtaining a plurality of standard integral points according to the upper and lower limits of the integral of the standard interval range includes:
[0021] According to the standard interval range integral, the upper and lower limits of the standard interval range integral are obtained;
[0022] A plurality of standard integral points are obtained according to the upper and lower limits of the integral of the standard interval range.
[0023] In some practicable manners, the step of transforming the integral interval of the upper and lower limits of the integral of the standard interval range, and selecting one of the transformed standard integral points as the first standard integral point, includes:
[0024] The upper and lower limits of the standard interval range integral are translated and / or scaled to adjust the upper and lower limits of the standard interval range integral to obtain an interval integral that satisfies the Gaussian integral and the Hammer integral calculation;
[0025] Under the interval integration calculated by the Gaussian integral and the Hammer integral, an integral point corresponding to the standard integral point is selected from a plurality of the standard integral points to obtain the first standard integral point.
[0026] In some practicable manners, the step of obtaining a plurality of non-standard integral points according to the integration within the arbitrary interval range includes:
[0027] According to the arbitrary interval range integral, obtain the upper and lower limits of the arbitrary interval range integral;
[0028] According to the upper and lower limits of the integral of the arbitrary interval range, a plurality of non-standard integral points are obtained.
[0029] In some practicable manners, the step of converting the plurality of non-standard integral points to obtain the shape characteristic area includes:
[0030] Using the shape function, a plurality of the non-standard integral points are subjected to derivative calculation to obtain shape function derivatives, wherein the shape function represents a shape function corresponding to the standard integral;
[0031] The Jacobian matrix is used to calculate the shape function derivative to obtain the shape feature area.
[0032] In some practicable manners, the step of calling the integration object for the first standard integration point or the first non-standard integration point to obtain the first integration result includes:
[0033] According to the interval range integral corresponding to the first standard integral point or the first non-standard integral point, the Gaussian integral class or the Hammer integral class is called to perform matching calculation to obtain the first integral result.
[0034] In a second aspect, the present application provides a system for calculating Gaussian integrals and Hammer integrals, which is applied to the aforementioned method for calculating Gaussian integrals and Hammer integrals, and the system comprises:
[0035] HObjectBase unified base class, used to build a unified interface;
[0036] HIntegrationBase is an integration algorithm base class, which is connected to the HObjectBase unified base class and is used to construct the basic parameters required for the integration algorithm, wherein the basic parameters include the basic parameters required for the Gaussian integration class and the Hammer integration class;
[0037] HIntegrationGaussian integration class, connected to HIntegrationBase integration algorithm base class, is used to calculate data that conforms to the Gaussian integration class;
[0038] HIntegrationHammer integration class, connected to HIntegrationBase integration algorithm base class, is used to calculate data that conforms to the Hammer integration class;
[0039] The system is configured to:
[0040] Constructing basic parameters required for a unified interface and an integral algorithm, wherein the basic parameters include basic parameters required for a Gaussian integral class and a Hammer integral class;
[0041] Using the unified interface and basic parameters required by the integration algorithm, an initial interval range integral is obtained, wherein the interval range integral represents a standard interval range integral or an arbitrary interval range integral;
[0042] If the interval range integral is a standard interval range integral:
[0043] According to the upper and lower limits of the integral of the standard interval range, a plurality of standard integral points are obtained;
[0044] Transforming the integral interval for the upper and lower limits of the integral within the standard interval range, and selecting one of the transformed standard integral points as the first standard integral point;
[0045] If the interval range integral is an arbitrary interval range integral:
[0046] According to the integration of the arbitrary interval range, a plurality of non-standard integration points are obtained;
[0047] Converting the plurality of non-standard integral points to obtain a shape characteristic area;
[0048] Performing the integral interval transformation on the shape feature area, and selecting one of the non-standard integral points after the transformation as the first non-standard integral point;
[0049] For the first standard integration point or the first non-standard integration point, an integration object is called to obtain a first integration result, wherein the integration object represents the Gaussian integration class or the Hammer integration class;
[0050] According to the first standard integration point or the first non-standard integration point, correspondingly searching for an adjacent second standard integration point or a second non-standard integration point, and for the second integration point, calling the integration object to obtain a second integration result;
[0051] The first integration result and the second integration result are output.
[0052] In a third aspect, the present application provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the aforementioned method for calculating the Gaussian integral and the Hammer integral when executing the computer program.
[0053] In a fourth aspect, the present application provides a computer program having a computer program stored thereon, which, when executed by a processor, implements the steps of the aforementioned method for calculating the Gaussian integral and the Hammer integral.
[0054] Beneficial effects:
[0055] The present application discloses a method for calculating Gaussian integral and Hammer integral. First, a unified interface and basic parameters required by the integral algorithm are constructed, wherein the basic parameters include basic parameters required by the Gaussian integral class and the Hammer integral class; next, an initial interval range integral is obtained by using the unified interface and the basic parameters required by the integral algorithm, wherein the interval range integral represents a standard interval range integral or an arbitrary interval range integral; then, if the interval range integral is a standard interval range integral: according to the upper and lower limits of the standard interval range integral, a plurality of standard integral points are obtained; the upper and lower limits of the standard interval range integral are transformed into an integral interval, and one of the transformed standard integral points is selected as the first standard integral point. If the interval range integral is an arbitrary interval range integral: according to the arbitrary interval range integral, multiple non-standard integral points are obtained; the multiple non-standard integral points are converted to obtain a shape feature area; the shape feature area is transformed by the integral interval transformation, and one of the non-standard integral points after the transformation is selected as the first non-standard integral point; next, the first standard integral point or the first non-standard integral point is called by the integral object to obtain the first integral result, wherein the integral object represents the Gaussian integral class or the Hammer integral class; according to the first standard integral point or the first non-standard integral point, the adjacent second standard integral point or the second non-standard integral point is correspondingly searched, and the second integral point is called by the integral object to obtain the second integral result; finally, the first integral result and the second integral result are output. Using the above method, not only the interface is unified, but also different Gaussian integrals and Hammer integrals can be applied when facing irregular areas, reducing the difficulty and threshold of integral calculation. BRIEF DESCRIPTION OF THE DRAWINGS
[0056] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the conventional technology, the drawings required for use in the embodiments or the conventional technology descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0057] Figure 1A schematic flow chart of a method for calculating Gaussian integral and Hammer integral in one embodiment;
[0058] Figure 2 A standard integral point calculation flow chart of a method for calculating Gaussian integral and Hammer integral in one embodiment;
[0059] Figure 3 A non-standard integral point calculation flow chart of a method for calculating Gaussian integral and Hammer integral in one embodiment;
[0060] Figure 4 A three-node triangle standard integral diagram of a method for calculating Gaussian integral and Hammer integral in one embodiment;
[0061] Figure 5 A four-node quadrilateral standard integral diagram of a method for calculating Gaussian integral and Hammer integral in one embodiment;
[0062] Figure 6 The figure is a schematic diagram of the structure of a calculation system for Gaussian integral and Hammer integral in one embodiment. DETAILED DESCRIPTION
[0063] In order to facilitate understanding of the present application, the present application will be described more fully below with reference to the relevant drawings. Embodiments of the present application are provided in the drawings. However, the present application can be implemented in many different forms and is not limited to the embodiments described herein. On the contrary, the purpose of providing these embodiments is to make the disclosure of the present application more thorough and comprehensive.
[0064] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein in the specification of this application are only for the purpose of describing specific embodiments and are not intended to limit this application. The term "and / or" used herein includes any and all couplings of one or more related listed items.
[0065] It can be understood that the terms "first", "second", etc. used in the present application can be used in this article to describe various elements, but these elements are not limited by these terms. These terms are only used to distinguish the first element from another element.
[0066] Some terms involved in this application are explained below to facilitate understanding of this application:
[0067] Gaussian integral, Gaussian integral is a specific form of integral;
[0068] Hammer integration is a numerical integration method used to calculate integrals with exponential form.
[0069] MFC, the abbreviation of Microsoft Foundation Class, is a class library used for developing graphical user interface (GUI) programs on the Windows operating system.
[0070] Base class is a concept in object-oriented programming, which refers to a class with common properties and functions. Other classes can obtain these functions by inheriting the base class. The base class usually defines some shared properties and methods, and the derived class can inherit these properties and methods and can extend or rewrite them on this basis.
[0071] Shape function is a function used to describe the internal or local variation of each element in a finite element mesh. In finite element analysis, a complex area is usually divided into a series of small units (or finite elements), and the field quantities (such as displacement, stress, temperature, etc.) in each small unit are usually assumed to be in a certain form of variation, which is represented by the shape function.
[0072] Jacobian matrix is a commonly used concept in fields such as mathematics and physics. It describes the relationship between partial derivatives of multivariate functions.
[0073] Element stiffness matrix is an important concept to describe the mechanical properties of an element. It is a matrix used to describe the local stiffness relationship within the element and the stiffness relationship between the degrees of freedom within the element.
[0074] In the process of finite element digital simulation calculation, a discrete grid model is usually constructed. The grid model is usually composed of triangles, quadrilaterals, tetrahedrons or hexahedrons. For two-dimensional cases, quadrilateral units and triangular units are generally used for calculation, where quadrilateral units use Gaussian integrals and triangular units use Hammer integrals. For three-dimensional cases, hexahedral units and tetrahedral units are generally used for calculation, where hexahedral units use Gaussian integrals and tetrahedral units use Hammer integrals. In the process of finite element calculation, it is often necessary to compile corresponding calculation programs for the two types of integrals, and the calculation programs are different for different dimensions and orders.
[0075] Specifically, in the process of structural integrity analysis of solid mechanics materials, it is necessary to calculate the unit stiffness matrix, and the calculation formula of this matrix is:
[0076]
[0077] Among them, K e is the element stiffness matrix, B is the geometry matrix, D is the elasticity matrix, and V is the element volume integral variable.
[0078] The integral can be solved by numerical integration. For quadrilateral elements, since Gaussian integral has strict requirements on the upper and lower limits, the upper and lower limits of the integral need to be transformed before calculation. The general transformation method is to use the Jacobian matrix to achieve
[0079]
[0080] Where J is the Jacobian matrix, t is the unit area (unit volume in the case of a three-dimensional hexahedron), and ξ and η are the coordinates of the unit in the local coordinate system.
[0081] The integral after deformation can be numerically solved by Gaussian integration to obtain the unit stiffness matrix K e After all unit stiffness matrices are assembled into the overall stiffness matrix K according to the numbering order of the unit nodes, subsequent calculations can be performed to obtain the node displacement, stress, and strain of the structure.
[0082] For example, in the finite element simulation calculation process of solid engine characteristic analysis, it is necessary to establish a geometric model, a mesh model, a model solution and data post-processing. Among them, although the geometric model can reflect the internal and external geometric structure of the engine, it is impossible to perform finite element calculations. The geometric model must be meshed. The current meshing method is mainly to simplify the geometric model into a mesh composed of simple shapes, among which the two-dimensional geometric model is usually converted into a triangle or quadrilateral, and the three-dimensional geometric model is usually converted into a tetrahedron or hexahedron. In order to balance the calculation efficiency and calculation accuracy, these meshes can use first-order, second-order or third-order units. The higher the order, the more nodes in the mesh, the greater the calculation amount, but the accuracy is usually higher. In the process of model solution and data post-processing, it is necessary to perform a series of integral calculations on these meshes composed of simple shapes. Gaussian integrals are used to process quadrilateral and hexahedral meshes, and Hammer integrals are used to process triangle and tetrahedral meshes. It is impossible to unify the Gaussian integral and Hammer integral solutions to meshes of different orders. In the case of inconsistent algorithm interfaces and calling methods, the calculation efficiency cannot be guaranteed.
[0083] It should be noted that the basic principle of the two numerical integration methods, Gaussian integration and Hammer integration, is to transform a complex integration problem into a simple summation problem. Specifically, the integration interval is divided into several small intervals, and then a simple formula is used to approximate the integral value in each small interval. Finally, the integral value of all small intervals is added to get the integral value of the entire integration interval. The Gaussian integration and Hammer integration currently used have the following problems:
[0084] Upper and lower limits of points:
[0085] At present, the calculation method used by Gaussian integral and Hammer integral is: first, the integral interval is converted into fixed integral limits through interval transformation method, and then the integral result is calculated using fixed formula. For example, Gaussian two-dimensional integral needs to convert the upper and lower limits of the integral into square areas with a side length of 2. However, when users use these algorithms, there are several problems as follows:
[0086] Gaussian integral cannot solve the integral of any quadrilateral or hexahedron. Due to the characteristics of Gaussian integral, the upper and lower limits of the integral in each dimension are usually [-1,1]. In order to facilitate the transformation of the upper and lower limits of the integral, fixed upper and lower limits of the integral must be given when inputting parameters, which limits the integral interval to a rectangular interval or a cuboid interval. If the integral interval is an irregular interval, Gaussian integral cannot be achieved.
[0087] Hammer integral cannot solve the integral of any triangle or tetrahedron. Due to the characteristics of Hammer integral, its upper and lower limits of integral in each dimension are usually [0,1]. In order to facilitate the transformation of upper and lower limits of integral, fixed upper and lower limits of integral need to be given when inputting parameters, which limits the integral interval to isosceles right triangle interval and regular tetrahedron interval. If the integral interval is an irregular interval, Hammer integral cannot be realized.
[0088] Unification of integral solutions
[0089] Since Gaussian integration and Hammer integration are two integral solution methods with different integral ranges, it is usually not easy to unify the two integrals in terms of methods for specific integral objects or block integration after gridding.
[0090] The integral boundaries are different. The Gaussian two-dimensional integral boundary is 4 line segments, and the three-dimensional integral is 6 surfaces. The Hammer two-dimensional integral boundary is 3 line segments, and the three-dimensional integral is 4 surfaces. There are differences in the integral boundaries.
[0091] The positions of the integration points are different. The integration points of Gaussian integration are usually symmetrical about the origin, while the integration points of Hammer integration usually do not have a symmetrical distribution property.
[0092] The definition of integration order is different. If the number of integration points of Gaussian integral in a certain dimension is n, then its integration order is usually 2n-1. There is no such obvious rule for the order and number of points of Hammer integral.
[0093] In view of this, the present application provides a calculation method and system for Gaussian integral and Hammer integral. Specifically, since the basic principle of the calculation formula used by Gaussian integral and Hammer integral is to transform a complex integration problem into a simple summation problem, the two methods can adopt a similar calculation process when solving the integral. The difference lies in the integration interval, the number of integration points and the integration weight. This provides the prerequisite for the unification of the two integration methods. At the same time, the upper and lower limits of the integral can be solved in the form of a unified multi-order parameter transformation to adapt to the upper and lower limits of the integral of arbitrary shapes, which greatly reduces the use threshold of the two integration methods.
[0094] like Figure 1 As shown, the present application provides a method for calculating Gaussian integral and Hammer integral, the method comprising:
[0095] S100, basic parameters required to build a unified interface and integration algorithm.
[0096] The basic parameters include the basic parameters required by the Gaussian integral class and the Hammer integral class.
[0097] Specifically, a unified interface is constructed according to the MFC base class framework, wherein the unified interface represents a base class and a basic interface having a unified class.
[0098] The specific structure is as follows:
[0099] 1. Construct a unified interface using the HObjectBase unified base class. The HObjectBase class is created using the MFC base class creation model. In other words, the HObjectBase class unifies the base classes and basic interfaces of all classes, achieves class unification and standardization, and supports dynamic creation of class objects and automatic type recognition.
[0100] 2. The HIntegrationBase class defines the basic parameters and related setting options required for the integration algorithm, defines the input and output interfaces and the unified integration algorithm interface, and provides conditions for implementing the common parts and unified interfaces of various algorithms.
[0101] 3.HIntegrationGaussian and HIntegrationHammer are entity classes of two specific algorithms. These classes only need to provide parameter settings, integral upper and lower limit transformation methods, and algorithm implementation functions.
[0102] The three-level class structure can be used to optimize the class structure to the greatest extent, keeping the structure clear and the functions explicit, while ensuring the versatility and extensibility of the algorithm.
[0103] In addition, illustratively, in terms of the calling method, it is implemented by setting four calling modes in the HIntegrationBase class, and no special settings are required in the entity class, which greatly simplifies the amount of code in the entity class.
[0104] double Integration(vector <array<double,2> >&boundList,double(*f)(vector <double>&)func);
[0105] Parameter text description: For entity classes inherited from HIntegrationBase to call, set the upper and lower limits of integration, and automatically call the internal parameters dimension and order.
[0106] double Integration(vector <array<double,2> >&boundList,int dimension,int order,double(*f)(vector <double>&)func);
[0107] For external calls, to set the upper and lower limits of integral, dimension and order need to be set.
[0108] double Integration(vector <vector <double>>&pointList,double(*f)(vector <double>&)func);
[0109] It is called by entity classes inherited from HIntegrationBase to set integration boundary points and automatically call internal parameters dimension and order.
[0110] double Integration(vector <vector <double>>&pointList,int dimension,intorder,double(*f)(vector <double>&)func);
[0111] For external calls, to set the integration boundary points, dimension and order need to be set.
[0112] The parameter description is shown in Table 1.
[0113]
[0114] Table 1
[0115] S200, obtaining an initial interval range integral using the unified interface and basic parameters required by the integral algorithm.
[0116] The interval range integral refers to a standard interval range integral or an arbitrary interval range integral.
[0117] S300, if the interval range integral is a standard interval range integral:
[0118] According to the upper and lower limits of the integral of the standard interval range, a plurality of standard integral points are obtained;
[0119] Transforming the integral interval for the upper and lower limits of the integral within the standard interval range, and selecting one of the transformed standard integral points as the first standard integral point;
[0120] If the interval range integral is an arbitrary interval range integral:
[0121] According to the integration of the arbitrary interval range, a plurality of non-standard integration points are obtained;
[0122] Converting the plurality of non-standard integral points to obtain a shape characteristic area;
[0123] The integral interval transformation is performed on the shape feature area, and a non-standard integral point after the transformation is selected as the first non-standard integral point.
[0124] Specifically, the step of obtaining a plurality of standard integral points according to the upper and lower limits of the integral of the standard interval range includes:
[0125] According to the standard interval range integral, the upper and lower limits of the standard interval range integral are obtained;
[0126] A plurality of standard integral points are obtained according to the upper and lower limits of the integral of the standard interval range.
[0127] In addition, the step of transforming the integral interval of the upper and lower limits of the integral of the standard interval range, and selecting a transformed standard integral point as the first standard integral point includes:
[0128] The upper and lower limits of the standard interval range integral are translated and / or scaled to adjust the upper and lower limits of the standard interval range integral to obtain an interval integral that satisfies the Gaussian integral and the Hammer integral calculation;
[0129] Under the interval integration calculated by the Gaussian integral and the Hammer integral, an integral point corresponding to the standard integral point is selected from a plurality of the standard integral points to obtain the first standard integral point.
[0130] like Figure 2 As shown, illustratively, after starting the calculation, the upper and lower limits of the interval range integral are translated and / or scaled so that the interval range integral is within the upper and lower limits of the standard Gaussian integral and Hammer integral. Only in this way can Gaussian integral and Hammer integral be used for calculation. Next, multiple standard integral points are obtained. The interval range integral is transformed into an integral interval. After the integral interval is transformed, the multiple standard integral points are converted into a first integral point, a second integral point, a third integral point...the Nth integral point. Among the multiple integral points, an integral point can be randomly selected as the first integral point, for example, the first integral point is used as the first integral point.
[0131] Specifically, the step of obtaining a plurality of non-standard integral points according to the arbitrary interval range integral includes:
[0132] According to the arbitrary interval range integral, obtain the upper and lower limits of the arbitrary interval range integral;
[0133] According to the upper and lower limits of the integral of the arbitrary interval range, a plurality of non-standard integral points are obtained.
[0134] In addition, the step of converting the plurality of non-standard integral points to obtain the shape characteristic area includes:
[0135] Using the shape function, a plurality of the non-standard integral points are subjected to derivative calculation to obtain shape function derivatives, wherein the shape function represents a shape function corresponding to the standard integral;
[0136] The Jacobian matrix is used to calculate the shape function derivative to obtain the shape feature area.
[0137] like Figure 3 As shown, exemplarily, after starting the calculation, since we are facing an integral over an arbitrary interval range, we need to use the shape function to calculate the geometric correspondence between the standard integral and the arbitrary shape, and use the Jacobian matrix to calculate the shape characteristic area. First, the shape function derivatives are calculated for multiple non-standard integration points, and then the Jacobian matrix is used to describe the interdependence between variables to obtain the characteristic area, and then the integration interval is transformed.
[0138] For the aforementioned integral interval transformation, since Gaussian integral and Hammer integral require that the integral upper and lower limits must be fixed values, in the process of using the algorithm, other integral upper and lower limits must first be transformed into standard integral upper and lower limits through the integral interval transformation method. For example: Gaussian integral requires the upper and lower limits of each dimension to be [-1,1]. If the provided integral upper and lower limits are [3,5], the integral upper and lower limits need to be transformed from [3,5] to [-1,1] through translation and scaling.
[0139] For example, for different entity classes, due to the different characteristics of the algorithm itself, there will be differences in the processing of the algorithm during specific calculations. For the case of fixed upper and lower limits of integration, a unified algorithm can be used. For any integration range, it is necessary to process according to the integration type, integration dimension and integration order.
[0140] (1) Define a unified shape function interface in the HIntegrationBase class.
[0141] virtual Matrix dN(vector <double>&pos)const=0;
[0142] virtual Vector N(vector <double>&pos)const = 0;
[0143] (2) Implement these shape interfaces in the entity class as follows.
[0144] like Figure 4 As shown, the standard integral shape function of a three-node triangle
[0145]
[0146] like Figure 5 As shown, the standard integral shape function of a four-node quadrilateral
[0147]
[0148] ξ and η are the coordinate parameters of the local coordinate system, N i is the shape function parameter.
[0149] (3) Point setting.
[0150] Set up a special integration point structure (Struct) to store the integration point information of various types of integrals. This structure provides the integration nodes and node coefficients of Gaussian integral and Hammer integral, such as: {{-0.577350269189626,-0.577350269189626},1.0} represents the first of the four integration nodes of the two-dimensional second-order integral, the node is {-0.577350269189626,-0.577350269189626}, and the coefficient is 1.0.
[0151]
[0152] Gaussian two-dimensional integration of the first two order integration point data
[0153]
[0154]
[0155] The first three integration point data of Hammer two-dimensional integration
[0156]
[0157] S400, calling an integration object for the first standard integration point or the first non-standard integration point to obtain a first integration result.
[0158] The integral object represents the Gaussian integral class or the Hammer integral class.
[0159] Specifically, according to the interval range integral corresponding to the first standard integral point or the first non-standard integral point, the Gaussian integral class or the Hammer integral class is called to perform matching calculation to obtain the first integral result.
[0160] S500, according to the first standard integration point or the first non-standard integration point, correspondingly searching for an adjacent second standard integration point or a second non-standard integration point, and for the second integration point, calling the integration object to obtain a second integration result.
[0161] Specifically, after obtaining the second standard integral point or the second non-standard integral point in the aforementioned steps, it is necessary to judge the adjacent integral points to determine whether it is the last integral point. If it is not the last integral point, it is necessary to call the calculation of the integral object for the next standard integral point or non-standard integral point to obtain the corresponding integral result, and the process ends after finding the last standard integral point or non-standard integral point, and outputs all integral results.
[0162] S600: output the first integration result and the second integration result.
[0163] The output result formed by the first integration result and the second integration result is an integration result value, and these values are combined together to form a unit stiffness matrix.
[0164] In summary, this application uses a two-level base class (HObjectBase and HIntegrationBase) and a first-level entity class to define the interface. The HObjectBase class mainly implements basic object-oriented functions such as dynamic creation of class objects and automatic type recognition; HIntegrationBase defines two types of interface methods and two shape function interfaces, and standardizes the unified algorithm interface of the entity class; the entity class has implemented the shape function and integration point data required for Gaussian integration and Hammer integration. When users use different integration methods, they only need to provide a specified number of parameters and specify the order of integration to complete the call. It also supports external calls, and the calling method is simple, and the algorithm replacement is more flexible. The personalized processing part and the general part of the specific algorithm are separated, and the inheritance and polymorphism of the C++ class are fully utilized to achieve the unification of the integration method without losing its individuality. Especially in the finite element simulation calculation process of solid engine characteristic analysis, the geometric model, mesh model, model solution and data are established before processing. Finite element calculations are performed using geometric models, and the geometric models are meshed, that is, the geometric models are simplified into meshes composed of simple shapes. Two-dimensional geometric models are usually converted into triangles or quadrilaterals, and three-dimensional geometric models are usually converted into tetrahedrons or hexahedrons. Gaussian integrals and Hammer integrals are unified to solve meshes of different orders to ensure computational efficiency.
[0165] The integral algorithm provided in this application is a single-interval calculation method. Since the integral has the property of being listable and additivity, in the presence of a unified calling interface, subsequent users can optimize the integral interval calculation method according to their needs.
[0166] Based on the same inventive concept, the second aspect of the embodiment of the present application further provides a system for calculating Gaussian integrals and Hammer integrals. The implementation scheme for solving the problem provided by the system for calculating Gaussian integrals and Hammer integrals is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more embodiments provided below can refer to the limitations of the calculation method for Gaussian integrals and Hammer integrals above, and will not be repeated here.
[0167] like Figure 6 As shown, in one embodiment, a calculation system for Gaussian integral and Hammer integral is provided, the system comprising:
[0168] HObjectBase unified base class, used to build a unified interface;
[0169] HIntegrationBase is an integration algorithm base class, which is connected to the HObjectBase unified base class and is used to construct the basic parameters required for the integration algorithm, wherein the basic parameters include the basic parameters required for the Gaussian integration class and the Hammer integration class;
[0170] HIntegrationGaussian integration class, connected to HIntegrationBase integration algorithm base class, is used to calculate data that conforms to the Gaussian integration class;
[0171] HIntegrationHammer integration class, connected to HIntegrationBase integration algorithm base class, is used to calculate data that conforms to the Hammer integration class;
[0172] The system is configured to:
[0173] Constructing basic parameters required for a unified interface and an integral algorithm, wherein the basic parameters include basic parameters required for a Gaussian integral class and a Hammer integral class;
[0174] Using the unified interface and basic parameters required by the integration algorithm, an initial interval range integral is obtained, wherein the interval range integral represents a standard interval range integral or an arbitrary interval range integral;
[0175] If the interval range integral is a standard interval range integral:
[0176] According to the upper and lower limits of the integral of the standard interval range, a plurality of standard integral points are obtained;
[0177] Transforming the integral interval for the upper and lower limits of the integral within the standard interval range, and selecting one of the transformed standard integral points as the first standard integral point;
[0178] If the interval range integral is an arbitrary interval range integral:
[0179] According to the integration of the arbitrary interval range, a plurality of non-standard integration points are obtained;
[0180] Converting the plurality of non-standard integral points to obtain a shape characteristic area;
[0181] Performing the integral interval transformation on the shape feature area, and selecting one of the non-standard integral points after the transformation as the first non-standard integral point;
[0182] For the first standard integration point or the first non-standard integration point, an integration object is called to obtain a first integration result, wherein the integration object represents the Gaussian integration class or the Hammer integration class;
[0183] According to the first standard integration point or the first non-standard integration point, correspondingly searching for an adjacent second standard integration point or a second non-standard integration point, and for the second integration point, calling the integration object to obtain a second integration result;
[0184] The first integration result and the second integration result are output.
[0185] A third aspect of this embodiment provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the aforementioned method for calculating the Gaussian integral and the Hammer integral when executing the computer program.
[0186] A fourth aspect of the present embodiment is a computer program having a computer program stored thereon, which, when executed by a processor, implements the steps of the aforementioned method for calculating the Gaussian integral and the Hammer integral.
[0187] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and 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-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0188] The various embodiments in the present disclosure are described in a progressive manner, and the same or similar parts between the various embodiments can be referenced to each other, and each embodiment focuses on the differences from other embodiments.
[0189] The protection scope of the present disclosure is not limited to the above-mentioned embodiments. Obviously, those skilled in the art can make various changes and modifications to the present disclosure without departing from the scope and spirit of the present disclosure. If these changes and modifications fall within the scope of the claims of the present disclosure and their equivalents, the intention of the present disclosure also includes these changes and modifications.< / double> < / double> < / double> < / double> < / double> < / double> < / double> < / double>
Claims
1. A method for calculating Gaussian integral and Hammer integral, It is characterized in that The method comprises: Constructing basic parameters required for a unified interface and an integral algorithm, wherein the basic parameters include basic parameters required for a Gaussian integral class and a Hammer integral class; Using the unified interface and basic parameters required by the integration algorithm, an initial interval range integral is obtained, wherein the interval range integral represents a standard interval range integral or an arbitrary interval range integral; If the interval range integral is a standard interval range integral: According to the upper and lower limits of the integral of the standard interval range, a plurality of standard integral points are obtained; Transforming the integral interval for the upper and lower limits of the integral within the standard interval range, and selecting one of the transformed standard integral points as the first standard integral point; If the interval range integral is an arbitrary interval range integral: According to the integration of the arbitrary interval range, a plurality of non-standard integration points are obtained; Converting the plurality of non-standard integral points to obtain a shape characteristic area; Performing the integral interval transformation on the shape feature area, and selecting one of the non-standard integral points after the transformation as the first non-standard integral point; For the first standard integration point or the first non-standard integration point, an integration object is called to obtain a first integration result, wherein the integration object represents the Gaussian integration class or the Hammer integration class; According to the first standard integration point or the first non-standard integration point, correspondingly searching for an adjacent second standard integration point or a second non-standard integration point, and for the second integration point, calling the integration object to obtain a second integration result; The first integration result and the second integration result are output.
2. The method for calculating Gaussian integral and Hammer integral according to claim 1, It is characterized in that The steps of constructing the unified interface and the basic parameters required by the integration algorithm include: According to the MFC base class framework, a unified interface is constructed, wherein the unified interface represents a base class and a basic interface having a unified class.
3. The method for calculating Gaussian integral and Hammer integral according to claim 1, It is characterized in that The step of obtaining a plurality of standard integral points according to the upper and lower limits of the integral of the standard interval range comprises: According to the standard interval range integral, the upper and lower limits of the standard interval range integral are obtained; A plurality of standard integral points are obtained according to the upper and lower limits of the integral of the standard interval range.
4. The method for calculating Gaussian integral and Hammer integral according to claim 3, It is characterized in that The step of transforming the integral interval of the upper and lower limits of the integral of the standard interval range, and selecting a transformed standard integral point as the first standard integral point, comprises: The upper and lower limits of the standard interval range integral are translated and / or scaled to adjust the upper and lower limits of the standard interval range integral to obtain an interval integral that satisfies the Gaussian integral and the Hammer integral calculation; Under the interval integration calculated by the Gaussian integral and the Hammer integral, an integral point corresponding to the standard integral point is selected from a plurality of the standard integral points to obtain the first standard integral point.
5. The method for calculating Gaussian integral and Hammer integral according to claim 1, It is characterized in that The step of obtaining a plurality of non-standard integral points according to the arbitrary interval range integral includes: According to the arbitrary interval range integral, obtain the upper and lower limits of the arbitrary interval range integral; According to the upper and lower limits of the integral of the arbitrary interval range, a plurality of non-standard integral points are obtained.
6. The method for calculating Gaussian integral and Hammer integral according to claim 5, It is characterized in that The step of converting the plurality of non-standard integral points to obtain the shape characteristic area comprises: Using the shape function, a plurality of the non-standard integral points are subjected to derivative calculation to obtain shape function derivatives, wherein the shape function represents a shape function corresponding to the standard integral; The Jacobian matrix is used to calculate the shape function derivative to obtain the shape feature area.
7. The method for calculating Gaussian integral and Hammer integral according to claim 1, It is characterized in that The step of calling the integration object for the first standard integration point or the first non-standard integration point to obtain a first integration result comprises: According to the interval range integral corresponding to the first standard integral point or the first non-standard integral point, the Gaussian integral class or the Hammer integral class is called to perform matching calculation to obtain the first integral result.
8. A system for calculating Gaussian integrals and Hammer integrals. It is characterized in that A method for calculating Gaussian integral and Hammer integral applied to any one of claims 1 to 7, wherein the system comprises: HObjectBase unified base class, used to build a unified interface; HIntegrationBase is an integration algorithm base class, which is connected to the HObjectBase unified base class and is used to construct the basic parameters required for the integration algorithm, wherein the basic parameters include the basic parameters required for the Gaussian integration class and the Hammer integration class; HIntegrationGaussian integration class, connected to HIntegrationBase integration algorithm base class, is used to calculate data that conforms to the Gaussian integration class; HIntegrationHammer integration class, connected to HIntegrationBase integration algorithm base class, is used to calculate data that conforms to the Hammer integration class; The system is configured to: Constructing basic parameters required for a unified interface and an integral algorithm, wherein the basic parameters include basic parameters required for a Gaussian integral class and a Hammer integral class; Using the unified interface and basic parameters required by the integration algorithm, an initial interval range integral is obtained, wherein the interval range integral represents a standard interval range integral or an arbitrary interval range integral; If the interval range integral is a standard interval range integral: According to the upper and lower limits of the integral of the standard interval range, a plurality of standard integral points are obtained; Transforming the integral interval for the upper and lower limits of the integral within the standard interval range, and selecting one of the transformed standard integral points as the first standard integral point; If the interval range integral is an arbitrary interval range integral: According to the integration of the arbitrary interval range, a plurality of non-standard integration points are obtained; Converting the plurality of non-standard integral points to obtain a shape characteristic area; Performing the integral interval transformation on the shape feature area, and selecting one of the non-standard integral points after the transformation as the first non-standard integral point; For the first standard integration point or the first non-standard integration point, an integration object is called to obtain a first integration result, wherein the integration object represents the Gaussian integration class or the Hammer integration class; According to the first standard integration point or the first non-standard integration point, correspondingly searching for an adjacent second standard integration point or a second non-standard integration point, and for the second integration point, calling the integration object to obtain a second integration result; The first integration result and the second integration result are output.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program. It is characterized in that When the processor executes the computer program, the steps of the method for calculating the Gaussian integral and the Hammer integral according to any one of claims 1 to 7 are implemented.
10. A computer program having a computer program stored thereon, It is characterized in that When the computer program is executed by a processor, the steps of the method for calculating the Gaussian integral and the Hammer integral according to any one of claims 1 to 7 are implemented.
