finite element mesh generation for subsurface simulation
TRANSCRIPT
ORIGINAL ARTICLE
Finite element mesh generation for subsurface simulation models
Antonio Carlos de Oliveira Miranda • William Wagner Matos Lira •
Ricardo Cavalcanti Marques • Andre Maues Brabo Pereira •
Joaquim B. Cavalcante-Neto • Luiz Fernando Martha
Received: 14 March 2013 / Accepted: 7 January 2014 / Published online: 19 January 2014
� Springer-Verlag London 2014
Abstract This paper introduces a methodology for cre-
ating geometrically consistent subsurface simulation mod-
els, and subsequently tetrahedral finite element (FE)
meshes, from geometric entities generated in gOcad
software. Subsurface simulation models have an intrinsic
heterogeneous characteristic due to the different geome-
chanics properties of each geological layer. This type of
modeling should represent geometry of natural objects,
such as geological horizons and faults, which have faceted
representations. In addition, in subsurface simulation
modeling, lower-dimension degenerated parts, such as
dangling surfaces, should be represented. These require-
ments pose complex modeling problems, which, in general,
are not treated by a generic geometric modeler. Therefore,
this paper describes four important modeling capabilities
that are implemented in a subsurface simulation modeler:
surface re-triangulation, surface intersection, automatic
volume recognition, and tetrahedral mesh generation.
Surface re-triangulation is used for regenerating the
underlying geometric support of surfaces imported from
gOcad and of surface patches resulting from intersection.
The same re-triangulation algorithm is used for generating
FE surface meshes. The proposed modeling methodology
combines, with some adaptation, meshing algorithms pre-
viously published by the authors. Two novel techniques are
presented, the first for surface intersection and the second
for automatic volume recognition. The main contribution
of the present work is the integration of such techniques
through a methodology for the solution of mesh generation
problems in subsurface simulation modeling. An example
illustrates the capabilities of the proposed methodology.
Shape quality of generated triangular surface and tetrahe-
dral meshes, as well as the efficiency of the 3D mesh
generator, is demonstrated by means of this example.
Keywords Geometric modeling � Subsurface modeling �Mesh generation � Surface intersection � Finite elements
A. C. de Oliveira Miranda (&)
Department of Civil and Environmental Engineering, University
of Brasılia, SG-12 Building, Darcy Ribeiro Campus, Brasilia,
DF 70910-900, Brazil
e-mail: [email protected]
W. W. M. Lira
Laboratory of Scientific Computing and Visualization-LCCV,
Technology Center, Federal University of Alagoas, Maceio,
AL 57072-970, Brazil
e-mail: [email protected]
R. C. Marques � L. F. Martha
Department of Civil Engineering and Tecgraf - Technical-
Scientific Software Development Institute, Pontifical Catholic
University of Rio de Janeiro, Rua Marques de Sao Vicente 225,
Rio de Janeiro 22451-900, Brazil
e-mail: [email protected]
L. F. Martha
e-mail: [email protected]
A. M. B. Pereira
Engineering School, Fluminense Federal University, Rua Passo
da Patria 156, Niteroi 24210-240, Brazil
e-mail: [email protected]
J. B. Cavalcante-Neto
Department of Computing, Federal University of Ceara, Campus
do Pici, Bloco 910, Fortaleza 60455-760, Brazil
e-mail: [email protected]
123
Engineering with Computers (2015) 31:305–324
DOI 10.1007/s00366-014-0352-3
1 Introduction
Ultra-deepwater rock drilling for oil exploration has been
demanding the research and development of new technol-
ogies, including new approaches to computational three-
dimensional (3D) subsurface simulation modeling. This
work describes a methodology for creating finite element
(FE) models of heterogeneous objects, including degener-
ated parts. Examples of these types of objects occur in
subsurface models of hydrocarbonate reservoir simulation,
in which the horizon (limiting) surfaces of the several
geological layers are considered, as well as fault (discon-
tinuity) surfaces and drilled well curves. These models
have an intrinsic heterogeneous characteristic due to the
different geomechanics properties of each geological layer.
In addition, this type of model considers lower-dimension
degenerated parts, such as a fault surface dangling inside a
geological layer or a well bore represented by a curve.
One of the main challenges in this type of modeling is
that it should represent natural geometric entities, such as
geological horizons and faults. Usually, the geometry of
man-made entities is described in a model through math-
ematical parametric representation of curves and surfaces.
On the other hand, the geometry of nature entities has a
faceted representation, such as polygonal curves or poly-
hedral surfaces.
A 3D subsurface simulation model needs a consistent
topological representation composed by vertices, curves,
surfaces, and regions, as well as associated geometric
information (coordinates of the vertices and mathematical
representation of the curves). Differently from classical
CAD/CAE, a surface in this modeling environment has a
discrete faceted representation: it is composed by a set of
triangles. In addition, the geometric model may contain
several regions. In this environment, the attributes of the
simulation, such as material properties, loads, and dis-
placement restrictions, are associated to geometric entities.
In this framework, mesh entities of a FE model (nodes and
elements) automatically receive the attributes of their
corresponding geometric entities. With this approach, it is
possible to generate new FE meshes without losing
attributes.
It is important to make a distinction between an
underlying faceted geometric representation of a surface
and a surface represented by a finite element mesh. In the
present context, geometric surfaces have discrete faceted
representations. On top of a geometric surface, a FE mesh
may be generated with an arbitrary refinement strategy
usually geared for numerical analysis purposes. Since FE
meshes of adjacent surfaces have to match, the underlying
geometric faceted representations of these surfaces must be
consistent, at least geometrically. In other words, to gen-
erate consistent surface and volume finite element models,
the underlying surface faceted representations have to
match geometrically, but not necessarily topologically. On
the other hand, FE meshes of adjacent surfaces have to
match perfectly, node by node, at the intersection curves.
These FE modeling constraints impose significant topo-
logical and geometrical requirements on a subsurface
simulation modeler for FE numerical analysis.
Subsurface geological modelers, such as gOcad [1],
usually do not achieve these minimum requirements for FE
simulation modeling. In the gOcad modeling environment
proposed by Mallet [2], natural objects (or geological
entities) also have a discrete faceted representation, in
which any object is represented by a graph similar to sur-
face and volumetric FE meshes. However, this discrete
representation is used solely for geometric representation
and is not appropriate for numerical analyses such as in FE
simulations. Considered a geological modeler, gOcad
focuses on the following areas:
1. Structural geology, such as in balanced unfolding,
discrete fracture networks, and fault characterization
2. 3D subsurface modeling, such as for constructing
geological surfaces, modeling geological structures,
and modeling geological volumes
3. Reservoir engineering, such as in petrophysical
modeling, reservoir uncertainty, discrete fracture net-
works, and streamline simulation
4. Geophysics, such as in seismic interpretation, velocity
model building, ray tracing through various media
representations, and visualization of 3D seismic attri-
butes and
5. Sedimentary geology, such as in applications for
sequence stratigraphy and channel modeling.
Because gOcad was not originally designed for FE
simulations, the proposed modeling and mesh generation
methodology intends to create FE models using gOcad data
files as input. The types of FE analysis envisioned are stress
analysis due to gravity loads of geological layers, pressure
in oil reservoirs, and stability analysis during oil well
drilling, among others.
Some works in the literature address the problem of
generating subsurface simulation models. However, they
do not describe in detail their modeling strategy. Gemmer
et al. [3] present a 3D finite element model that includes
thermomechanical processes in the lithosphere as well as
sedimentation, erosion and eustasy, but without providing
much detail about the modeling process. Wu and Xu [4]
use a framework [5] to model and visualize 3D geological
faults, where a mixed-mesh model provides the spatial
integration between the regular mesh and the irregular
Delaunay triangulation. Martelet et al. [6] model 3D
geometries with surfaces of a segment of the Hercynian
suture zone in the Champtoceaux area of Europe, but they
306 Engineering with Computers (2015) 31:305–324
123
do not describe the 3D model. Lixin [7] classifies 3D
(including pseudo-3D) models for geosciences as three
classes: facial models, volumetric models, and mixed
models. The author also presents a framework for 3D
geoscience modeling and spatial analysis. Wu et al. [8]
propose an architecture to hold geological information
attached to geometric objects (points, lines, polygons,
faces, surfaces, blocks), but without topological entities.
Qu et al. [9] present a method for three-dimensional
computerized modeling of geological objects from sets of
intersected cross sections. Butscher and Huggenberger [10]
present a 3D geological model of a hydrological model
based on a set of subsurface surfaces. Kaufmann and
Martin [11] propose a methodology developed to process
geological information that includes gOcad software,
ArcGIS (Geographic Information System) software, and a
database. Zanchi et al. [12] present an approach that is
similar to the previous work. Ming et al. [13] summarize
related works and some software used for geological
modeling; in addition, they propose a geological modeling
system called GSIS (Geological Spatial Information Sys-
tem). Xu et al. [14] propose a methodology to build com-
plex geological models for rock engineering projects that
require numerical stress analysis using tetrahedral elements
and considering mesh refinement and optimization. In
summary, most of the cited works resort to mixed model-
ing, i.e., they combine different types of representations.
However, there are few details regarding topological
description of the published models. The present work also
uses mixed modeling, as well as a topological representa-
tion of each geometric entity. Explicit topological repre-
sentation is essential to allow efficient regeneration of
curve and surface geometric descriptions, simplifying the
modeling process.
The aim of this paper is to present a methodology that
involves the integration of various technologies for sub-
surface simulation modeling. The methodology consists of
several steps of geometric modeling and mesh generation,
as shown in Fig. 1. Initially, surfaces from gOcad, com-
posed of arbitrary triangulations, are imported. Each set of
connected triangles is interpreted as the underlying geo-
metric support of a topological surface. This way, curves
are automatically created from the input surface bound-
aries. In addition, to improve shape quality of the imported
triangulations, an optional re-triangulation can be per-
formed using a surface mesh generation algorithm [15].
Although gOcad provides surface intersection tools, the
proposed methodology uses a more robust intersection
algorithm, which is achieved with exact arithmetic tech-
nology. In addition, new surfaces may be generated using
existing curves and curves created by surface intersections.
A subsequent step is the generation of triangular FE
meshes on the model surfaces. The creation of consistent
FE volume mesh for analysis requires closed volumes.
Therefore, an algorithm to automatically detect all volu-
metric regions in the subsurface model is also required.
Finally, tetrahedral finite elements are generated in each
region using a procedure that considers the constraints
imposed by internal geologic faults [16]. The proposed
methodology is implemented in a geometric modeler called
MTool3D (Mesh Tool 3D).
The proposed modeling methodology combines, with
some adaptation, several algorithms previously published
by the authors. The main contribution of the present work
is the integration of such techniques through a methodol-
ogy that tries to solve the mesh generation problem, that is,
to construct valid and good quality FE triangular and tet-
rahedral meshes for subsurface simulations. One of the
most important aspects of this methodology is that it may
handle arbitrary geometries of subsurface models. This is
achieved because arbitrary triangulations are used as geo-
metric support of surfaces (underlying faceted geometric
representation) and because these triangulations are
regenerated in an efficient and robust way. In the present
methodology, surface re-triangulation is used to fix input
surface data and to create the geometric support of new
surface patches resulting from surface intersections. It
should be emphasized that this methodology is appropriate
for the specific objective of modeling subsurface objects, in
which a faceted and non-precise geometric representation
is adequate. Of course, re-triangulating an existing trian-
gulated surface with no knowledge on the original surface
analytical description will introduce some geometric
approximations. However, in the specific case of subsur-
face modeling this works well because the existing trian-
gulation is the only available geometric information for a
Fig. 1 Proposed methodology for subsurface simulation modeling
Engineering with Computers (2015) 31:305–324 307
123
surface, which is in general not precise, and the algorithm
approximately preserves areas with high curvatures. In
addition, as reported in previous work, special care is taken
in the current implementation to obtain good performance
in re-triangulation time. Another important aspect of the
proposed methodology is that a triangular FE surface mesh
is independent of the triangulation that constitutes the
geometric support of a surface. Naturally, the FE surface
mesh is generated on top of the surface geometric support,
but not necessarily matching FE nodes with vertices of the
underlying triangulation. As mentioned, the underlying
surface faceted representation is used to represent geome-
try and the FE surface mesh is used to generate consistent
tetrahedral FE models. The same surface discretization
algorithm is used to generate surface geometric support
triangulations and triangular FE surface meshes. Shape
quality of generated triangles is demonstrated in this paper
for subsurface simulation models (Sect. 5). This double
triangulation of surfaces is one of the key features of the
proposed subsurface modeling, which turned out to be very
versatile.
The paper is organized as follows. Section 2 presents the
techniques used to import geological surfaces represented
by triangular meshes and the tools used to model surfaces
in the proposed methodology. These tools are used to treat
surface input data, to generate both surface geometric
support and FE surface mesh, and to create support trian-
gulation of new surface patches resulting from surface
intersections. In addition, this section presents the
description of the algorithm used to intersect surfaces.
Section 3 describes a technique used to automatically
detect volumetric regions in the model, whereas Sect. 4
presents the algorithm used to generate tetrahedral ele-
ments in each region. Finally, Sect. 5 provides examples to
validate the proposed methodology, and Sect. 6 draws
concluding remarks.
2 Surface modeling tools
In the proposed modeling methodology, each surface has a
double triangulation, one for the underlying surface faceted
representation (geometric support) and other for FE surface
mesh. Therefore, a triangulation algorithm may be used to
generate both the geometric support and the FE surface
mesh of a surface. Essentially, this is a generic algorithm
for generating a triangulation on a surface, which has been
published previously by the authors [15]. Here, it will be
generically referred to as the ‘‘surface mesh generation’’
algorithm. Although shape quality of the triangles gener-
ated by this algorithm has been proved in the previous
work, some shape quality measurements are shown here to
demonstrate that this characteristic is maintained in the
current application.
The surface mesh generation algorithm is used in three
different operations: (1) importing arbitrary triangulations
from gOcad; (2) remeshing an existing surface; and (3)
intersecting surfaces. These three modeling operations are
described in the following subsections. In the first and third
operations, the algorithm is used to regenerate the under-
lying surface geometric support triangulation. In the sec-
ond, it is used to generate a FE mesh on a surface that has a
generic underlying geometric representation (in the present
case, this is a faceted triangular representation).
2.1 Importing arbitrary triangulations
In the present context, an arbitrary triangulation is com-
posed by a list of vertices, defined by their coordinates, and
a list of triangles that are defined by vertex incidences.
gOcad adopts a file format called Tsurf for surfaces defined
by a set of triangles, as shown in Fig. 2. In this example,
the key VRTX is used to define four vertices and the key
TRGL to define two triangles that represent the surface.
As can be observed, the Tsurf format is very similar to a
generic FE mesh representation of a surface. This generic
representation does not contain complete information about
the topology of the mesh. This poor information makes it
very difficult to identify topological features of the surface,
such as the list of vertices that are on the boundary of the
surface patches or the list of triangles of disconnected tri-
angular patches. In addition, some vertices may be dis-
connected in space, i.e., they may not be referenced by any
triangle. Moreover, triangulated surfaces generated by
gOcad may contain some errors, such as inverted triangles,
overlapping of triangle, etc. Unfortunately, these errors
exist and usually are related to lack of user knowledge on
the modeling tools of gOcad. In spite of these problems,
these surface representations are sufficient to the types of
applications addressed by gOcad. The quality of the tri-
angulations in gOcad may be improved, but they are still
Fig. 2 Example of a ‘‘Tsurf’’ surface adopted by gOcad
308 Engineering with Computers (2015) 31:305–324
123
not appropriate to FE numeral analysis. Therefore, to
handle adequately arbitrary triangulations imported from
gOcad, first, several verifications to filter any triangulation
inconsistencies are performed. Then, curves and vertices
on the boundaries of the surface patches are automatically
created to set the complete topological information of the
model. Finally, the geometric representations of surfaces
are redefined, using the algorithm described in the next
subsection.
A topological data structure is used here to identify
input triangulation inconsistencies (hanging and isolated
vertices, inverted triangles, overlapping, etc.). Basically,
this data structure should perform the following procedures
in relation to an imported triangulation: (a) identify the
triangular faces adjacent to a given edge; (b) identify the
edges adjacent to a triangular face following a given ori-
entation; (c) identify the next/previous edge from an edge
based on a triangular face; (d) identify edges adjacent to a
vertex; and (e) identify external and internal loops on a
triangulation. Such procedures may be performed by a
complete topological data structure based on edges. In the
literature, the most consolidated edge-based data structures
are the winged-edge [17], the half-edge [18], the radial-
edge [19], and the DCEL [20]. In MTool3D, a simple
topological data structure, similar to DCEL, was developed
with the capability of also representing and identifying
internal loops, disconnected and dangling parts, and other
non-manifold situations, such as more than two triangles
framing into an edge. This way, it is possible to identify
several triangular surface patches that result from a trian-
gulation imported from gOcad.
2.2 Surface mesh generation
In general, triangles on arbitrary triangular meshes
imported from gOcad are not adequate to be used as input
for tetrahedral mesh generation, because in the FE method
the quality of the elements is an important factor as it
directly affects the results. Since the size of elements must
conform to the ones required by a FE analysis, a triangular
FE surface mesh is generated, and often regenerated, on top
of the underlying surface geometric support, as described
below.
This work adopts an algorithm based on an advancing
front strategy [21–26] for generating unstructured trian-
gulations for arbitrarily shaped three-dimensional surfaces
[15]. These generic surfaces can be a triangulated mesh, a
set of points, or an analytical surface such as NURBS. To
be generic, as shown in Fig. 3, the algorithm requires three
functions as input: (1) given the position of a point, the
function returns the desired size of the element; (2) given
the current edge in the boundary contraction algorithm, the
function returns the ideal opposite point that forms a
triangle; and (3) given a point outside the generic surface,
the function returns the position of the closest point on the
surface.
Boundary information is given by a list of nodes (ver-
tices defined by their 3D coordinates and their normal
vectors on the surface), and a list of boundary segments (or
edges) defined by their node connectivity (Fig. 3, top left).
The triangulation algorithm requires this input boundary
information. Therefore, the definition of the boundary
nodes is not a role of the algorithm and, for better results,
the boundary segment sizes should be consistent with local
surface curvatures (i.e., the boundary should be relatively
more refined in areas of relatively high curvature). When
the algorithm is used to generate the underlying support
triangulation of a surface, the discretization of a boundary
curve is generated automatically, even for the curves
resulting from surface intersections. This is a procedure
analogous to the surface re-triangulation that takes into
account local curvature information of the boundary curve.
This procedure is simpler than the surface re-triangulation
and is described in details elsewhere [27]. On the other
hand, for FE surface mesh generation, a surface boundary
curve discretization is specified by the user, as explained in
Sect. 5. In the latter case, the user may specify a curve
subdivision that also takes into account curvatures.
The given boundary edges form the initial front that
advances as the algorithm progresses. At each step of this
meshing procedure, a new triangle is generated for each
base edge of the front. The front advances replacing the
base edge with new triangle edges. Consequently, the
domain area is contracted, possibly into several subareas.
The process stops when all contracted areas result in single
triangles. As the front advances, the generic methods are
called to obtain the size of a new element and the position
of an ideal node (Fig. 3, right). After this process, the mesh
is improved using Laplacian smoothing methods [28]. In
general, the surface mesh smoothing moves nodes to a
position off of the surface. The 3rd input function is
employed after each smoothing procedure as a ‘‘pull back’’
operation, moving the target node back to the geometric
supporting surface.
In this algorithm, the advancing front process is divided
into two phases to ensure the generation of valid triangu-
lations. In the first phase, a geometry-based element gen-
eration is pursued to obtain elements of optimal shapes.
After this phase is exhausted and no more optimal elements
can be generated, a topology-based element generation
takes place, creating valid, but not necessarily well shaped,
elements in the remaining area.
To provide the three input functions of the algorithm, a
background octree [29] and an R-tree structure are used.
The background octree has two main objectives. The first is
to develop local policies used to define the discretization of
Engineering with Computers (2015) 31:305–324 309
123
the surface mesh. The second is to define the sizes of the
triangular elements to be generated during the advancing
front procedure, which is essentially a mechanism to
implement the first generic function required as input to the
surface re-triangulation algorithm. R-trees [30] are tree
data structures similar to B-trees [31], but they are used for
spatial access methods, i.e., for indexing multi-dimensional
information such as 3D coordinates The R-tree structure is
used here to ensure that the algorithm responds fast and to
identify high curvatures in the original surface. These
locations require a smooth element transition.
The creation of the background octree from an input
surface follows five steps: (1) octree initialization based on
given boundary edges; (2) refinement to force maximum
cell size; (3) refinement to provide minimum size disparity
for adjacent cells; (4) refinement to account for surface
curvatures; and (5) refinement to provide minimum size
disparity for adjacent cells (Step 3 is repeated for the
updated octree). The authors have demonstrated [15] that
the background octree tends to provide better control over
the quality of the generated mesh and to decrease the
number of heuristic, clean-up procedures.
The second generic method returns the ideal apex point
that forms a candidate equilateral triangle for a given
current base edge in the boundary contraction algorithm
(Fig. 4a). In addition to the base edge, the height of the
candidate triangle and a ‘‘surface intersection’’ direction
are given, as shown in Fig. 4b.
Two different approaches to this task are described in
the literature. Lohner [32] tries to find a host triangle,
where the ideal node lies, using a neighbor-to-neighbor
search. If this fails, octrees are employed. Finally, if this
approach fails again, a brute force search over all the
surface elements is performed. Schreiner et al. [33] use a
procedure that guarantees that the new triangle sides have
exactly the desired length. This procedure considers the
equation of a sphere, and finds the intersections between
the sphere and the mesh. The approach used in this work is
Fig. 3 Process overview of the
surface mesh algorithm
310 Engineering with Computers (2015) 31:305–324
123
similar to this one, employing the circle equation in a 2D
coordinate system. Fig. 5.
Figure 4 illustrates how to obtain the target apex point in
the present implementation. A local search based on the
auxiliary R-tree structure creates a list of all neighborhood
elements around the middle base edge point. A plane of
intersection, containing the given surface intersection
direction, is created at this point (Fig. 4b). The intersection
of the neighbor triangles with the plane of intersection
forms a polyline. A 2D local coordinate system is created
on the plane of intersection and points of the intercepting
polyline are transformed to this coordinate system. The
ideal node position is computed by intersecting a circle,
whose center is the base edge middle point and radius is the
height of the candidate triangle, with this polyline. Finally,
the point is transformed to the 3D coordinate system.
The third generic method returns the point on the geo-
metric supporting surface that is closest to a given point
near to, but not necessarily on, the surface. During the nodal
smoothing phase, points may be moved off the surface. This
method is used to move the points back to the surface. As
input, the method receives the current node location and its
current normal vector. The implementation of this function
is quite simple. First, a local search based on the auxiliary
R-tree structure creates a list of all neighborhood triangles
of the geometric supporting surface around the given node.
Second, the node is projected on each neighbor triangle
plane, using the given projection direction. Finally, the
selected new node location is the one that lies inside one of
the neighbor triangles. Nonetheless, the node is only moved
to the new position if all neighborhood triangles are valid
after the smoothing operation. This naturally avoids the
generation of inconsistencies such as inverted triangles,
overlapping, mesh folder, etc. Our experience is that, when
surface and boundary curve curvatures are considered in the
triangulation, the node pull-back operation, at least in all the
created models, always generates valid triangles. Usually
the nodal smoothing phase is repeated five times.
The shape quality and time performance of the surface
meshing algorithm have been presented previously [15].
However, Sect. 5 demonstrates the quality of the surface
mesh algorithm in the current application by showing
shape metrics of generated triangles.
Fig. 4 Obtaining ideal node position in second generic method (top view on the left and lateral view on the right)
Fig. 5 Example of remesh
Engineering with Computers (2015) 31:305–324 311
123
2.3 Surface intersection
Surface–Surface intersections were pioneered by Lo [34].
His method seems to be quite accurate and efficient for
manufactured objects, which are initially built from ana-
lytical equations and then transformed into a discrete rep-
resentation. The meshes generated in this process are
extremely regular and smooth which is not the case of
natural objects. Therefore, in geological models, a robust
method for intersecting triangular surfaces is still a
challenge.
In geological models, the spatial coordinates of mesh ver-
tices usually present high orders of magnitude, in contrast with
the (relatively) tiny size of triangles, especially those near
reservoirs. Typically, horizons surfaces have hundreds of
thousands of kilometers of extension, while reservoirs thick-
nesses are around a few dozens of meters. Since a drill could
be stuck in an oil well by a few centimeters, the higher
acceptable precision is in millimeters. The IEEE double
floating-point numbers have precisions of about 16 decimal
digits only, which may lead to some numerical errors in our
model. This numerical imprecision may not only calculate
intersection points erroneously, but, the worst, incorrectly
discard intersection points. As a result, some intersection
points may be misplaced in the final intersection curve(s) and
others may be missing, which causes modeling inconsisten-
cies. To avoid numerical problems, Lo [34] suggests a mesh
refinement in the most critical areas of the surface.
In the latter years, the search for robustness on surfaces
intersection has focused on the problem of intersecting
segments with triangles. Segura and Feito [35] developed a
fast algorithm for testing segment-triangles intersections
which uses signed volumes. However, the intersection
point is calculated using a classical segment-plane inter-
section algorithm. Jimenez et al. [36], using barycentric
coordinates and signed volumes, built an algorithm that
calculates segment-triangle intersection points even faster
than Segura and Feito’s [35]. A curious fact is that Jimenez
et al. [36], in search of robustness, minimized the number
of arithmetic operations to be performed when calculating
the determinants. Besides, they avoided divisions, which
are a relatively slow and imprecise operation, and used a
tolerance range in their comparisons.
To gain robustness, exact arithmetic [37, 38] could be
introduced in those algorithms. However, to fully benefit
from exact arithmetic, a new surface intersection algo-
rithm, based on a robust segment-triangle intersection
method, was developed in this work. Our segment-triangle
algorithm consists primarily of intersecting a segment with
a triangle plane. Although all the algorithms mentioned
before use signed volumes to identify if there is intersec-
tion or not, none of them reuse this information to define
intersection points, what, certainly, would improve the
performance of these algorithms. A signed volume may be
accurately calculated using Shewchuk’s predicate orient3d
[37, 38]. If the points A, B, and C define a plane on 3D
space and D is a point above or below this plane, orient3d
will return the signed volume of the parallelepiped defined
by the points A, B, C, and D. If point D is perfectly
coplanar to A, B, and C, then orient3d will return exactly
zero. The predicate orient3d is defined as:
orient3dðA;B;C;DÞ ¼
Ax Ay Az 1
Bx By Bz 1
Cx Cy Cz 1
Dx Dy Dz 1
���������
���������
¼Ax � Dx Ay � Dy Az � Dz
Bx � Dx By � Dy Bz � Dz
Cx � Dx Cy � Dy Cz � Dz
�������
�������
¼ ðA� DÞ � ðB� DÞ � ðC � DÞ
ð1Þ
In our algorithm, there will be no intersection only if the
signed volumes concerning each segment endpoints are non-
zero and they have the same sign. After being sure that the
segment intersects the triangle plane, we classify the inter-
section case by checking again the signed volumes. If the
endpoint of a segment is the intersection point, then, its
signed volume must be zero. This must happen to none, one
or to both endpoints of the segment. And, once we are using
exact arithmetic, no tolerance is needed. This modification
increases a lot the reliability of our algorithm, since prob-
lems such as parametric values very close to 0 or to 1 will
not occur in the parametric equation of the segment:
P ¼ Rþ t � S� Rð Þ; 0 � t� 1; ð2Þ
where R and S are the segment endpoints, P is a point in
this segment and t is the parametric value associate to point
P. Typical problems related to tolerance tests when using
parametric values are:
• Very small negative values: should it be zero? Or this
intersection point is to be discarded?
• Very small positive values: should it be zero? Or this
intersection point is really not a segment endpoint?
• Slightly greater than 1 value: should it be one? Or this
intersection point is to be discarded?
• Slightly smaller than 1 value: should it be one? Or this
intersection point is really not a segment endpoint?
If there is a unique intersection point between both
segment endpoints, the signed volumes are both non-zero
and have different sign. There is a simple way to calculate
the parametric value of Eq. (2) reusing the signed volumes:
t ¼ orient3dðA;B;C;RÞorient3dðA;B;C; SÞ � orient3dðA;B;C;RÞ ð3Þ
312 Engineering with Computers (2015) 31:305–324
123
Next, all we have to do is make sure that the intersection
point lies inside the triangle borders. There are three
delimiting planes for each triangle intersected, as shown in
Fig. 6. If p is the plane defined by the three vertices of a
triangle, we can define the points.
np ¼ C � Að Þ � B� Að ÞA0 ¼ Aþ np
B0 ¼ Bþ np
ð4Þ
Then, the delimiting planes q, r and s will be defined by
the points.
q :R0 ¼ B
R1 ¼ B0
R2 ¼ C
8
<
:; r :
S0 ¼ C
S1 ¼ A0
S2 ¼ A
8
<
:; s :
T0 ¼ A
T1 ¼ A0
T2 ¼ B
8
<
:ð5Þ
These points are given counterclockwise, so any point D
inside these delimiting planes will satisfy.
orient3dðR0;R1;R2;DÞ� 0
orient3dðS0; S1; S2;DÞ� 0
orient3dðT0; T1; T2;DÞ� 0
8
><
>:
ð6Þ
where orient3d is defined by Eq. (1). Our segment-triangle
intersection algorithm is presented in Fig. 7.
It is assumed that there are no coplanar triangles in
intersection. This situation is easily verified using the
geometric predicates with the exact arithmetic technology.
However, since this situation is undesired for the tetrahe-
dral mesh generation, coplanar triangles in intersection are
Fig. 6 A triangle’s delimiting planes q, r, and s
Fig. 7 Segment-triangle
intersection algorithm
Engineering with Computers (2015) 31:305–324 313
123
avoided. In our modeler, when this is detected, surface
intersection is aborted, prompting the user to treat the
original surfaces in gOcad.
An important issue of surface intersection methods is
how to establish the correct sequence of segment-triangle
intersection points in the final intersection curve(s). Using a
topological data structure (for instance, a half-edge [18]), it
is possible to walk on the mesh by adjacencies. So, if we
walk on the mesh in a smart way, always intersecting the
current triangle with the current edge, we will generate
intersection curve(s) with its points already sorted. This
‘‘smart walk on the mesh’’ will be our search for inter-
secting triangle-edge pairs (or, in short, our search for
intersections), which is very similar to a depth-first search
in a graph.
Our search for intersections is based on two facts:
• Whenever a triangle edge intersects another triangle,
the edges adjacent to this edge may also intersect this
triangle.
• The triangles adjacent to the intersected triangles are
candidates for intersection.
Therefore, from a pair of intersecting triangles, we can
start searching recursively for triangle-edge intersections,
as shown in Fig. 8. Since our Segment_Triangle_Intersec-
tion algorithm automatically stores intersection points, in
case there is any, our Search_Intersections algorithm
builds the intersection curve at the same time as it walks
through the intersecting pair of triangles. This search, when
triggered from a pair of triangle in intersection, will stop
only when all intersection points were included in their
respective intersection curve. If the search for intersection
is triggered by a pair of triangles without intersection, these
triangles will be marked as visited and no curve will be
generated.
Since it is not desirable to call our search for intersec-
tions for every pair of triangles, we, first, create a list of
triangle pairs probably in intersection, using an R-tree. An
R-tree [30] structure is also used here to improve the
efficiency of searches for intersecting triangles. In this
algorithm, a 3D bounding box enclosing a triangle is used
for indexing the auxiliary R-tree.
For surface–surface intersections, a good heuristic is to
start searching for intersections from all pairs of intersecting
boundary triangles and, then, from all pairs of intersecting
internal triangles. Doing this, we generate, firstly, all
intersection curves that start and end at the boundary of a
surface. If a surface contains holes, the borders of the holes
are considered as boundaries of the surface and holes are
naturally handled properly. Then, we generate all intersec-
tion curves starting from pairs of intersecting internal tri-
angles, using the same Search_Intersections method
previously described. In this case, the intersection
curve(s) must circumvent two colliding peaks in different
surfaces, as shown in Fig. 9, and the intersection curve
becomes a closed polyline. To close this polyline, the first
intersection point must be revisited once more and included
as the last intersection point. Every time a search for
intersections is started from a different pair of triangles, new
curves (polylines) of intersected surfaces are obtained.
When all pairs of triangles in our list were visited, the
process of creating intersection curves ends up, generating
Fig. 8 Search intersections
algorithm
314 Engineering with Computers (2015) 31:305–324
123
all possible intersection curves between the two considered
surfaces. These intersection curves are still polylines con-
taining all calculated intersection points. After that, the
intersection curves are automatically redefined, so that
sections with higher curvatures will be more refined, as
described by the authors in another work [27]. Then, the
borders of the original surfaces are divided according to the
new intersection curves, creating new boundary curves for
the new surfaces. Note that, so far, the original support
triangulations were not modified; only the borders of the
surfaces were redefined. Finally, using the surface reme-
shing algorithm described in the previous section, new
geometric support triangulations are generated on these
surfaces patches based on the original underlying surface
triangulation.
The algorithm for defining the intersection curves is
O(n log n), with n being the total number of triangles on
both meshes. The cost of building the R-tree is O(n log n).
After that, an edge (in any mesh) will be visited once, twice
or it will never be visited. Most of the edges will not be
visited at all and a very few (if any) will be visited twice.
So, in the worst case, there will be O(m) checks of edge-
triangle intersections, where m is the total number of edges.
In practice, number of checks performed is much smaller
than m. If it is assumed that, in a triangular mesh, m = 3n/
2, then the total cost of checking all edge-triangle inter-
sections is O(n). Therefore, the computational complexity
of this algorithm is O(n log n).
3 Volume recognition
The tetrahedral mesh generation algorithm, described in
the next section, requires as input a set of connected tri-
angles, given by a list of nodes and a list of faces (FE
triangular faces), and which must form a closed volume.
This section describes an algorithm to recognize closed
volumes in a subsurface model. Since each volume is
formed by a group of surfaces composed by FE connected
triangles, this task requires three steps: (1) transforming all
selected surfaces (which can be all surfaces of the model)
into a single triangulation; (2) building a list of face-uses
for the two faces of all triangles (one face-use lies on the
positive normal side of the face, upper face-use, and the
other lies on the negative normal side of the face, lower
face-use [19]), in which each face-use points to its adjacent
face-uses; and (3) identifying closed volumes using a
linked list of face-uses.
The first step is to group all FE triangles of a set of
selected surfaces into a single triangular mesh, in which the
triangles share a single node list. A set of nodes that occupy
a single geometric location from different selected surfaces
are recognized as a single node, and all adjacent triangles
refer to this node. This operation can be performed using a
special data partitioning structure such as an R-tree or a
B-tree.
In the current implementation, an R-tree [30] structure is
also used here to improve the efficiency of node queries. In
this algorithm, a 3D bounding box enclosing a node is used
for indexing the auxiliary R-tree (the bounding box can be
determined by a percentage of the smallest edge size
among all triangles in the model, for example).
The creation of a single triangular mesh follows some
sub-steps. Initially, the R-tree structure is created with an
empty numbering of nodes and their coordinates. Then, all
triangles of all selected surface meshes are visited. Each
node of a triangle is geometrically verified to see whether it
is already in the R-tree structure, using a bounding box of
the node. If the node is not in the R-tree, it is inserted in the
structure and a new identifier is assigned to this new node.
Otherwise, the existing identifier of that node is recovered.
In both cases, the current node identifier is updated in the
Fig. 9 Intersection of two
colliding peaks in
(a) perspective view and
(b) orthogonal view
Engineering with Computers (2015) 31:305–324 315
123
connectivity of the corresponding triangle. This operation
creates a single list of nodes and triangles.
In the second step of the volume recognition algorithm,
another auxiliary structure is created with the face-uses of
each triangle face, in which each face-use points to its
adjacent face-uses (Fig. 10). For each face (Fig. 10a), two
face-uses are created: one at the side of the normal vector’s
direction and the other at the opposite normal vector’s side.
The adjacencies of each face-use are obtained by ordering
the faces on a local coordinate system (x, y), where plane
x–y is perpendicular to the adjacent edge in Fig. 10b.
Going through each triangle face in order and using the
normal vectors of the faces, it is possible to define appro-
priate pointers to each triangle’s three adjacent face-uses
(Fig. 10c, d).
In the third step, volumes may be identified by walking
through all face-uses and their adjacent face-uses, as shown
in the algorithm of Fig. 11. A face-use can have two states:
(a) unmarked, when the volume recognition algorithm has
not visited the face-use, and (b) marked, when the face-use
has been visited. Initially, all face-uses are unmarked. The
first step is to look for each face-use and check whether it is
marked. For each face-use, it verifies whether it is marked.
If not, the current face-use is inserted in a list, which is
initially empty, and at the end will contain all face-uses of a
detected volume. This list is updated according to the
following steps: (1) the algorithm marks the face-use that is
inserted in the list; (2) then, it visits all face-uses adjacent
to the current one that are not marked and inserts them in
the list, recursively repeating step 1 for each of these
adjacent face-uses; (3) if there are no more face-uses to
visit in the recursive traversal by adjacency, the algorithm
returns to the original list of face-uses to detect another
volume; and (4) if all the face-uses are marked, the process
finishes. At the end, each face-use list identifies a detected
Fig. 10 Simplified process to
build face-uses for volume
recognition: (a) faces of each
triangle and their normal
vectors; (b) faces in an auxiliary
coordinate system; (c) pointers
to adjacent face-uses; and
(d) walking through face-uses
Fig. 11 Volume recognition algorithm
316 Engineering with Computers (2015) 31:305–324
123
volume. There are two important remarks. Firstly, this
algorithm also identifies the boundaries of the exterior
domain of a model, which should not be considered. Sec-
ondly, internal surfaces that are completely disconnected
from other surfaces will also be discarded for volume
detection. These surfaces are considered in the tetrahedral
mesh generation as internal constraints inside a volume.
As this volume recognition strategy is just based on
adjacency information, it will not be able to identify cases in
which a domain is completely enclosed by another. How-
ever, this problem can be solved using a point location (point
in region) algorithm. Some algorithms for point location are
described by De Berg et al. [20] and Preparata and Shamos
[39]. An alternative to this could be to connect, with an
auxiliary surface, the enclosed domain to the external one,
using interactive user tools, as described in Sect. 5.
4 Tetrahedral mesh generation
The 3D mesh generation in each closed region of the model
is based on a 2D technique presented by the authors [40]
and is used to obtain tetrahedral elements in arbitrary 3D
domains [16]. Similarly to the procedure applied to gen-
erate surface meshes, this one is based on an advancing
front technique coupled with a recursive spatial decom-
position technique (octree). The algorithm was designed to
meet a default requirement (to generate meshes conforming
to existing FE triangular meshes at the boundary of a
domain) and three specific requirements: (1) to avoid
producing elements with poor aspect ratios; (2) to generate
meshes exhibiting good transitions between regions of
different element sizes; (3) to work properly for cases in
which distinct boundary nodes are geometrically coinci-
dent (e.g. nodes on opposite faces of a crack). The
advancing front technique is based on standard procedures
in the literature [21–26], with two additional steps used to
ensure the generation of a valid tetrahedral mesh for almost
any domain.
The input data for the tetrahedral mesh generation are
described by a list of nodes defining their coordinates and a
list of triangular faces defined by their nodal connectivity.
Among other advantages of this data structure, it can rep-
resent any geometry, including holes, cavities and cracks,
in a simple manner, so it can easily be incorporated to any
finite element system.
Similar to surface mesh generation, a background octree
is used to control the distribution of the node points gen-
erated in the interior. Its generation follows these steps:
1. Octree initialization based on given boundary faces:
each face of the input boundary data is used to
determine the local subdivision depth of the octree;
2. Refinement to force maximum cell size: the octree is
refined to guarantee that no cell in its interior is larger
than the largest cell at the boundary. This will avoid
excessively large elements in the domain interior,
resulting in better quality of elements [16];
3. Refinement to obtain minimum size disparity for
adjacent cells: this additional refinement enforces only
one level of tree depth between neighboring cells and
provides a natural transition between regions with
different degrees of mesh refinement.
The input to the algorithm is a triangular surface mesh,
which describes the domain to be meshed. The algorithm
steps are as follows:
• A two-pass advancing front procedure is applied to
generate elements. On the first pass, elements are
generated based on geometrical criteria, producing
well-shaped elements. The background octree is used to
control the sizes of the elements and the position of the
interior nodes. The octree determines an ideal position
for an optimal node to form a new element. This ideal
position defines a search region where the best accept-
able node location for the new element may be located.
This region is a sector of a sphere whose center is the
ideal position and whose radius is proportional to the
octree cell size. If one or more existing nodes are inside
this region, they are ranked based on a solid angle
criterion, to get the best node for the new element.
However, if no existing node is found, a new node is
inserted at the ideal position and an element is
generated using this node. In the second pass, elements
are generated based only on the criterion that they have
valid topology. Here, any existing node that forms a
valid new element can be used, regardless of whether it
is close to the ideal position or not. However, the same
quality criterion is used and the node that forms the best
solid angle is chosen for the generation of the new
element.
• If the advancing front procedure cannot progress, a
back-tracking strategy is employed to delete some
elements, and the procedure is restarted only in the
created local cavities. The back-tracking strategy is
explained in details in another work [41]. It consists
basically of back tracking a few steps in the mesh
generation and deleting faces that hinder the front from
converging. This creates better regions where valid
elements can be then generated. It is possible that the
process of finding better regions may fail, for instance,
if faces to be removed are part of the original boundary.
When this occurs, other elements are deleted instead
and the procedure is restarted. If a mesh still cannot be
generated for this region, the algorithm fails and
terminates. In principle, it is possible to create a
Engineering with Computers (2015) 31:305–324 317
123
boundary input mesh that enforces the failure of the
tetrahedral mesh generation. Such failure, however, has
not yet been observed in ‘‘non-contrived’’ input, i.e., in
any realistic input boundary meshes. In our modeler,
when the algorithm fails, the tetrahedral mesh gener-
ation is aborted, prompting the user to redefine the
boundary FE mesh of that volume.
• Once a valid mesh is created, the quality of the
elements’ shapes is improved using the standard
Laplacian smoothing technique and locally deleting
poorly shaped elements and those adjacent to them.
Finally, the algorithm generates a mesh of tetrahedral
elements that considers cracks and the restrictions imposed
by the subsurface model. Figure 12 shows an example of
tetrahedral mesh generation. The various tetrahedral ele-
ments generated in many domains, with attributes resulting
from the analysis, complete the desired finite element
mesh. Then, this mesh may be examined by a FE solver.
Shape quality of generated tetrahedral elements and
time performance of presented solid mesh generation
algorithm has been published previously [16]. Shape met-
rics of generated tetrahedral elements are shown in the next
section to demonstrate the quality of this algorithm.
5 A didactic example
To validate the presented ideas and to verify the perfor-
mance of the proposed methodology, the procedures
described in this work were implemented in a geometric
modeler that was originally called MG [42]. Later, it was
extended to generate volumetric FE meshes and now it is
called MTool3D, improving the capability of the modeler
to deal with complex geometric models. Besides some
conventional CAD/CAE software tools, new ones were
implemented to simplify our specific modeling needs.
Some of these tools are:
• Creation of embedded or non-embedded curves on a
surface.
• Intersection curves and surfaces with a defined plane.
• Extension of curve to another curve, of curve to a
surface, and of surface border to a surface.
• Creation of a ‘‘black-list’’: a list to which defective
entities are sent when problems are detected. These
problems can be: entities occupying identical geometric
position, near tangency, topological incoherencies,
isolated entities, triangles with poor shape on surfaces,
volumetric regions without mesh, etc.
• Smoothing of surfaces by Laplacian or Taubin [43]
technique, which reduces high curvature variations and
does not produce shrinkage.
• Refining or coarsening the triangle geometric support
of a surface.
In relation to the ‘‘black-list’’ tool, it is well known that
computational geometry algorithms are susceptible to
failure, even considering that these algorithms have been
designed to attend robustness requirements. Based on
experience of the authors, most of these errors can be
solved by user intervention. Hence, the authors have
designed a dedicated environment to automatically sepa-
rate modeling entities involved in algorithm failure, topo-
logical inconsistencies, or geometric problems. Then,
through the modeler graphics interface, the user may
modify or delete these entities.
To illustrate the new features described in this work, this
section presents a didactic example, illustrated in Figs. 13–
15. The first step is to generate a geometric subsurface
model, which is done in gOcad. The imported Tsurf sur-
faces from gOcad as shown in Fig. 13, where two surfaces
represent faults, and the other two represent the top and
Fig. 12 Example of tetrahedral mesh generation
318 Engineering with Computers (2015) 31:305–324
123
bottom limiting horizon surfaces of an oil reservoir. The
overall sizes of these surfaces are on the order of
12,500 9 10,000 m and the reservoir thickness is about
35 m. Note that, when the surfaces (sets of triangles) are
imported into MTool3D, curves and vertices on the
boundaries of the surfaces are also incorporated to the
topological model. Topological vertices are created in two
ways: (a) from a Tsurf file, when vertices are created in
gOcad and identified by the label ‘‘BORDER STONES’’,
or (b) from the corners on the boundaries of surfaces that
are automatically identified when two adjacent boundary
edges form a kink angle. Topological curves have polyline
geometric representations separated by vertices, as shown
in Fig. 13 (left). Figure 13 (right) shows details of the
triangles that compose the support surfaces (triangulations
that define the underlying geometry representation of sur-
faces). Note in Fig. 13 (right) that the triangulations of
faults and horizons do not match. The reason is that the
intersections between these support surfaces have not been
treated yet. These operations are performed in a further
step.
After importing the fault and horizon surfaces, it is
necessary to limit the domain of the subsurface model.
Figure 14 shows some details of surface intersections per-
formed to define the limiting domain of the initial model,
and of intersections between fault and horizon surfaces.
Initially, a bounding box (5,000 9 5,000 9 2,500, in
meters) is inserted in the model to limit its size (Fig. 14a).
Then, intersections between surfaces are defined using the
triangles of each surface. For this specific example, the
intersections were performed between pairs of surfaces:
first, the top reservoir surface was intersected with each
surface of bounding box; second, the same operations were
performed with the bottom reservoir surface. New triangles
on the surfaces are obtained after each intersection step, as
shown in Fig. 14b. These new triangles respect the original
geometry of the support surfaces. Note that there is a
concentration of nodes on curves created by intersection
due to the adaptive refinement of curves to consider its
curvature [27]. Figure 14c shows the model after perform-
ing intersections with the limiting bounding box and
excluding spurious parts of reservoir surfaces. Note that
new topological entities (vertices and curves) are generated
at the intersection of surfaces. In addition, new support
surfaces are also generated from surface intersections, as
shown in Fig. 14d: six new surfaces were obtained from the
original ones, and four new intersection curves were gen-
erated between surfaces. These intersection curves, which
divide the fault surfaces in Fig. 14d, are the ones that appear
on reservoir surfaces in Fig. 14e. These curves represent
internal restrictions in fault and horizon surfaces that should
be considered in surface mesh generation. As mentioned,
the geometry of an intersection curve is automatically
redefined to improve quality of generated support triangu-
lations of adjacent surface patches, i.e., edge subdivision of
an intersection curve is regenerated automatically, and this
takes into account local curvature information. After
defining the intersections between support surfaces, a con-
sistent topological model is built in terms of vertices, curves
and surfaces. The triangles generated in the previous steps
serve only to form the support surface, because the triangles
that are input data to tetrahedral mesh generation are
described in the next paragraph. The triangulations shown
in Fig. 14 correspond to the underlying geometric support
triangulation of surfaces, which present local concentration
of triangles. The refinement of geometric support of curves
(polylines) and surfaces (triangulations) is affected by local
curvatures. This is the reason for local concentration of
vertices. As explained, the support triangulation of a surface
is regenerated when it is imported from gOcad and when
there are surface intersections.
Triangular surface and tetrahedral finite elements can be
generated from the model shown in Fig. 14c. This process
is similar to many CAD/CAE systems: edges are created on
Fig. 13 Initial imported
surfaces in Example 1
Engineering with Computers (2015) 31:305–324 319
123
curves by the user of Mtool3D, and then triangular ele-
ments are generated on each surface, using the algorithm
described in Sect. 2.2. The boundary edge sizes for FE
surface mesh generation are defined by giving a number of
curve subdivisions or by specifying an average size,
including a size ratio, using many tools implemented in
MTool3D. In both cases, boundary edge of a FE surface
mesh respect boundary curve geometries. The inputs to the
surface mesh generation are these boundary edges on
curves and a surface as support. The edges on curves and
the FE surface meshes are shown in Fig. 15a. The next step
identifies the set of triangles of each closed volume. This
set of triangles serves as input to the tetrahedral mesh
generation algorithm described in Sect. 4. Figure 15b
shows three volumes detected in the model. Note that
dangling fault surfaces are also part of the closed volumes.
The sequence of geometric modeling in Figs. 13–15
shows some important aspects that should be highlighted:
• The consistency between the geometric and the topo-
logical representation of vertices, curves, and surfaces
is automatically updated in all modeling steps, such as
when surfaces are imported and intersected. However,
topological volume consistency is not enforced auto-
matically. This is performed by the user in the domain
recognition process. The authors have already pub-
lished a work for creating and maintaining a spatial
subdivision [44] that could be used to check the
consistency of topological volumes. However, the
authors realized that this approach is very expensive
for subsurface models. For this reason, the volume
recognition is used here as it is proposed.
Fig. 14 Model after inserting
limiting surfaces and surface
intersections in Example 1
Fig. 15 Meshes on surfaces
after all necessary intersection
procedures in Example 1
320 Engineering with Computers (2015) 31:305–324
123
• The surface mesh generator, described in Sect. 2, is
used for two purposes: to reconstruct the faceted
geometric support of a surface and to generate the
finite elements on surfaces. Geometric support recon-
struction may be forced on demand, usually to improve
the quality of the input surface’s triangulation, or
automatically, for example after surface intersection. In
any situation, the geometric re-triangulation of a
surface uses the current triangulation as geometric
support [15]. Furthermore, the algorithm identifies
locations of high curvatures to generate triangles
compatible with the surface’s geometry. Another
feature is the possibility of treating internal constraints,
such as internal boundaries associated to other curves
or surfaces. This characteristic is essential for meshing
over reservoir surfaces, as shown in Figs. 14e and 15a.
• The volume recognition process also takes into account
dangling surfaces inside volumetric regions, since these
dangling objects belong to the region’s boundary, as
shown in Fig. 15b. The concept of face-use is important
in the volume recognition process (see Sect. 3): an
internal face on a dangling surface is traversed twice,
one for each of its face-uses.
• Finally, the tetrahedral mesh generation algorithm,
described in Sect. 4, is also capable of dealing with
dangling triangles in volumetric regions.
There is one possible weak point related to the use of
surface mesh algorithm to regenerate the surface FE mesh.
The algorithm works well when the size of elements of the
new mesh is similar or larger than the size of elements of
the supporting mesh. In case a finer mesh is required, the
new generated triangles will conform geometrically to the
coarser triangles of the supporting mesh. This means that
the generated refined mesh will present a ‘‘piecewise-pla-
nar’’ geometry. However, this problem is solved by
applying the following steps: refinement of the support
triangulation, which uses Taubin smoothing; and genera-
tion of a FE mesh on top of the surface geometric support.
For our purposes, this procedure works very well.
To estimate the performance of the proposed method-
ology, Fig. 16 shows the elapsed processing times of 3D
mesh generator for the examples. Here only the volumetric
refinement step is included, because this is the step where it
takes longer to generate the final finite element model.
These processing times were measured on a Pentium Core
i7-1.73 GHz PC with 6 GB of RAM, under Windows 7
operating system. Note that the graph is in log–log scale.
Using this graph, it is possible to estimate the time required
for 1 million elements, for example, which would take
nearly 17 min. The extrapolation of the mesh generation
run time shows that, for large models, a serial version of
the algorithm might not be sufficient. In fact, a
computational complexity of O(n log n) has been reported
in the literature for advancing front techniques, n being the
number of generated elements [21, 45, 46], and it has also
been reported that a performance of O(c np log n), with
p slightly larger than one and c being a constant, is even a
more realistic measure [23]. In the present work, the
complexity of the serial algorithm is reported as O(c np log
n), where c * 0:000269–0:0000629 and p * 1.2 [16].
Therefore, to generate 1 million elements, it is better to
generate 10 times 100,000 elements in approximately
7 min, using a parallel 3D mesh generator, for example.
The authors are currently working in a parallel version of
this algorithm that will be published in the near future.
The well-known refinement and mesh improvement
algorithms from the literature achieved running times on
the same range of the proposed algorithm or worse (for
some of them). Although some of them are based on dif-
ferent approaches, such as Delaunay, and they were tested
in different models (many times more simple then the ones
presented in this work), they were included here to give an
idea of running times for models of similar sizes. Gosselin
and Ollivier-Gooch [47] developed a fast algorithm that
consisted basically of creating a mesh from a point cloud,
then refining and improving the mesh. The refinement
phase for a mesh of the ridged torus using R = 2 and
G = 10 yielded around 330,000 tetrahedra and required
16.3 s, therefore inserting slightly \4,000 vertices every
second. The same insertion rates were observed for the
other meshes presented in their work. When considering
the mesh improvement phase, however, the insertion rates
dropped considerably but even then they were able to mesh
a model made of roughly 25,000 tetrahedra connecting
random vertices placed inside a cube in 9.1 s, using their
mesh improvement algorithm. In the proposed methodol-
ogy, the generation of the same number of tetrahedra, for
more complex models, took around the same time
Fig. 16 Time performance of 3D mesh generator
Engineering with Computers (2015) 31:305–324 321
123
(Fig. 16). The work of Klingner and Shewchuk [48], on the
other hand, attains its best possible results at a very high
computational cost. For the same model, Klingner and
Shewchuk’s implementation took between 1,430 and
4,658 s. Another important work by Alliez et al. [49]
produced meshes with remarkably high average quality and
reasonable number of elements (275,000 elements for one
of their models) in 4 min. Extrapolation from these timings
indicates that they can generate a mesh containing about
one million tetrahedra in around 15 min, which is the same
range of the proposed algorithm (Fig. 16).
The shape quality of generated triangle surface and
tetrahedral meshes is shown in the original and complete
descriptions of mesh generators [15, 16]. However, for the
sake of completeness, four configurations of mesh refine-
ment are generated in this work to demonstrate the quality
of the presented meshing algorithms: (a) edges on all
curves of didactic model were created with average size of
200 m and only edges on curves on reservoir were created
with average size of (b) 100, (c) 50, e (d) 25 m. Note that
using theses sizes, curves along thickness of reservoir
(about 35 m) have only one edge. The quality of the shapes
of the generated triangles on surface is measured by a
normalized ratio quality measure, c/c* [15, 50]. In this
measure c is the ratio between the root mean square of the
lengths (Si) of a triangle’s edges and the triangle’s area, and
c* is the corresponding value for an equilateral triangle:
c ¼ 1
3
X3
i¼0
S2i
,
Area ð7Þ
where the c/c* quality measure has a valid interval between
1.0 and infinity, with high quality elements, those close to
an equilateral triangle, having values close to 1.0. For
tetrahedral elements, the mean-ratio metric is adopted [51].
The mean-ratio l of a matrix S n 9 n with det (S) [0 is.
l Sð Þ ¼ ndet Sð Þ2=n.
Sk k2F ð8Þ
where Sk k2F¼
ffiffiffiffiffiffiffiffiffiffiffiffiffiffi
tr ST Sð Þp
is the Frobenius norm. This metric
has a valid interval 1.0 C l(S) [ 0.0. Let xi be the coor-
dinates of vertex i, and let xk be the coordinates of another
vertex in the element connected to vi by an edge. Construct
the matrix A(i) whose columns are the vectors xk–xi for each
adjacent vertex vk in the element. For tetrahedral elements,
the matrix is 3 9 3. For a regular tetrahedron, the mean-
ratio is about 0.79.
Table 1 Quality of triangles on surfaces for different mesh refinements
Mesh ref. No. of nodes No. of triangle c/c* [15, 50]
Average SD Max. [1.15 (%) [1.50 (%)
(a) 4,961 7,956 1.15 0.48 6.62 17.07 5.67
(b) 10,303 17,505 1.08 0.18 3.51 13.21 5.44
(c) 30,123 54,902 1.05 0.11 4.38 10.28 1.60
(d) 102,942 195,946 1.03 0.08 9.04 5.25 0.77
Table 2 Quality of tetrahedral meshes for different mesh refinements
Mesh ref. Region No. of nodes No. of elements l [51]
Average SD Min. \0.3 (%) \0.2 (%) \0.1 (%)
(a) 1 6,350 27,958 0.65 0.16 0.07 3.34 1.10 0.15
2 1,711 5,033 0.30 0.11 0.05 54.94 18.18 1.05
3 5,785 23,169 0.62 0.18 0.05 5.92 1.94 0.22
(b) 1 13,836 63,536 0.66 0.16 0.05 2.97 1.17 0.15
2 5,925 17,722 0.46 0.14 0.07 12.94 2.90 0.27
3 11,904 51,709 0.65 0.16 0.05 3.74 1.34 0.11
(c) 1 44,238 210,604 0.67 0.15 0.04 2.33 0.81 0.10
2 22,232 67,203 0.65 0.15 0.06 1.62 0.53 0.07
3 37,022 171,491 0.66 0.16 0.04 3.04 1.08 0.13
(d) 1 170,180 836,355 0.68 0.15 0.01 2.18 0.79 0.09
2 107,816 402,661 0.70 0.13 0.05 1.52 0.68 0.11
3 151,413 739,831 0.68 0.15 0.01 2.47 0.90 0.11
322 Engineering with Computers (2015) 31:305–324
123
Table 1 shows the quality of triangles on surfaces for
different mesh refinements. This table gives the number
of nodes and triangles, along with the average, standard
deviation, maximum, percentage of element [1.15 and
1.50, for the normalized ratio quality measure. A triangle
with metric 1.15 is an isosceles triangle with base 1.0
and height 0.5, for example. A triangle with metric 1.50
is an isosceles triangle with base 1.0 and height 0.33, for
example. One can see that the number of nodes and
triangles growth exponentially and the quality of trian-
gles increases with the refinement of reservoir curves.
The quality of triangle in mesh refinement (a), 17.07 %
of triangles [1.15, is due to the small thickness of
reservoir.
Table 2 shows the quality tetrahedral meshes for dif-
ferent mesh refinements. This table gives the number of
nodes and tetrahedrons, along with the average, standard
deviation, minimum, percentage of element smaller than
0.3, 0.2 and 0.1, for the mean-ratio quality in the regions.
For example, considering a regular tetrahedron with an
isosceles triangular base and height H, mean-ratio values of
0.3, 0.2 and 0.1 means this tetrahedron with height 0.16H,
0.088H, and 0.025H, respectively. Note that the quality of
elements on reservoir (Region 2) is lower when compared
to region 1 and 3, due again to the small thickness of
reservoir. However, most of cases the average mean-metric
is close to a regular tetrahedron meaning a good mesh for
FE geomechanics analysis.
6 Conclusion
This paper presented a methodology based on the inte-
gration of several advanced technologies for subsurface
simulation modeling using finite elements. The methodol-
ogy involves all stages of geometric modeling and mesh
generation. The process starts with arbitrary surfaces rep-
resented by a set of triangles, which are imported. The
triangular meshes can be improved by an advancing front
algorithm applied to arbitrary surfaces, including surfaces
with accentuated curvature. The same algorithm is used to
redefine meshes after the surface intersection process. After
this step, an automatic recognition of multi-volumes is then
performed. This step is an important procedure in the
simulation of complex subsurface models, so it must be
robust, forcing geometric and topological consistency.
Finally, volumetric meshes can be generated inside the
regions bounded by FE surface meshes. An algorithm to
generate tetrahedral elements in arbitrary domains is used,
consistently treating internal restrictions (faults, for
example).
The proposed methodology was implemented in a geo-
metric modeler, being put to use in the development and
simulation of complex subsurface problems, including
reservoir simulation and flow in fractured rocks.
A subsurface simulation model was built using several
computational geometry technologies, with some important
requirements:
• Geometric support when importing and intersecting
surfaces;
• Surface mesh generation algorithm that considers high
curvatures and internal constraints;
• Volume recognition algorithm that also identify dan-
gling surfaces;
• Tetrahedral mesh generation algorithm that also con-
siders internal constraints of dangling surfaces.
Obviously, the current modeling strategy needs
improvements. For example, there are new features under
development: parallel 3D mesh generator; refinement of
curves, surfaces and volumes using automatic adaptive
approach [27]; volume recognition strategy to identify
domain completely included into other one; hexahedral
mesh generation algorithm; optimization-based smoothing
[52], that gives better results than Laplacian smoothing, for
triangles on surface and tetrahedral elements.
Acknowledgments The authors would like to thank the National
Council for Scientific and Technological Development (CNPq),
University of Brasılia, the Technical-Scientific Software Develop-
ment Institute (Tecgraf/PUC-Rio), and Pontifical Catholic University
of Rio de Janeiro (PUC-Rio) for the financial support and for pro-
viding the necessary space and resources used during the development
of this work.
References
1. Gocad (2006) gOcad Publications. http://www.gocad.org/w4/
index.php/research/publications
2. Mallet JL (1997) Discrete modeling for natural objects. Math
Geol 29(2):199–219
3. Gemmer L, Huuse M, Clausen OR, Nielsen SB (2002) Mid-
Paleocene palaeogeography of the eastern North Sea basin:
integrating geological evidence and 3D geodynamic modelling.
Basin Res 14:329–346
4. Wu Q, Xu H (2003) An approach to computer modeling and
visualization of geological faults in 3D. Comput Geosci
29:503–509
5. Wu Q, Xu H (2001) A framework modeling of geological related
spatial data in 3D scene. In: Sixth international symposium on
future software technology, Zhengzhou, China, pp 252–257
6. Martelet G, Calcagno P, Gumiaux C, Truffert C, Bitri A, Gapais
D, Brun JP (2004) Integrated 3D geophysical and geological
modelling of the Hercynian Suture Zone in the Champtoceaux
area (south Brittany, France). Tectonophysics 382:117–128
7. Lixin W (2004) Topological relations embodied in a generalized
tri-prism (GTP) model for a 3D geoscience modeling system.
Comput Geosci 30:405–418
8. Wu Q, Xu H, Zou X (2005) An effective method for 3D geo-
logical modeling with multi-source data integration. Comput
Geosci 31:35–43
Engineering with Computers (2015) 31:305–324 323
123
9. Qu H, Pan M, Wang Z, Wang B, Chai H, Xue S (2005)A new
method for 3D geological reconstruction from intersected cross-
sections. In: International symposium of remote sensing and
space technology for multidiciplinary research and application
10. Butscher C, Huggenberger P (2007) Implications for karst
hydrology from 3D geological modeling using the aquifer base
gradient approach. J Hydrol 342:184–198
11. Kaufmann O, Martin T (2008) 3D geological modelling from
boreholes, cross-sections and geological maps, application over
former natural gas storages in coal mines. Comput Geosci
34:278–290
12. Zanchi A, Francesca S, Stefanoa Z, Simone S, Graziano G (2009)
3D reconstruction of complex geological bodies: examples from
the Alps. Comput Geosci 35:49–69
13. Ming J, MaoPan QuH, Ge Z (2010) GSIS: a 3D geological multi
body modeling system from netty cross-sections with topology.
Comput Geosci 36:756–767
14. Xu N, Tian H, Kulatilake PHSW, Duan Q (2011) Building a three
dimensional sealed geological model to use in numerical stress
analysis software: a case study for a dam site. Comput Geotech
38:1022–1030
15. Miranda ACO, Martha LF, Wawrzynek PA, Ingraffea AR (2009)
Surface mesh regeneration considering curvatures. Eng Comput
25(2):207–219. doi:10.1007/s00366-008-0119-9
16. Cavalcante-Neto JB, Wawrzynek PA, Carvalho MTM, Martha
LF, Ingraffea AR (2001) An algorithm for three-dimensional
mesh generation for arbitrary regions with cracks. Eng Comput
17(1):75–91
17. Baumgart BG (1975) A polyhedron representation for computer
vision. AFISPS 44:589–596
18. Mantyla M (1988) An introduction to solid modeling. Computer
Science Press, Rockville
19. Weiler KJ (1986) Topological structures for geometric modeling.
PhD thesis, Rensselaer Polytechnic Institute, Troy, New York
20. de Berg M, Cheong O, van Kreveld M, Overmars M (2008)
Computational geometry–algorithms and applications. Springer,
Berlin
21. Lohner R, Parikh P (1988) Generation of three-dimensional
unstructured grids by the advancing-front method. Int J Numer
Methods Fluids 8:1135–1149
22. Peraire J, Peiro J, Formaggia L, Morgan K, Zienkiewicz OC
(1988) Finite Euler computation in three-dimensions. Int J Numer
Methods Eng 26:2135–2159
23. Jin H, Tanner RI (1993) Generation of unstructured tetrahedral
meshes by advancing front technique. Int J Numer Methods Eng
36(11):1805–1823
24. Moller P, Hansbo P (1995) On advancing front mesh generation
in three dimensions. Int J Numer Methods Eng 38(21):3551–3569
25. Chan CT, Anastasiou K (1997) Automatic tetrahedral mesh
generation scheme by the advancing front method. Commun
Numer Methods Eng 13(1):33–46
26. Rassineux A (1998) Generation and optimization of tetrahedral
meshes by advancing front technique. Int J Numer Methods Eng
41(4):651–674
27. Miranda ACO, Lira WWM, Cavalcante-Neto JB, Sousa RA,
Martha LF (2013) A 3D adaptive mesh generation approach using
geometric modeling with multi-regions and parametric surfaces.
J Comput Inf Sci Eng 13(2):021002-1–021002-13. doi:10.1115/1.
4024106
28. Foley TA, Nielson GM (1989) Knot selection for parametric
spline interpolation. In: Mathematical methods in computer aided
geometric design. Academic Press Professional, Inc., pp 261–272
29. Meagher D (1980) Octree Encoding: a new technique for the
representation, manipulation and display of arbitrary 3-D objects,
Computer. Rensselaer Polytechnic Institute
30. Guttman A (1984) R trees: a dynamic index structure for spatial
searching. In: ACM SIGMOD international conference on man-
agement of data, pp 47–57
31. Rudolf B (1971) Binary B-trees for virtual memory. In: ACM-
SIGFIDET workshop, San Diego, California, pp 219–235
32. Lohner R (1996) Regridding surface triangulations. J Comput
Phys 126 (1):1–10. doi:http://dx.doi.org/10.1006/jcph.1996.0115
33. Schreiner J, Scheidegger CE, Fleishman S, Silva CT (2006)
Direct (Re)meshing for efficient surface processing. Comput
Graph Forum 25(3):527–536. doi:10.1111/j.1467-8659.2006.
00972.x
34. Lo SH (1995) Automatic mesh generator over intersecting sur-
faces. Int J Numer Methods Eng 38:943–954
35. Segura RJ, Feito FR (1998) An algorithm for determining inter-
section segment-polygon in 3D. Comput Graph 22(5):587–592
36. Jimenez JJ, Segura RJ, Feito FR (2009) A robust segment-tri-
angle intersection algorithm for interference tests. Comput Geom
43(5):474–492
37. Shewchuk JR (1996) Robust adaptive floating-point geometric
predicates. In: Twelfth annual symposium on computational
geometry, pp 141–150
38. Shewchuk JR (1997) Adaptive precision floating-point arithmetic
and fast robust geometric predicates. Discret Comput Geom
18:305–363
39. Preparata FP, Shamos MI (1990) Computational geometry: an
introduction. Springer Verlag, New York
40. Miranda ACO, Cavalcante-Neto JB, Martha LF (1999) An
algorithm for two-dimensional mesh generation for arbitrary
regions with cracks. XII Brazilian symposium on computer
graphics and image processing (Cat NoPR00481):29–38
41. Cavalcante-Neto JB, Martha LF, Wawrzynek PA, Ingraffea AR
(2005) A back-tracking procedure for optimization of simplex
meshes. Commun Numer Methods Eng 21(12):711–722
42. Coelho LC (2006) MG-mesh generator, www.tecgraf.puc-rio.br/
*lula/manual/mg.pdf. Tecgraf, Rio de Janeiro
43. Taubin G (1995) Curve and surface smoothing without shrinkage.
In: Fifth international conference on computer vision,
pp 852–857
44. Cavalcanti PR, Carvalho PCP, Martha LF (1997) Non-manifold
modeling: an approach based on spatial subdivision. Comput
Aided Des 29(3):209–220
45. Krysl P (1996) Computational complexity of the advancing front
triangulation. Eng Comput 12:16–22
46. Bonet J, Peraire J (1991) An alternating digital tree (ADT)
algorithm for 3D geometric searching and intersection problems.
Int J Numer Methods Eng 31(1):1–17
47. Gosselin S, Ollivier-Gooch C (2011) Tetrahedral mesh generation
using delaunay refinement with non-standard quality measures.
Int J Numer Methods Eng 87:795–820
48. Klingner BM, Shewchuk (2007) Aggressive tetrahedral mesh
improvement. In: 16th international meshing roundtable, pp 2–23
49. Alliez P, Cohen-Steiner D, Yvinec M, Desbrun M (2005) Vari-
ational tetrahedral meshing. ACM Trans Graph 24(3):617–625
50. Miranda ACO, Martha LF (2002) Mesh generation on high-cur-
vature surfaces based on a background quadtree structure. In:
proceedings of 11th international meshing roundtable 1:333–341
51. Knupp PM (2001) Algebraic mesh quality metrics. SIAM J Sci
Comput 23(1):193–218
52. Canann SA, Tristano JR, Staten ML (1998) An approach to
combined laplacian and optimization-based smoothing for trian-
gular, quadrilateral, and quad-dominant meshes. In: 7th interna-
tional mesh roundtable, pp 479–494
324 Engineering with Computers (2015) 31:305–324
123