OOFEM  2.4
OOFEM.org - Object Oriented Finite Element Solver
delaunaytriangulator.h
Go to the documentation of this file.
1 /*
2  *
3  * ##### ##### ###### ###### ### ###
4  * ## ## ## ## ## ## ## ### ##
5  * ## ## ## ## #### #### ## # ##
6  * ## ## ## ## ## ## ## ##
7  * ## ## ## ## ## ## ## ##
8  * ##### ##### ## ###### ## ##
9  *
10  *
11  * OOFEM : Object Oriented Finite Element Code
12  *
13  * Copyright (C) 1993 - 2013 Borek Patzak
14  *
15  *
16  *
17  * Czech Technical University, Faculty of Civil Engineering,
18  * Department of Structural Mechanics, 166 29 Prague, Czech Republic
19  *
20  * This library is free software; you can redistribute it and/or
21  * modify it under the terms of the GNU Lesser General Public
22  * License as published by the Free Software Foundation; either
23  * version 2.1 of the License, or (at your option) any later version.
24  *
25  * This program is distributed in the hope that it will be useful,
26  * but WITHOUT ANY WARRANTY; without even the implied warranty of
27  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
28  * Lesser General Public License for more details.
29  *
30  * You should have received a copy of the GNU Lesser General Public
31  * License along with this library; if not, write to the Free Software
32  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
33  */
34 
35 // *******************************
36 // *** DELAUNAY MESH GENERATOR ***
37 // *******************************
38 
39 // based on oofemlib/mesherinterface.h
40 
41 
42 #ifndef delaunaytrinagulator_h
43 #define delaunaytrinagulator_h
44 
45 #include <list>
46 #include "contextioresulttype.h"
47 #include "timer.h"
48 #include "octreelocalizert.h"
49 #include "intarray.h"
50 #include "edge2d.h"
51 
52 namespace oofem {
53 class Domain;
54 class TimeStep;
55 class IntArray;
56 class FloatArray;
57 class InsertionData;
58 
66 {
67 protected:
70  // Value of alpha for the boundary recognition via alpha shape algorithm
71  double alphaValue;
72  // Number of nodes
73  int nnode;
74  // Option 2: setting bounds for computed Alpha
75  //double minAlpha;
76  //double maxAlpha;
77 
87  std :: list< DelaunayTriangle * >generalTriangleList;
88  std :: list< DelaunayTriangle * > :: iterator genIT;
89 
91  std :: list< AlphaEdge2D * >alphaShapeEdgeList;
92 
94  std :: list< AlphaEdge2D * >edgeList;
95  std :: list< AlphaEdge2D * > :: iterator elIT;
96 
99 
100 public:
102  DelaunayTriangulator(Domain *d, double setAlpha);
105 
107  void generateMesh();
108 
109 private:
111  void addUniqueEdgeToPolygon(Edge2D *edge, std :: list< Edge2D > &polygon);
112 
116  void writeMesh();
117 
119  void computeAlphaComplex();
120 
125 
127  void giveAlphaShape();
128 
130  void initializeTimers();
131 
133  void findNonDelaunayTriangles(int insertedNode, InsertTriangleBasedOnCircumcircle &tInsert, std :: list< Edge2D > &polygon);
135  void meshPolygon(int insertedNode, InsertTriangleBasedOnCircumcircle &tInsert, std :: list< Edge2D > &polygon);
137  void giveTimeReport();
139  void cleanUpTriangleList();
140 
143 
144 };
145 } // end namespace oofem
146 #endif // delaunaytrinagulator_h
Squared bounding box for templated octree localizer.
Class and object Domain.
Definition: domain.h:115
Timer polygonTimer
Measures time needed for identifying polygon to be retriangulated.
void computeBBXBasedOnNodeData(BoundingBox &BBX)
Calculates the bounding box base on the domain&#39;s nodes.
Class for the boundary recognition method - alpha shape.
Definition: edge2d.h:77
Timer meshingTimer
Measures overall time of triangulation procedure.
AlphaEdge2D * giveBackEdgeIfAlreadyContainedInList(AlphaEdge2D *alphaEdge)
Fills the edgeList with unique alphaEdges.
Edge class for Delaunay triangulation.
Definition: edge2d.h:49
void computeAlphaComplex()
Reads the triangulation and fills tha edgeList container with alpha-shape edges and set their bounds...
void giveTimeReport()
Prints the time report.
std::list< DelaunayTriangle * > generalTriangleList
Contains all triangles (even not valid)
Timer searchingTimer
Measures time needed by searching for non-delaunay triangles.
std::list< AlphaEdge2D * > edgeList
contains all edges of the triangulation
std::list< DelaunayTriangle * >::iterator genIT
void buildInitialBBXMesh(InsertTriangleBasedOnCircumcircle &tInsert)
Identifies the bounding box of pfemparticles and creates initial triangulation consisting of 2 triang...
void writeMesh()
Writes the mesh into the domain by creating new tr1_2d_pfem elements and prescribes zero-pressure bou...
Timer creativeTimer
Measures time needed for creating new Delaunay triangles.
void findNonDelaunayTriangles(int insertedNode, InsertTriangleBasedOnCircumcircle &tInsert, std::list< Edge2D > &polygon)
Looks for non-Delaunay triangles in octree and creates a polygon.
void meshPolygon(int insertedNode, InsertTriangleBasedOnCircumcircle &tInsert, std::list< Edge2D > &polygon)
Retriangulates the polygon.
OctreeSpatialLocalizerT< DelaunayTriangle * > triangleOctree
Octree with Delaunay triangles allowing fast search.
Functor for storing triangles in the octree according to theirs circumscribed circles.
void cleanUpTriangleList()
Iterates through generalTringleList und removes non-valid ones or those containing bounding box nodes...
std::list< AlphaEdge2D * >::iterator elIT
Domain * domain
Domain of the PFEM problem containing nodes to be triangulated.
std::list< AlphaEdge2D * > alphaShapeEdgeList
Contains resulting alpha-shape in form of a list.
Class implementing single timer, providing wall clock and user time capabilities. ...
Definition: timer.h:46
void addUniqueEdgeToPolygon(Edge2D *edge, std::list< Edge2D > &polygon)
Edge is added to the polygon only if it&#39;s not contained. Otherwise both are removed (edge shared by t...
Templated octree spatial localizer.
Mesh generator for the PFEM problem, using Bowyer-Watson algorithm of the Delaunay triangulation of a...
the oofem namespace is to define a context or scope in which all oofem names are defined.
void giveAlphaShape()
Iterates through the edgeList container and compares alpha-value with alphaEdge bounds. Alpha shape is stored in the alphaShapeEdgeList.
DelaunayTriangulator(Domain *d, double setAlpha)
Constructor.
void initializeTimers()
Initializes Timers and.

This page is part of the OOFEM documentation. Copyright (c) 2011 Borek Patzak
Project e-mail: info@oofem.org
Generated at Tue Jan 2 2018 20:07:28 for OOFEM by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2011