Capítulo 2. Moda, función y consumo
2.2 El diseñador como traductor
2.5.1 Construction of signed distance functions
When one has to implement a representation of interfaces in practice, neither the explicit nor the implicit representation stores the exact position of the points on the interface. Instead, we compute the exact position of a set of points on the curve or on the surface and the remaining points are interpolated.
Hence, with an explicit representation, the interfaces, curves in 2D or surfaces in 3D, are approximated, i.e. discretized into a finite set of points. Depending on the accuracy re- quired, a curve c = x(s) defined on an interval [s0,sn] is then divided into different intervals
s0 < s1 < s2 < s3 < . . . < sn which are not necessarily equispaced in the physical space. For
each values of si, the corresponding position of the point is stored into an vector. Obviously,
as the number of intervals is increased the resolution of the curve is improved. Between these points, the curve is interpolated to determine the position of any additional point lying in the interval [si, si+1]. In practice, the most simple interpolation scheme consists in representing the
interval [si, si+1] as a line segment or with a spline interpolation.
With an implicit representation, it is not straightforward to determine a priori the positions of a finite set of points on the interface. Instead, we know the values of the implicit function φ on a set of points and an interpolation scheme is needed to obtain the values on the other points. Generally, when using the level set method, the computational domain is discretized on a uniform Cartesian grid to ease the mesh generation and the computation of geometric quantities such as derivatives or curvature. Then, the value of the Level Set function is computed at each grid point and interpolated on the whole grid. Different types of interpolation can be used, for instance a Lagrange Polynomial interpolation [186] (which is the most common method) or a Radial Basis Function interpolation [41]. To obtain the position of the interface, the isocontour φ = 0 requires to be interpolated from the grid points values, which is a rather standard pro- cedure that can be realized by contouring algorithm. With an explicit representation we know the exact position of some points on the interface (the sampled points). But with an implicit formulation it is possible that we do not know the position of any point exactly. In fact, if no grid point coincide exactly to a point on the interface, no grid point supports a φ value equal to 0. Therefore all the points of the interface are interpolated and it may happen that no point is exact. In practice, as an interface represented by an analytical expression is too restrictive to model complex geometries, the Level Set φ is usually constructed as the signed distance to the boundary Γ and discretized on a fixed mesh. The sign of this function is then different on each side of the interfaceΓ and is determined with the normal n(xΓ) to the interface or with a simple counter-
from the interface description, we can express the signed distance function as: φ(x, t) = sign(n· (x − xΓ))· min
xΓ∈Γ
kx − xΓk ∀x ∈ Ω
where xΓ is the closest point from x to the interface (i.e. the projection of x on Γ). After
discretization on a grid, the points x are the nodes of the grid. If the Level Set description is used to represent a closed geometrical object such as a mechanical structure, the iso-zero contour corresponds to the boundary of the structure. The sign is generally chosen to be negative ifx is inside and positive outside the interface (see Fig. 2.13). When considering the inside as the neg- ative, the normal to the interface computed with N = k∇φk∇φ is automatically oriented outward which is consistent with a geometrical CAD representation where the surface surrounding a 3D object is usually oriented outward.
When the Level Set is constructed from a NURBS curve, the Level Set can be computed by dividing the curve into small segments and by computing the distance between the mesh nodes and these segments. However, to limit the number of operations and the computational time, each segment is stored into an octree structure (using ANN library [120]) in order to compute the distance from a given mesh node to the closest points on the interface. For NURBS surfaces, the same procedure is applied by subdividing the surface into patches.
2.5.2 Interpolation of iso-zero Level Set on an edge
When the Level Set is described with an analytical function, the generation of the corresponding Level Set is straightforward as in the example of the unit circle. However, as the Level Set φ can be far from a signed distance function, the determination of the iso-zero from the interpolated Level Set φh can suffers from inaccuracies as the slope of the Level Set is not constant anymore. As mentioned in section 2.5.3, the Level Set function φ is interpolated with classical finite element shape functions. Hence, along an element edge the Level Set function is interpolated from the nodal Level Set values φhi.
f p0 f2 f1 fh p1
Figure 2.10: Interpolation of the Level Set and computation ofΓ with secant method
As depicted in the Figure 2.10, an estimation of the iso-zero Level Set position p is obtained using the secant method [117] corresponding to a linesearch with an incertitude interval:
p = p1+ t(p2− p1) t = −φ h(p 1) φh(p 2)− φh(p1)
where φh(p1) and φh(p2) are the Level Set value at node 1 and 2 respectively. The position of
p is always interpolated linearly independently of the shape function order used to interpolate φ. From this first estimation of the iso-zero position p, the corresponding Level Set value is obtained φh(p) and the procedure is repeated until
φh(p)
< by replacing φ(p1) by φh(p) if φ(p2)φh(p)<0 (or φ(p2) by φh(p) if φ(p1)φh(p)<0). Moreover, the evaluation of φh(p) is obtained
from interpolation of the discretized function φh and no more call to the Level Set function φ should be realized unless problems can be encountered when evaluating the sign of the Level Set.
2.5.3 Interpolation of the Level Set on a FEM grid
Inside the elements, the Level Set function is generally approximated on the mesh using the finite elements shape functions as:
φh(x) =XNi(x)φi (2.5)
where Ni are the FEM shape functions and φi the nodal values of the Level Set at node i. Hence, the Level Set values are only known exactly at the nodes and interpolated elsewhere in the mesh. As a consequence, the accuracy of the Level Set approximation depends on the order of the shape function used in (2.5) for Ni. The figures 2.11 illustrates the interpolation of a Level Set function φ of order 3 defined as:
φ(x) = y3+ x3−1 2
with 3 different orders of approximation (bilinear, biquadratic and bicubic) on a mesh composed of 4 quadrangular elements. 0 0.5 1 0 0.5 1 (a) Order 1 0 0.5 1 0 0.5 1 (b) Order 2 0 0.5 1 0 0.5 1 (c) Order 3
Figure 2.11: Interpolation of the Level Set on 4 elements
The Figure 2.12 illustrates the sliced mesh obtained with the corresponding mesh.
To obtain a better geometrical accuracy and a better Level Set representation while keeping a low order FEM shape function during problem resolution, one can of course use a non conforming adaptive mesh refinement, a quadtree/octree submesh, or simply define new nodes on FEM elements to define use different approximation orders for the geometrical representation and physical fields.
(a) Degree 1 (b) Degree 2 (c) Degree 3
Figure 2.12: Mesh slicing with 3 different approximation orders
2.5.4 Geometrical accuracy
From equation (2.5), one can notice that with linear shape functions on a triangular mesh, the interface is linear inside the elements and the interpolation of the Level Set is piecewise linear on the mesh. In Figure 2.13, one can see that a rather coarse mesh can already gives a good resolution / representation of a unit circle using a linear interpolation within each element.
(a) Representation of Level Set function
-0.102 0.0380 0.178 0.317 0.457 -0.241
(b) Isocontour of the Level Set function and interface in black dashed
Figure 2.13: Geometric representation of a circular interface on a first degree triangular mesh
However, the resolution is not always so good. For instance the Level Set description fails at representing accurately complex geometries containing corners or small details compared to the mesh size. The Level Set description tends to erase or smooth out these details when using linear interpolation inside an element as depicted in Fig. 2.14.
The Figure 2.14 represents a square interface represented by an implicit function discretized on a triangular mesh. In Figure 2.14 (a), the representation is not able to represent sharp corners as they are smeared out. The reason is that the Level Set is not able to capture a corner in the most
(a) Standard mesh (b) Adapted mesh (c) Points exactly located at corners
Figure 2.14: Geometric representation of corners
general case because it can not represent a kink inside an element but only a line, when using a linear interpolation, or a curve, with higher order approximation. Figure 2.14 (b) illustrates that when the mesh gets more refined near the corners, the representation tends to be more accurate but still fails at representing the corners. Finally, Figure 2.14 (c) illustrates that it is possible to obtain an accurate representation of a corner without any refinement if a grid point is placed exactly at the corner position.
The quality of the representation depends on the curve characteristics and on the mesh densities. Therefore, when the boundary is made of non smooth curves, the quality of the mesh is very important to obtain a satisfying geometrical representation of the model. Both the geometrical and numerical errors from the model are reduced as the mesh gets refined. As example, we illustrate the effect of the mesh refinement for the representation of a quarter circle on a plate (Fig. 2.15).
(a) Coarse mesh (b) Locally adapted mesh size map
Figure 2.15: Effect of the mesh refinement on the quality of the Level Set representation
The Figure 2.15 (a) presents a rather coarse mesh and leads to a highly kinked geometrical boundary whereas the Figure 2.15 (b) has a more accurate geometrical representation of the
circle. The refinement is only needed for the elements located close to the boundary and, the mesh conformity is not necessary. To obtain the Figure 2.15 (b), we have adapted the charac- teristic mesh length of the mesher only in the vicinity of the iso-zero Level Set. The quality of the representation depends on the curve characteristics and on the mesh density. Both the geometrical and numerical errors from the model are reduced as the mesh gets refined.
When the Level Set is defined analytically, as in Figure 2.15, the definition of the map of the characteristic mesh length is easy to obtain and can be defined without an initial mesh. However, in practice, we do not know the position or the aspect of the Level Set and the mesh refinement procedure should be iterative. Thus, a first initial coarse mesh should be created in order to be able to interpolate the Level Set and then compute its geometric quantities to determine the regions where the element densities should be increased and where the mesh should be refined. From Figure 2.13, we can clearly see that the geometric quantity to take into account is the radius of curvature. As the interface is generally considered as a straight line or plane inside the elements, the size of the elements should be sufficiently small to obtain a given geometrical accuracy. In case of nearly linear or weakly curved interface no mesh refinement is needed. How- ever, a global mesh refinement is wasteful as only a few elements located near the zero level set interface need to be refined. Therefore, in addition to the curvature criteria, it is worthwhile to limit the refinement in the vicinity of the elements that are close to the interface.
In Ref. [113], Moës et al. have presented a simple criterion to adapt the mesh. The strategy consists in reducing the characteristic element size lc at the proximity of the iso-zero Level
Set where the radius of curvature ρ of the interface is small until the following conditions are stratified: lc> αρ ¯φ < βltot (2.6) ¯φ
is the level set value at the element barycenter, ltot is the side length of the basic cell and the dimensionless parameters α and β govern the extent and the level of refinement. For elements presenting a lcvalue higher than the radius of curvature of the Level Set and a centroidal Level
Set value smaller than a given threshold, the elements are tagged for subdivision. Starting from an initial coarse mesh, several refinements are usually required to meet the condition (2.6). Finally, as meshes get more refined, the evaluation of the curvature ρ becomes more accurate and the process ends when no element is tagged.