Some Algorithms To Correct A Geometry in Order To Create A Finite Element Mesh
Some Algorithms To Correct A Geometry in Order To Create A Finite Element Mesh
www.elsevier.com/locate/compstruc
Abstract
One of the major difficulties in meshing 3D complex geometries is to deal with non-proper geometrical definitions
coming from CAD systems. Typically, CAD systems do not take care of the proper definition of the geometries for the
analysis purposes. In addition, the use of standard CAD files (IGES, VDA, . . .) for the transfer of geometries between
different systems introduce some additional difficulties.
In this work, a collection of algorithms to repair and/or to improve the geometry definitions are provided. The aim
of these algorithms is to make as easy as possible the generation of a mesh over complex geometries given some
minimum requirements of quality and correctness. The geometrical model will be considered as composed of a set of
NURBS lines and trimmed surfaces.
Some examples of application of the algorithms and of the meshes generated from the corrected geometry are also
presented in this work.
2002 Elsevier Science Ltd. All rights reserved.
0045-7949/02/$ - see front matter 2002 Elsevier Science Ltd. All rights reserved.
PII: S 0 0 4 5 - 7 9 4 9 ( 0 2 ) 0 0 1 0 5 - 0
1400 R. Ribo et al. / Computers and Structures 80 (2002) 1399–1408
With the help of these algorithms, it is possible to the list of knots that contains the value of u ðu 2 ½uI ;
automate the process of importing geometry from CAD uIþ1 Þ. Next, the following recursive expression can be
and mesh on it while maintaining an acceptable level applied:
of quality criteria. This process should be performed ~k1 k k1~k1
~ ð1 aki Þxk1
i1 Pi1 ðuÞ þ ai xi Pi ðuÞ
without the need of manual intervention. Pik ðuÞ ¼ k
To understand better what follows, a short descrip- xi
tion of the NURBS lines and surfaces entities is given. A k ¼ 1; . . . ; n r
ð1Þ
deeper description can be found in [2,12]. i ¼ I n þ k þ 1; . . . ; I þ 1
with 0
~ ~
Pi ðuÞ ¼ Pi
x0 ¼ x
i i
1.1. NURBS lines
u ui1
A NURBS line is a geometrical entity, described as a aki ¼
uiþnk ui1
parametric line in the 3D space, that is defined with a set
of knots, a set of control points, and a set of weights if it
xki ¼ ð1 aki Þxk1 k k1
i1 þ ai xi
is rational (Fig. 1).
The knots are a list of non-decreasing numbers then:
u0 ; . . . ; uLþn that begin in the lower range of the pa-
rameter space (usually 0.0) and finish in the high range sðuÞ ¼ ~
~ nr
PIþ1 ðuÞ
of it (usually 1.0). A knot has multiplicity r if its value is
repeated r times inside the list of knots. The initial and
1.2. NURBS surfaces
the end knots must have multiplicity r ¼ n þ 1, where n
is the degree of the curve.
A NURBS surface is the extension of the NURBS
The control points ~ P1 ; . . . ; ~
PL are a list of points in the
line to one additional dimension in the parametric space.
3D space that are part of the NURBS definition. The
Most of the properties of the NURBS curves applies
line will interpolate the first and the last point and will
here. There is a list of knots for every parametric direc-
smoothly approximate the other points.
tion u and v. The control points are a set of Pij points
The weights x1 ; . . . ; xL are a set of non-negative real
with i 2 ½1; . . . ; Lu and j 2 ½1; . . . ; Lv (Fig. 2).
numbers, one for every control point. They allow the
The evaluation of the surface can be made in different
shape of the curve to change and also to have an exact
ways:
representation of conic curves like circles or ellipses.
The number of knots, Nk must be equal to Nk ¼ Np þ
• To evaluate first the NURBS curve corresponding to
n þ 1, where Np is the number of control points.
one of the parametric directions u (maintaining v
The evaluation of a NURBS curve for a given value
constant) and obtain a NURBS line. Then, to evalu-
of the parameter u can be done in a recursive manner.
ate the resulting NURBS curve in the second direc-
First, it is necessary to identify the interval ½uI ; uIþ1 in
tion v.
Fig. 1. Example of a quadratic NURBS line with four control Fig. 2. NURBS surface with the corresponding control poly-
points evaluated for a given value of u. gon.
R. Ribo et al. / Computers and Structures 80 (2002) 1399–1408 1401
• Recursive evaluation: similar to the expression (1) • Two curves are collapsed if they share their end
given for the NURBS curve. points and the maximum distance between them is
• Evaluation by means of the b-spline base. This tech- smaller than . In addition, they are also collapsed
nique is also usable for curves. if a curve belongs to the interior of another one. This
last property means that, in addition to the first crite-
The evaluation with the b-spline base is done by de- rion, its end points ~
Pi accomplish
fining a base of b-splines, Ni , as a recursive function in
the following recursive way: distð~
Pi ; LÞ <
1 if ui1 6 u < ui
Ni0 ðuÞ ¼ where ~LðtÞ is the second curve. In the latter case, the
0 if not:
final result of the collapse operation is not a single
n u ui1 uiþn u n1
Ni ðuÞ ¼ Nin1 ðuÞ þ N ðuÞ curve but a group of curves as shown in Fig. 3.
uin1 ui1 uiþn ui iþ1
• Two patch surfaces are collapsed if they share their
Then, the following expression is applied: boundary curves and a similar maximum distance
P P criterion is accomplished.
~ m n
i j xij Pij Ni ðuÞNj ðvÞ • Two volumes are considered as equivalent if they
sðu; vÞ ¼ P P
~ ð2Þ
i
m n
j xij Ni ðuÞNj ðvÞ
share their boundary surfaces.
~
P1 ; . . . ; ~
PL ð4Þ
x1 ; . . . ; xL ð5Þ
and the list of control points (4) and weights (5) to:
P1 ; . . . ; ~
~ Piþ1 ; ~
Piþpþ2 ; . . . ; ~
PL ð6Þ
Note that the new list will have L p control points and
that the resulting curve will be an approximation to the
original one, being the original one a mathematically
incorrect representation of a curve.
Fig. 4. Saving of elements when unnecessary details are elimi-
nated.
4. Reparametrization
new knots are inserted with the same value of the already
existing knots into (9) until they all have a multiplicity of
the same order as the curve
k0 ; . . . ; k0 ; . . . ; ki ; . . . ; ki ; . . . ; kLþn ; . . . ; kLþn ð10Þ
|fflfflfflfflffl{zfflfflfflfflffl} |fflfflfflfflffl{zfflfflfflfflffl} |fflfflfflfflfflfflfflfflfflffl{zfflfflfflfflfflfflfflfflfflffl}
nþ1 nþ1 nþ1
example of this type of conversion. In this case, the The new list will be:
discrepancy between both curves is high due to a point
akA;0 ; . . . ; akA;LAþn ; akA;LAþn þ bkB;0 ; . . . ; akA;LAþn
with C 0 continuity.
þ bkB;LBþn ð16Þ
6. Union of curves lA lB
a¼ b¼ ð17Þ
lA þ lB lA þ lB
It is possible to convert a set of connected NURBS
curves into a single curve. Normally, it is advantageous where lA and lB in (17) are the respective lengths of the
to keep the number of curves as small as possible be- curves.
cause it can make the mesh generation task easier.
Typically, the presence of extremely small segment lines
can increase the complexity of the mesh generation. 7. Subdivision of curves
The criteria for joining different curves are the fol-
lowing: Some of the algorithms related with the mesh gen-
eration task solve small non-linear systems of equations
1. Enough degree of continuity between the different that involve the derivatives of the analytical expression
segments must exist. Typically, a C 1 continuity is con- defining the curves. The presence of strong changes of
sidered as enough. these derivatives inside the curve can produce conver-
2. None of the segments can support any individual sur- gence difficulties in the solution of the mentioned sys-
face patch. The set of segments to be joined must be- tems. Due to this reason, it is very convenient to
long to the boundaries of the same surface patches. maintain a C 1 continuity over the whole curve (in
practice, small angle discontinuities can also be al-
Fig. 7 shows different examples of these situations. lowed). Hence, it is convenient to subdivide (cut) the
Before the union can proceed, the different curves original curves at points not satisfying the required
must have the same degree. Hence, the degree of all the continuity.
segments will be increased until they reach the maximum This subdivision is made through the insertion of
value n. Next, the different control points will be joined additional knots at the required cutting points until a
and a new list of knots will be computed starting from multiplicity equal to the order of the curve is reached.
the original ones in the following way: The new curves will be:
kA;0 ; . . . ; kA;LAþn curve A ð14Þ
k0 ; . . . ; ki ; . . . ; ki ; . . . ; kLþn
|fflfflfflfflffl{zfflfflfflfflffl}
kB;0 ; . . . ; kB;LBþn curve B ð15Þ nþ1
Fig. 7. Different criteria for accepting (or not) the union of curves.
R. Ribo et al. / Computers and Structures 80 (2002) 1399–1408 1405
k0 ki where ~
S ðu; vÞ is the parametric surface. If the curve lays
;...; curve A
ki ki on u ¼ 0 or 1 the corresponding similar expressions will
be used.
kiþnþ1 kiþnþ1 kLþn kiþnþ1 An additional convenient check consists of comput-
;...; curve B
kLþn ki kLþn ki ing the normal vector to the surface in its center and
to compute the approximated normal vector to the
The control points will be simply spread depending on boundary curves. The approximate normal vector can
the number of knots corresponding to each curve. be computed as:
X
~L ¼
N Lðti Þ ~
~ C ~Lðti þ Dti Þ ~
C ð20Þ
8. Reorientation of the boundary of the surfaces i
Fig. 8. Criterion of signs and orientations of the trimming lines Fig. 9. Collapse of a too small angle. The collapse will be ac-
of a trimmed surface. cepted if L is bigger than a minimum value.
1406 R. Ribo et al. / Computers and Structures 80 (2002) 1399–1408
Fig. 10. Geometry of a set of casting teeth for construction Fig. 11. Fotorrealistic render of the previous geometry.
machines. This set is the one used in the casting process.
algorithms for the preparation of different geometries in model of a casting set of teeth. The number of surface
order to be meshed. Typically, the geometry has been patches used for the geometry definition is around 400.
defined using a CAD system and the corresponding in- In this particular case, before the mesh generation it has
formation has been introduced into GiD using standard been necessary to correct the geometry in order to create
CAD files (IGES, VDA, . . .). In all cases, the use of the a closed volume (without gaps). The final obtained mesh
presented algorithms has carried out the improvements/ has around 40,000 elements.
reparations needed to allow meshing of the geometry
without the necessity of any additional operation. 10.2. Tarazona cathedral
10.1. Geometry of a set of casting teeth Figs. 12 and 13 represent a structural analysis model
with a non-linear damage material model of the Tara-
This example (see Figs. 10 and 11), corresponds with zona cathedral. In this case, it has been necessary to
the generation of a finite element mesh over the solid correct many of the surfaces used to describe the fine
11. Conclusions
References