OOFEM  2.4 OOFEM.org - Object Oriented Finite Element Solver
delaunaytriangle.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
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 TRIANGLE ***
37 // *************************
38
39 // used for Delaunay meshing
40
41
42 #ifndef delaunaytriangle_h
43 #define delaunaytriangle_h
44
45 #include <list>
46 #include "intarray.h"
47 #include "floatarray.h"
48
49 namespace oofem {
50 class Domain;
51 class TimeStep;
52 class IntArray;
53 class FloatArray;
54 template< class T >class LocalInsertionData;
55
63 {
64 public:
66  DelaunayTriangle(Domain *d, int node1, int node2, int node3);
69
71  double giveXCenterCoordinate() const { return circumCircle.at(1); }
73  double giveYCenterCoordinate() const { return circumCircle.at(2); }
75  double giveCircumRadius() const { return circumCircle.at(3); }
77  double giveDistanceToCenter(const FloatArray &coords);
78
80  int giveNode(int i) { return nodes.at(i); }
82  std :: list< LocalInsertionData< DelaunayTriangle * > > *giveListOfCellsAndPosition();
84  void setValidFlag(bool newFlag) { validFlag = newFlag; }
86  bool giveValidFlag() { return validFlag; }
88  double giveShortestEdgeLength();
90  double giveEdgeLength(int nodeA, int nodeB);
91
92
93 private:
95  void computeCircumcircle();
97  void setCircumCircle(double x, double y, double r);
105  bool validFlag;
107  std :: list< LocalInsertionData< DelaunayTriangle * > >listOfCellsContainedInAndPosition;
108 };
109 } // end namespace oofem
110 #endif // delaunaytriangle_h
Class and object Domain.
Definition: domain.h:115
double & at(int i)
Coefficient access function.
Definition: floatarray.h:131
double giveShortestEdgeLength()
Gives the length of the shortest triangle edge.
void setCircumCircle(double x, double y, double r)
Sets up the parameters of the calculated circumscribed circle.
Gives the radius of the circumscribed circle.
double giveDistanceToCenter(const FloatArray &coords)
Calculates the distance of a passed point to the center of the circumscribed circle.
Class implementing an array of integers.
Definition: intarray.h:61
int & at(int i)
Coefficient access function.
Definition: intarray.h:103
Delaunay triangle for the triangulation of a set of nodes.
std::list< LocalInsertionData< DelaunayTriangle * > > * giveListOfCellsAndPosition()
Returns a list of octree cells and with iterator position in their member lists.
FloatArray circumCircle
Parameters of the circumscribed circle: coordinates of center (x,y) and its radius.
IntArray nodes
Nodes defining the triangle.
void setValidFlag(bool newFlag)
Sets the flag whether Delaunay condition is fulfilled.
double giveEdgeLength(int nodeA, int nodeB)
Gives the length of the edge between two nodes.
bool giveValidFlag()
Gives true if the delaunay triangle is valid.
double giveYCenterCoordinate() const
Gives the y coordinate of the center of the circumscribed circle.
Help class for storing pointer to octant cell and position of the member in the data list...
void computeCircumcircle()
Calculates the parameters of the circumscribed circle.
double giveXCenterCoordinate() const
Gives the x coordinate of the center of the circumscribed circle.
Class representing vector of real numbers.
Definition: floatarray.h:82
int giveNode(int i)
Gives the i-node of the triangle.
Domain * domain
Domain where the nodes are defined.
~DelaunayTriangle()
Destructor.
the oofem namespace is to define a context or scope in which all oofem names are defined.
bool validFlag
Flag for Delaunay property.
std::list< LocalInsertionData< DelaunayTriangle * > > listOfCellsContainedInAndPosition
In order to allow fast search in octree, every triangle stores list of octree cells where its circums...
DelaunayTriangle(Domain *d, int node1, int node2, int node3)
Constructor.