NEF: A mesher based on OpenCascade C.A.D. software |

Alain Perronnet Laboratoire Jacques-Louis Lions U.P.M.C. Paris |

Version Française

- A better accuracy of the solution is obtained if the mesh is adapted .

- To adapt a mesh, it is necessary, at any time

. to know the location of points: inside or outside a volume, on a face, on an edge or a special point;

. to move points along edges, faces, volumes.

- Today, the majority of objects are designed from Computed Aided Design (CAD) softwares

For each of them, an internal representation of objects has been chosen.

- An efficient mesh adaptation requires a fast access to data structure and functions on the objects.

- An optimal choice is obtained if the mesher and the CAD software have the same language.

- Generally, the CAD softwares do not permit this access by a compiled language.

- But, it exists at least one exception OpenCascade : a C++ opensource C.A.D. software downloadable from the Web (cf [1])

Prerequisites:

If you have a C++ or Fortran mesher

- to subdivide a curve into segments;

- to triangulate a plane surface;

- to decompose a volume into tetrahedra;

and if you are not afraid by

- 14223 C++ include files;

- 515 directories of C++ source files;

- a tar.gz file of 160 573 067 bytes; (version 5.0 may 2003)

then, you can construct a MESHER based on OpenCascade with C++ direct calls to C.A.D. functions

The BOUNDARY REPRESENTATION (BRep) of an object of OpenCascade:

- A COMPSOLID is a set of SOLIDS connected by their FACES;

- A SOLID (cylinder, cone, sphere, torus, ...) is a volume limited by SHELLS;

- A SHELL is a set of FACES connected by their EDGES;

- A FACE is a MAP defined from a domain included in a rectangle of UV parameters upon the 3d-space (cylinder: [0,2 Pi] x [0,H] -> R3, cone, sphere, torus, Bezier surface, NURBS surface, ... );

- The boundary of a FACE is composed of WIRES;

- A WIRE is a set of connected EDGES;

- An EDGE is a MAP defined from an interval of the U parameter upon the 3d-space (Bezier's curve: [0,1] -> R3, NURBS curve, ... );

- A VERTEX is a limit of an EDGE.

This Boundary Representation induces a structure of GRAPH between the different SHAPES (CompSolid, Solid, Shell, Face, Wire, Edge, Vertex).

How the mesh is made in NEF?

OpenCascade permits to explore the different SHAPES of the COMPSOLID

for each EDGE of the COMPSOLID

The U-interval of the EDGE is subdivided into segments with respect to the edge length and deflection in 3d-space.

By the map, the segments of the U-interval give the segments in 3d-space.

==> Creation of U-mesh and 3d-mesh for each EDGE

for each FACE of the COMPSOLID

for each WIRE of the FACE

for each EDGE of the WIRE

The U-mesh of the EDGE is assembled after scaling in the UV-domain to constitute the WIRE

The UV-surface, limited by the segmented Wires is triangulated with respect to the edge length and deflection in 3d-space and the triangulation is mapped upon 3d-space.

for each SOLID of the COMPSOLID

for each SHELL of the SOLID

for each FACE of the SHELL

the 3d-mesh of the FACE is assembled to form the boundary of the SOLID

Here, the triangulation, boundary of the COMPSOLID, is done.

The volumes, limited by this triangulation, are tetrahedrized.

Now, the mesh can be saved on a file.

NEF's algorithms for the meshing:

For an EDGE, the SEGMENTATION of the U-interval is done by dichotomy on U to obtain the ideal length of segments in 3d-space, and is modified if the deflection between the segment and the curve is too great.

For a FACE, the TRIANGULATION of the UV-domain is done by subdivision of a QUAD-TREE of REGULAR TRIANGLES, homogeneization, swapping of diagonals from Delaunay's criterion, barycentering of neighbouring vertices, moving, adding or removing vertices ... (cf [2])

For a COMPSOLID, the TETRAHEDRIZATION of the VOLUMES limited by the triangulation of its boundary is done by a Delaunay's technic from the vertices of a 5-14 TREE of REGULAR OCTAHEDRA and TETRAHEDRA, homogeneization, swapping of edges-faces (mt->2mt-4), barycentering of neighbouring vertices, moving, adding or removing vertices ... (cf [3])

The USER may enter as a CONSTANT or a FUNCTION of (X,Y,Z)

- the MAXIMUM LENGTH of segments of EDGES or of edges of triangles of FACES

- the MAXIMUM DEFLECTION between the segment and the EDGE or between the plane defined by the 3 vertices of a triangle and the FACE

Example: If aretemax=0 the following user's function is active:

DefFunc areteideale( x, y, z );

DefVar d; d=(x**2+y**2+(z-12)**2)/36;

if d<1 then

areteideale=0.3*(1-d)+d; {interpolation from 0.3 to 1 in a sphere of radius 6}

else

areteideale=1.0;

endif;

EndFunc;

In order to facilitate the USER's work, a USER's COORDINATE SYSTEM and LAYERS are available.

Demonstration: Construction of a mesh of a cardan shaft

2 points and a radius => the lower cylinder

2 points and a radius => the upper cylinder

2 points min max => the box

the upper cylinder minus the box

the fusion with the lower cylinder

2 points and a radius => the lower cylinder of Z-axis

the object minus the cylinder of Z-axis

2 points and a radius => the upper cylinder of Y-axis

the cardan minus the cylinder of Y-axis

2 points and 2 radius => the cone

the intersection of the cardan and the cone gives the upper chamfer

1 point and 2 radius => the torus

the object minus the torus

the cardan after tetrahedrization with max edge length=1

the cardan with max edge length=0.5

the cardan with max edge length=1 and max deflection=0.01

the cardan with max edge length=0 and the function

DefFunc areteideale(x,y,z);

if abs(z-12)<2 then

areteideale = 0.3;

else

areteideale = 1;

endif;

EndFunc;

the cardan with max edge length=0 and the function

DefFunc areteideale(x,y,z);

if abs(x)<2 ou abs(z-12)<2 then

areteideale = 0.3;

else

areteideale = 1;

endif;

EndFunc;

the cardan with max edge length=0 and the function

DefFunc areteideale(x,y,z);

DefVar d; d=(x**2+y**2+(z-12)**2)/36;

if d<1 then

areteideale = 0.3;

else

areteideale = 1;

endif;

EndFunc;

Bibliography:

[1] http ://www.opencascade.org The Web server of the OpenCascade software distribution

[2] A. Perronnet, Triangulation par arbre-4 de triangles équilatéraux et maximisation de la qualité, Laboratoire Jacques-Louis Lions Paris, Rapport R92015

[3] A. Perronnet, Tetrahedrization by the 5-14 OTT tree technic and the Delaunay's criterion, VIII Conference on Finite Elements in Fluids, Barcelona, sept. 1993

Last update day: July 15th 2004