Summary of the invention
The object of the invention is exactly to provide a kind of subdivision error little for the defective that overcomes above-mentioned prior art existence, the three-dimensional finite element mesh automatic division method that comprises multiple member that efficient is high.
The object of the invention can be realized through following technical scheme:
Comprise the three-dimensional finite element mesh automatic division method of multiple member, may further comprise the steps:
(1) obtains the geological information and the grid controlled variable of pre-treatment object;
(2) by body, face, line, point to the gridding of classifying of pre-treatment object, set up initial mesh object topological relation tree;
(3) ask and hand over and interrupt all mesh objects, upgrade mesh object topological relation tree;
The gridding order of (4) pressing body, face, line, point is all leaf node mesh objects of subdivision successively;
(5) the pre-treatment object according to member divides into groups with its topological relation filler cells;
(6) the finite element attribute of unit packet is set, this finite element attribute is identical with the pre-treatment object of member;
(7) storage and output grid automatic division result.
The concrete steps of described step (3) are following:
(301) establishment is asked friendship device, initialization to ask and is handed over the device data, adds whole controlled variable and total construction step number;
(302) initialization body, face, line, four topological tree arrays of point;
(303) topological data of the mesh object of all inputs is classified, leave in respectively in four topological tree arrays;
(304) body and body are asked friendship: travel through all grid bodies and carry out intersecting in twos calculating, preserve common sides, concentric line, common point between the grid body, and set up topological relation;
(305) body and face are asked friendship: travel through all grid bodies and have the grid surface of pre-treatment object reference with all, carry out dignity and intersect calculating in twos, preserve described grid body and face common sides, concentric line, the common point between the picture, and set up topological relation;
(306) face and face are asked friendship: travel through the grid surface that all have the pre-treatment object reference, carry out intersecting in twos calculating, preserve common sides, concentric line, common point between the grid surface, and set up topological relation;
(307) the sub-face in the arrangement body: travel through all grid bodies, obtain sub-face data all in each grid body,, then obtain corresponding round floor and replace through mesh object topological relation tree if described sub-face is not a round floor;
(308) the sub-face in the arrangement face: travel through all grid surfaces, obtain sub-face data all in each grid surface,, then obtain corresponding round floor and replace through mesh object topological relation tree if described sub-face is not a round floor;
(309) line and body are asked friendship: travel through all grid bodies and have the mesh lines of pre-treatment object reference with all, carry out the body line and intersect calculating in twos, preserve concentric line, the common point between described grid body and the line object and set up topological relation;
(310) line and face are asked friendship: travel through all grid surfaces and have the mesh lines of pre-treatment object reference with all, carry out upper thread and intersect calculating in twos, preserve concentric line, the common point between described grid surface and the line object and set up topological relation;
(311) extract the frame line of round floor: travel through allly, extract frame line, this frame line is created mesh lines, and set up the topological relation of said mesh lines and corresponding round floor in the face of all round floors in the picture in the face of picture;
(312) line and line are asked friendship: travel through all mesh lines, described mesh lines is intersected in twos calculate, interrupt generation and do not have overlapping sub-line each other, and this sub-line is created new mesh lines, and set up topological relation with the mesh lines that generates this sub-line;
(313) the sub-line in the arrangement body: travel through all grid bodies; Obtain grid body all corresponding sub-line data on mesh object topological relation tree,, then obtain corresponding bottom line and replace through mesh object topological relation tree if described sub-line is not the bottom line; Then sub-faces all in the grid body is traveled through; Judge whether described sub-line has on described sub-face, if yes, then described sub-line is added in the corresponding sub-face; As the sub-line of this sub-face, and delete the topological relation of said sub-line and corresponding grid body;
(314) the sub-line in the arrangement face: travel through all grid surfaces, obtain grid surface all corresponding sub-line data on mesh object topological relation tree, if sub-line is not the bottom line in the relational tree; Then obtain corresponding bottom line and replace, judge then whether current grid surface is round floor, if not through mesh object topological relation tree; Then obtain this all round floors in the face of picture; Travel through each more respectively in the face of bottom line that picture obtains, judge that described bottom line is whether on round floor, if yes; Then described bottom line is added in the round floor at this bottom line place, and delete the topological relation of said bottom line and corresponding grid surface;
(315) the sub-line in the arrangement line: travel through all mesh lines, obtain the mesh lines that each has the pre-treatment object reference, this mesh lines corresponding all sub-lines in mesh object topological relation tree are replaced to the bottom line;
(316) the sub-point in the arrangement body: travel through sub-face and sub-point in all grid bodies; Judge that described son point is whether on described sub-face; If yes, then described son point is added on the sub-face at its place, and delete the topological relation of said son point and corresponding grid body;
(317) the sub-point in the arrangement face: travel through all grid surfaces,, then obtain this round floor in the face of picture if grid surface is not a round floor; Judge said in the face of the last son point of picture whether on round floor, if yes, then described son is put the round floor that adds its place to and gets on; And delete the topological relation of said son point and corresponding grid surface, travel through all face bottoms then again, sub-line and sub-point on the acquisition round floor; Judge that the son point is whether on sub-line; If yes, then described son point is added on the sub-line at place, and delete the topological relation of said son point and corresponding round floor;
(318) the sub-point in the arrangement line: travel through all mesh lines,, then obtain the bottom line of said mesh lines if mesh lines is not the bottom line; Whether the son point of judging mesh lines is on the bottom line; If yes, then described son adds on the bottom line at its place, and deletes the topological relation of said son point and corresponding mesh lines; Again travel through all bottom lines then; Obtain all the sub-points on the bottom line, said group of son pressed its u parameter marshalling on curve, gone heavily, and rejecting and the overlapping sub-point of bottom endpoints;
(319) add the boundary condition key point: travel through the key point of the boundary condition of all inputs, it is created topological point how much, add in the topological tree array;
(320) arrangement is had a few: the key point data of obtaining all mesh objects; Write down correlation map information simultaneously; All key point data are carried out the coordinate ordering, gone heavily, and the key point data after traversal goes to weigh then create topological point with each key point; Through the information in the mapping table, quoting of topology point is backfilling in the corresponding mesh object and sets up topological relation;
(321) arrangement isolated point: judge whether isolated point is overlapping with the intersection point of asking intergrowth to become, if yes, then do not need to set up again topological relation; If not; Judge that then whether said isolated point is positioned on the mesh object of participating in subdivision, if yes, then sets up topological relation with corresponding mesh object;
(322) output data: travel through the mesh object that all have the mesh object topological relation treetop layer of pre-treatment object reference; Mesh object is labeled as and can derives; Travel through all subobjects of said mesh object then, and be labeled as and derive, with being labeled as the mesh object classification that to derive; And the topological tree array that exports to correspondence respectively is heavy, deletes unmarked object data for deriving.
The concrete steps of described step (4) are following:
(41) initialization member variable empties result data, preserves body, face, line, four topological tree arrays of point and whole controlled variable;
(42) travel through all grid bodies; Judge whether described grid body has the subdivision controlled variable of self; If yes, then use the subdivision controlled variable of self, if not; Then use whole controlled variable as the subdivision controlled variable, call body subdivision device and the grid body is carried out subdivision according to the subdivision controlled variable;
(43) travel through the grid surface that all have the pre-treatment object reference, judge whether described grid surface has the subdivision control parameter of self, if yes; Then use the subdivision control parameter of self,, then use whole control parameter to control parameter as subdivision if not; Judge then whether grid surface exists sub-face; If there is sub-face, all of traversal grid surface are participated in the sub-face of subdivision, call face subdivision device and carry out subdivision based on subdivision control parameter antithetical phrase face; If there is not sub-face, then calls face subdivision device and current grid surface is carried out subdivision based on subdivision control parameter;
(44) travel through the grid lines that all have the pre-treatment object reference, judge whether described grid lines has the subdivision control parameter of self, if yes; Then use the subdivision control parameter of self,, then use whole control parameter to control parameter as subdivision if not; Judge then whether grid lines exists sub-line; If there is sub-line, all of traversal grid lines are participated in the sub-line of subdivision, call line subdivision device and carry out subdivision based on subdivision control parameter antithetical phrase line; If there is not sub-line, then calls line subdivision device and current grid lines is carried out subdivision based on subdivision control parameter;
(45) travel through the net point that all have the pre-treatment object reference; Judge whether described net point has the subdivision controlled variable of self; If yes, then use the subdivision controlled variable of self, if not; Then use the integral point controlled variable as the subdivision controlled variable, point of invocation subdivision device carries out subdivision according to the subdivision controlled variable to net point.
The concrete steps of described step (5) are following:
(51) initialization tucker empties node, cell data;
(52) node data with input directly saves as the node data of derivation;
(53) travel through the mesh object of all mesh object topological relation treetop layers, extract the cell data that is generated behind its all leaf node subdivisions, these cell datas are stored in the current unit group.
Wherein, mesh object (Mesh_Object): a kind of base class of describing gridding how much topological relations, ask hand over interrupt and the subdivision process in play a part to provide how much.
Net point (Mesh_Point): derive from mesh object, describe the topological point of geometry of gridding.
Mesh lines (Mesh_Edge): derive from mesh object, describe the topological limit of geometry of gridding.
Grid surface (Mesh_Face): derive from mesh object, describe the geometry manifold of gridding.
Grid body (Mesh_Solid): derive from mesh object, describe how much topological entities of gridding.
Subdivision object gatherer (MeshObjectCollector): be used to collect the pre-treatment object of participating in subdivision, and these objects are carried out rough handling, former how much wire frames, shell, solid polymer composite etc. decompose the four seed category objects of sorting out outer grid object with how much.
The subdivision object is asked and is handed over device (MeshObjectIntersector): mesh object is given overlapping calculation mutually; Obtain how much public part; Rebulid the mesh object topological structure, simultaneously the part input parameter is handled like construction operating mode and boundary condition.
Mesh generation device (MeshGen): handle asking how much topological structures of mesh object of handing over device to handle to carry out gridding, handle data such as grid controlled variable, generate preliminary grid node and cell data.
Grid tucker (MeshFiller): initial mesh node and unit are handled, duplicated etc., generate the grid data tissue relevant with member like ordering, grouping and unit.
In the described step (2); What mesh object used is Brep (B reps); The moulding algorithm use be the OpenCASCADE geometric library of increasing income; The original geometry type has seven kinds on summit (Vertex), limit (Edge), wire frame (Wire), face (Face), shell (Shell), entity (Solid), complex (Compound), converts four types of net points (Mesh_Point), mesh lines (Mesh_Edge), grid surface (Mesh_Face), grid body (Mesh_Solid) in this decomposition, mainly is that wire frame is decomposed into the mesh lines set; Shell is decomposed into grid surface set, complex be decomposed into below four kinds or four kinds the set of mesh object.
The Brep B reps is adopted in the expression of mesh object, and the moulding algorithm uses the OpenCASCADE geometric library of increasing income.
The subdivision of grid surface adopts and advances wave-front method, and the subdivision of grid body adopts the Delaunay tetrahedral grid algorithm of constraint.
Compared with prior art, the present invention has changed finite element pre-treatment modeling flow process, and complicated structure analysis no longer needs the user to participate in revising node and unit; The finite element parameter is provided with all and on visual three-dimensional geometry member, accomplishes; Be easy to study and grasp, the cost that effectively reduces study and use finite element to carry out structure analysis, the while is not because mesh generation needs the user to participate in; Practiced thrift the time of finite element modeling; And reduced because the user operates error or the error that grid causes, thereby avoided the result of calculation problem brought thus, for miscellaneous careful finite element pre-treatment modeling provides a kind of efficient and succinct method.
Embodiment
Below in conjunction with accompanying drawing and specific embodiment the present invention is elaborated.
Embodiment
As shown in Figure 1, comprise the three-dimensional finite element mesh automatic division method of multiple member, may further comprise the steps:
Step 1, definition mesh object data structure (Mesh_Object) and four sub-class thereof, net point (Mesh_Point), mesh lines (Mesh_Edge), grid surface (Mesh_Face), grid body (Mesh_Solid); Its base type comprises the object array of four sub-class, is used to set up mesh object topological relation tree.
Step 2, finite element attribute and the grid controlled variable of collecting the pre-treatment object are used the original geometry data, initialization mesh object topological relation tree, the Brep B reps is adopted in the expression of mesh object, the moulding algorithm use OpenCASCADE geometric library of increasing income.
Step 3 is asked friendship and is interrupted renewal mesh object topological relation tree mesh object;
Step 4; The gridding order of pressing body, face, line, point is all leaf node mesh objects of subdivision successively; The suitable employing propelling of surface mesh wave-front method (Advancing Front Technique, AFT), the entity mesh generation is fit to adopt the Delaunay tetrahedral grid algorithm that retrains;
Step 5 is filled the original mesh data that the subdivision device provides and rearrange according to the topological relation of mesh object, according to pre-treatment object and its topological relation filler cells grouping of member;
Step 6 according to the corresponding pre-treatment object properties of grid group, is provided with the grid group attribute information, comprises work progress, boundary condition, material properties;
Step 7 is preserved and the output result.
Wherein, the concrete steps of described step 3 are as shown in Figure 2, comprising:
(301) establishment is asked friendship device, initialization to ask and is handed over the device data, adds whole controlled variable and total construction step number;
(302) initialization body, face, line, four topological tree arrays of point;
(303) topological data of the mesh object of all inputs is classified, leave in respectively in four topological tree arrays;
(304) body and body are asked friendship: travel through all grid bodies and carry out intersecting in twos calculating, preserve common sides, concentric line, common point between the grid body, and set up topological relation, the pattern checking before gridding guarantees not exist between the body object mutually nested.
(305) body and face are asked friendship: travel through all grid bodies and have the grid surface of pre-treatment object reference with all, carry out dignity and intersect calculating in twos, preserve described grid body and face common sides, concentric line, the common point between the picture, and set up topological relation;
(306) face and face are asked friendship: travel through the grid surface that all have the pre-treatment object reference, carry out intersecting in twos calculating, preserve common sides, concentric line, common point between the grid surface, and set up topological relation;
(307) the sub-face in the arrangement body: travel through all grid bodies, obtain sub-face data all in each grid body,, then obtain corresponding round floor and replace through mesh object topological relation tree if described sub-face is not a round floor;
(308) the sub-face in the arrangement face: travel through all grid surfaces, obtain sub-face data all in each grid surface,, then obtain corresponding round floor and replace through mesh object topological relation tree if described sub-face is not a round floor;
(309) line and body are asked friendship: travel through all grid bodies and have the mesh lines of pre-treatment object reference with all, carry out the body line and intersect calculating in twos, preserve concentric line, the common point between described grid body and the line object and set up topological relation;
(310) line and face are asked friendship: travel through all grid surfaces and have the mesh lines of pre-treatment object reference with all, carry out upper thread and intersect calculating in twos, preserve concentric line, the common point between described grid surface and the line object and set up topological relation;
(311) extract the frame line of round floor: travel through allly, extract frame line, this frame line is created mesh lines, and set up the topological relation of said mesh lines and corresponding round floor in the face of all round floors in the picture in the face of picture;
(312) line and line are asked friendship: travel through all mesh lines, described mesh lines is intersected in twos calculate, interrupt generation and do not have overlapping sub-line each other, and this sub-line is created new mesh lines, and set up topological relation with the mesh lines that generates this sub-line;
(313) the sub-line in the arrangement body: travel through all grid bodies; Obtain grid body all corresponding sub-line data on mesh object topological relation tree,, then obtain corresponding bottom line and replace through mesh object topological relation tree if described sub-line is not the bottom line; Then sub-faces all in the grid body is traveled through; Judge whether described sub-line has on described sub-face, if yes, then described sub-line is added in the corresponding sub-face; As the sub-line of this sub-face, and delete the topological relation of said sub-line and corresponding grid body;
(314) the sub-line in the arrangement face: travel through all grid surfaces, obtain grid surface all corresponding sub-line data on mesh object topological relation tree, if sub-line is not the bottom line in the relational tree; Then obtain corresponding bottom line and replace, judge then whether current grid surface is round floor, if not through mesh object topological relation tree; Then obtain this all round floors in the face of picture; Travel through each more respectively in the face of bottom line that picture obtains, judge that described bottom line is whether on round floor, if yes; Then described bottom line is added in the round floor at this bottom line place, and delete the topological relation of said bottom line and corresponding grid surface;
(315) the sub-line in the arrangement line: travel through all mesh lines, obtain the mesh lines that each has the pre-treatment object reference, this mesh lines corresponding all sub-lines in mesh object topological relation tree are replaced to the bottom line;
(316) the sub-point in the arrangement body: travel through sub-face and sub-point in all grid bodies; Judge that described son point is whether on described sub-face; If yes, then described son point is added on the sub-face at its place, and delete the topological relation of said son point and corresponding grid body;
(317) the sub-point in the arrangement face: travel through all grid surfaces,, then obtain this round floor in the face of picture if grid surface is not a round floor; Judge said in the face of the last son point of picture whether on round floor, if yes, then described son is put the round floor that adds its place to and gets on; And delete the topological relation of said son point and corresponding grid surface, travel through all face bottoms then again, sub-line and sub-point on the acquisition round floor; Judge that the son point is whether on sub-line; If yes, then described son point is added on the sub-line at place, and delete the topological relation of said son point and corresponding round floor;
(318) the sub-point in the arrangement line: travel through all mesh lines,, then obtain the bottom line of said mesh lines if mesh lines is not the bottom line; Whether the son point of judging mesh lines is on the bottom line; If yes, then described son adds on the bottom line at its place, and deletes the topological relation of said son point and corresponding mesh lines; Again travel through all bottom lines then; Obtain all the sub-points on the bottom line, said group of son pressed its u parameter marshalling on curve, gone heavily, and rejecting and the overlapping sub-point of bottom endpoints;
(319) add the boundary condition key point: travel through the key point of the boundary condition of all inputs, it is created topological point how much, add in the topological tree array;
(320) arrangement is had a few: the key point data of obtaining all mesh objects; Write down correlation map information simultaneously; All key point data are carried out the coordinate ordering, gone heavily, and the key point data after traversal goes to weigh then create topological point with each key point; Through the information in the mapping table, quoting of topology point is backfilling in the corresponding mesh object and sets up topological relation;
(321) arrangement isolated point: judge whether isolated point is overlapping with the intersection point of asking intergrowth to become, if yes, then do not need to set up again topological relation; If not; Judge that then whether said isolated point is positioned on the mesh object of participating in subdivision, if yes, then sets up topological relation with corresponding mesh object;
(322) output data: travel through the mesh object that all have the mesh object topological relation treetop layer of pre-treatment object reference; Mesh object is labeled as and can derives; Travel through all subobjects of said mesh object then, and be labeled as and derive, with being labeled as the mesh object classification that to derive; And the topological tree array that exports to correspondence respectively is heavy, deletes unmarked object data for deriving.
The concrete steps of described step (4) are following:
(41) initialization member variable empties result data, preserves body, face, line, four topological tree arrays of point and whole controlled variable;
(42) travel through all grid bodies; Judge whether described grid body has the subdivision controlled variable of self; If yes, then use the subdivision controlled variable of self, if not; Then use whole controlled variable as the subdivision controlled variable, call body subdivision device and the grid body is carried out subdivision according to the subdivision controlled variable;
(43) travel through the grid surface that all have the pre-treatment object reference, judge whether described grid surface has the subdivision control parameter of self, if yes; Then use the subdivision control parameter of self,, then use whole control parameter to control parameter as subdivision if not; Judge then whether grid surface exists sub-face; If there is sub-face, all of traversal grid surface are participated in the sub-face of subdivision, call face subdivision device and carry out subdivision based on subdivision control parameter antithetical phrase face; If there is not sub-face, then calls face subdivision device and current grid surface is carried out subdivision based on subdivision control parameter;
(44) travel through the grid lines that all have the pre-treatment object reference, judge whether described grid lines has the subdivision control parameter of self, if yes; Then use the subdivision control parameter of self,, then use whole control parameter to control parameter as subdivision if not; Judge then whether grid lines exists sub-line; If there is sub-line, all of traversal grid lines are participated in the sub-line of subdivision, call line subdivision device and carry out subdivision based on subdivision control parameter antithetical phrase line; If there is not sub-line, then calls line subdivision device and current grid lines is carried out subdivision based on subdivision control parameter;
(45) travel through the net point that all have the pre-treatment object reference; Judge whether described net point has the subdivision controlled variable of self; If yes, then use the subdivision controlled variable of self, if not; Then use the integral point controlled variable as the subdivision controlled variable, point of invocation subdivision device carries out subdivision according to the subdivision controlled variable to net point.
The concrete steps of described step (5) are following:
(51) initialization tucker empties node, cell data;
(52) node data with input directly saves as the node data of derivation;
(53) travel through the mesh object of all mesh object topological relation treetop layers, extract the cell data that is generated behind its all leaf node subdivisions, these cell datas are stored in the current unit group.
The present invention has changed finite element pre-treatment modeling flow process; Complicated structure analysis no longer needs the user to participate in revising node and unit; The finite element parameter is provided with all and on visual three-dimensional geometry member, accomplishes; Owing to be easy to study and grasp the cost that effectively reduces study and use finite element to carry out structure analysis.Simultaneously because grid does not need the user to participate in; Practiced thrift the time of finite element modeling; And reduced because the user operates error or the error that grid causes; Thereby avoid the result of calculation problem brought thus,, and obtained gratifying effect for miscellaneous careful finite element pre-treatment modeling provides a kind of efficient and succinct method.