OOFEM  2.4
OOFEM.org - Object Oriented Finite Element Solver
delaunaytriangulator.C
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 #include "delaunaytriangulator.h"
36 #include "octreelocalizert.h"
37 #include "delaunaytriangle.h"
38 #include "tr1_2d_pfem.h"
39 #include "intarray.h"
40 #include "contextioerr.h"
41 #include "verbose.h"
42 #include "timer.h"
43 #include "mathfem.h"
44 #include "pfemparticle.h"
45 #include "pfem.h"
46 
47 #define _USING_OCTREE
48 
49 namespace oofem {
51  alphaShapeEdgeList(0), triangleOctree()
52 {
53  domain = d;
54  alphaValue = setAlpha;
56  // Option 2: setting bounds vor computed Alpha
57  //minAlpha = 0.08;
58  //maxAlpha = 0.2;
59 }
60 
62 {
63  // clean up triangle list
64  for ( genIT = generalTriangleList.begin(); genIT != generalTriangleList.end(); ) {
65  delete( * genIT );
67  }
68 
69  for ( elIT = edgeList.begin(); elIT != edgeList.end(); ++elIT ) {
70  delete( * elIT );
71  }
72 }
73 
74 
75 
76 void DelaunayTriangulator :: addUniqueEdgeToPolygon(Edge2D *edge, std :: list< Edge2D > &polygon)
77 {
78  std :: list< Edge2D > :: iterator pos;
79  int addingMask = 1;
80 
81  if ( !polygon.empty() ) {
82  for ( pos = polygon.begin(); pos != polygon.end(); ) {
83  if ( ( * pos ) == * edge ) {
84  pos = polygon.erase(pos);
85  delete edge;
86  addingMask = 0;
87  break;
88  } else {
89  ++pos;
90  }
91  }
92  }
93 
94  if ( addingMask ) {
95  polygon.push_back(* edge);
96  }
97 }
98 
99 
101 {
103 
104  buildInitialBBXMesh(tInsert);
105 
107 
108  for ( int insertedNode = 1; insertedNode <= nnode; insertedNode++ ) {
109  PFEMParticle *particle = dynamic_cast< PFEMParticle * >( domain->giveDofManager(insertedNode) );
110  if ( particle->isActive() ) {
111  std :: list< Edge2D >polygon;
112 
113  findNonDelaunayTriangles(insertedNode, tInsert, polygon);
114 
115  meshPolygon(insertedNode, tInsert, polygon);
116  }
117  }
118 
119  //giveTimeReport();
120 
122 
123  //deleting BBX-corner particles
125 
126  int size = generalTriangleList.size();
127 
128  VERBOSE_PRINT0("Number of generated elements", size);
129  triangleOctree.giveReport();
130 
131  if ( alphaValue > 0.001 ) {
133  giveAlphaShape();
134  }
135 
137 
138  writeMesh();
139 }
140 
142 {
143  int num = 1;
144  int nelem = generalTriangleList.size();
145  Element *elem;
146  IntArray dmans(3);
147  DofManager *dman;
148  DofIDItem type;
149  bool hasNoBcOnItself;
150 
151  int mat = 0;
152  int cs = 0;
153  int pressureBC = 0;
154  PFEM *pfemEngngModel = dynamic_cast< PFEM * >( domain->giveEngngModel() );
155  if ( pfemEngngModel ) {
156  mat = pfemEngngModel->giveAssociatedMaterialNumber();
157  cs = pfemEngngModel->giveAssociatedCrossSectionNumber();
158  pressureBC = pfemEngngModel->giveAssociatedPressureBC();
159  }
160 
161  domain->resizeElements(nelem);
162  //from domain.C
163  for ( genIT = generalTriangleList.begin(); genIT != generalTriangleList.end(); genIT++ ) {
164  elem = new TR1_2D_PFEM(num, domain, ( * genIT )->giveNode(1), ( * genIT )->giveNode(2), ( * genIT )->giveNode(3), mat, cs);
165 
166  domain->setElement(num, elem);
167  num++;
168  }
169 
170  if ( alphaValue > 0.001 ) {
171  // first reset all pressure boundary conditions and alphaShapeProperty
172  for ( int i = 1; i <= domain->giveNumberOfDofManagers(); i++ ) {
173  Dof *jDof = domain->giveDofManager(i)->giveDofWithID(P_f);
174  jDof->setBcId(0);
175 
176  dynamic_cast< PFEMParticle * >( domain->giveDofManager(i) )->setOnAlphaShape(false);
177  }
178 
179  // and then prescribe zero pressure on the free surface
180  for ( elIT = alphaShapeEdgeList.begin(); elIT != alphaShapeEdgeList.end(); elIT++ ) {
181  bool oneIsFree = false;
182  hasNoBcOnItself = true;
183  dman = domain->giveDofManager( ( * elIT )->giveFirstNodeNumber() );
184  for ( Dof *dof: *dman ) {
185  type = dof->giveDofID();
186  if ( ( type == V_u ) || ( type == V_v ) || ( type == V_w ) ) {
187  if ( dof->giveBcId() ) {
188  hasNoBcOnItself = false;
189  }
190  }
191  }
192 
193  if ( hasNoBcOnItself ) {
194  oneIsFree = true;
195  }
196  dynamic_cast< PFEMParticle * >( dman )->setOnAlphaShape();
197 
198  hasNoBcOnItself = true;
199  dman = domain->giveDofManager( ( * elIT )->giveSecondNodeNumber() );
200  for ( Dof *dof: *dman ) {
201  type = dof->giveDofID();
202  if ( ( type == V_u ) || ( type == V_v ) || ( type == V_w ) ) {
203  if ( dof->giveBcId() ) {
204  hasNoBcOnItself = false;
205  }
206  }
207  }
208 
209  if ( hasNoBcOnItself ) {
210  oneIsFree = true;
211  }
212  dynamic_cast< PFEMParticle * >( dman )->setOnAlphaShape();
213 
214  if ( oneIsFree ) {
215  Dof *dofOnNode1 = domain->giveDofManager( ( * elIT )->giveFirstNodeNumber() )->giveDofWithID(P_f);
216  dofOnNode1->setBcId(pressureBC);
217 
218  Dof *dofOnNode2 = domain->giveDofManager( ( * elIT )->giveSecondNodeNumber() )->giveDofWithID(P_f);
219  dofOnNode2->setBcId(pressureBC);
220  }
221  }
222  }
223 }
224 
227 {
228  bool alphaLengthInitialized = false;
229  double minimalLength = 1.e6;
230 
231  for ( genIT = generalTriangleList.begin(); genIT != generalTriangleList.end(); genIT++ ) {
232  if ( alphaLengthInitialized ) {
233  minimalLength = min( ( * genIT )->giveShortestEdgeLength(), minimalLength );
234  } else {
235  minimalLength = ( * genIT )->giveShortestEdgeLength();
236  alphaLengthInitialized = true;
237  }
238 
239  int par1 = ( * genIT )->giveNode(1);
240  int par2 = ( * genIT )->giveNode(2);
241  int par3 = ( * genIT )->giveNode(3);
242  double ccRadius = ( * genIT )->giveCircumRadius();
243 
244  AlphaEdge2D *containedEdge;
245 
246  AlphaEdge2D *edge1 = new AlphaEdge2D( par1, par2, ( * genIT )->giveEdgeLength(1, 2) );
247 
248  containedEdge = giveBackEdgeIfAlreadyContainedInList(edge1);
249 
250  if ( containedEdge ) {
251  delete edge1;
252  containedEdge->setSharing( 2, ( * genIT ) );
253  double outAlph = containedEdge->giveOuterAlphaBound();
254  if ( ccRadius < outAlph ) {
255  containedEdge->setOuterAlphaBound(ccRadius);
256  }
257 
258  double innAlph = containedEdge->giveInnerAlphaBound();
259  if ( ccRadius > innAlph ) {
260  containedEdge->setInnerAlphaBound(ccRadius);
261  }
262 
263  containedEdge->setHullFlag(false);
264 
265  edgeList.push_back(containedEdge);
266  } else {
267  edge1->setOuterAlphaBound(ccRadius);
268  edge1->setInnerAlphaBound(ccRadius);
269  edge1->setHullFlag(true);
270 
271  edge1->setSharing( 1, ( * genIT ) );
272  edgeList.push_back(edge1);
273  }
274 
275  AlphaEdge2D *edge2 = new AlphaEdge2D( par2, par3, ( * genIT )->giveEdgeLength(2, 3) );
276 
277  containedEdge = giveBackEdgeIfAlreadyContainedInList(edge2);
278 
279  if ( containedEdge ) {
280  delete edge2;
281  containedEdge->setSharing( 2, ( * genIT ) );
282 
283  double outAlph = containedEdge->giveOuterAlphaBound();
284  if ( ccRadius < outAlph ) {
285  containedEdge->setOuterAlphaBound(ccRadius);
286  }
287 
288  double innAlph = containedEdge->giveInnerAlphaBound();
289  if ( ccRadius > innAlph ) {
290  containedEdge->setInnerAlphaBound(ccRadius);
291  }
292 
293  containedEdge->setHullFlag(false);
294 
295  edgeList.push_back(containedEdge);
296  } else {
297  edge2->setOuterAlphaBound(ccRadius);
298  edge2->setInnerAlphaBound(ccRadius);
299  edge2->setHullFlag(true);
300 
301  edge2->setSharing( 1, ( * genIT ) );
302  edgeList.push_back(edge2);
303  }
304 
305  AlphaEdge2D *edge3 = new AlphaEdge2D( par3, par1, ( * genIT )->giveEdgeLength(3, 1) );
306 
307  containedEdge = giveBackEdgeIfAlreadyContainedInList(edge3);
308 
309  if ( containedEdge ) {
310  delete edge3;
311  containedEdge->setSharing( 2, ( * genIT ) );
312 
313  double outAlph = containedEdge->giveOuterAlphaBound();
314  if ( ccRadius < outAlph ) {
315  containedEdge->setOuterAlphaBound(ccRadius);
316  }
317 
318  double innAlph = containedEdge->giveInnerAlphaBound();
319  if ( ccRadius > innAlph ) {
320  containedEdge->setInnerAlphaBound(ccRadius);
321  }
322 
323  containedEdge->setHullFlag(false);
324 
325  edgeList.push_back(containedEdge);
326  } else {
327  edge3->setOuterAlphaBound(ccRadius);
328  edge3->setInnerAlphaBound(ccRadius);
329  edge3->setHullFlag(true);
330 
331  edge3->setSharing( 1, ( * genIT ) );
332  edgeList.push_back(edge3);
333  }
334  }
335 
336  //alphaValue *= minimalLength;
337 }
338 
339 //gives back pointer from edgeList
342 {
343  AlphaEdge2D *foundEdge = NULL;
344 
345  if ( !edgeList.empty() ) {
346  for ( elIT = edgeList.begin(); elIT != edgeList.end(); ++elIT ) {
347  if ( ( * * elIT ) == ( * alphaEdge ) ) {
348  foundEdge = * elIT;
349  edgeList.erase(elIT);
350  break;
351  }
352  }
353  }
354 
355  return foundEdge;
356 }
357 
360 {
361  double outBound, innBound;
362 
363  for ( elIT = edgeList.begin(); elIT != edgeList.end(); elIT++ ) {
364  // Option 2 : setting bounds vor computed Alpha
365  //double alpha = max(min(alphaValue * (*elIT)->giveLength(), maxAlpha), minAlpha);
366  double alpha = alphaValue;
367  outBound = ( * elIT )->giveOuterAlphaBound();
368 
369  //innerBound = infinity
370  if ( ( * elIT )->giveHullFlag() ) {
371  if ( alpha > outBound ) {
372  alphaShapeEdgeList.push_back(* elIT);
373  } else {
374  //invalidating element
375  ( * elIT )->giveShared(1)->setValidFlag(false);
376  }
377  } else {
378  innBound = ( * elIT )->giveInnerAlphaBound();
379  if ( alpha > outBound && alpha < innBound ) {
380  alphaShapeEdgeList.push_back(* elIT);
381  if ( ( * elIT )->giveShared(1)->giveCircumRadius() > alpha ) {
382  ( * elIT )->giveShared(1)->setValidFlag(false);
383  } else {
384  ( * elIT )->giveShared(2)->setValidFlag(false);
385  }
386  }
387 
388  if ( alpha < outBound ) {
389  for ( int i = 1; i <= 2; i++ ) {
390  ( * elIT )->giveShared(i)->setValidFlag(false);
391  }
392  }
393  }
394  }
395 }
396 
397 void
399 {
400  this->meshingTimer.startTimer();
401  this->searchingTimer.startTimer();
402  this->searchingTimer.pauseTimer();
403  this->polygonTimer.startTimer();
404  this->polygonTimer.pauseTimer();
405  this->creativeTimer.startTimer();
406  this->creativeTimer.pauseTimer();
407 }
408 
409 void
410 DelaunayTriangulator :: findNonDelaunayTriangles(int insertedNode, InsertTriangleBasedOnCircumcircle &tInsert, std :: list< Edge2D > &polygon)
411 {
412  DofManager *dman = domain->giveDofManager(insertedNode);
413  FloatArray *nodeCoords = ( ( ( Node * ) dman )->giveCoordinates() );
414 
415  ElementCircumCirclesContainingNode findElements(nodeCoords, domain);
416  std :: list< DelaunayTriangle * >nonDelaunayTriangles;
417  std :: list< DelaunayTriangle * > :: iterator triangleIT;
418 
419  this->searchingTimer.resumeTimer();
420  triangleOctree.proceedDataOnFilterAndRemoveFromOctree(nonDelaunayTriangles, findElements, tInsert, searchingTimer);
421  this->searchingTimer.pauseTimer();
422 
423  this->polygonTimer.resumeTimer();
424  for ( triangleIT = nonDelaunayTriangles.begin(); triangleIT != nonDelaunayTriangles.end(); ++triangleIT ) {
425  DelaunayTriangle *triangle;
426  triangle = * triangleIT;
427  Edge2D *edge1 = new Edge2D( triangle->giveNode(1), triangle->giveNode(2) );
428  addUniqueEdgeToPolygon(edge1, polygon);
429 
430  Edge2D *edge2 = new Edge2D( triangle->giveNode(2), triangle->giveNode(3) );
431  addUniqueEdgeToPolygon(edge2, polygon);
432 
433  Edge2D *edge3 = new Edge2D( triangle->giveNode(3), triangle->giveNode(1) );
434  addUniqueEdgeToPolygon(edge3, polygon);
435 
436  triangle->setValidFlag(false);
437  }
438 
439  this->polygonTimer.pauseTimer();
440 }
441 
442 void
443 DelaunayTriangulator :: meshPolygon(int insertedNode, InsertTriangleBasedOnCircumcircle &tInsert, std :: list< Edge2D > &polygon)
444 {
445  std :: list< Edge2D > :: iterator polygonIT;
446  for ( polygonIT = polygon.begin(); polygonIT != polygon.end(); polygonIT++ ) {
447  DelaunayTriangle *newTriangle = new DelaunayTriangle(domain, ( * polygonIT ).giveFirstNodeNumber(), ( * polygonIT ).giveSecondNodeNumber(), insertedNode);
448 
449  this->creativeTimer.resumeTimer();
450  triangleOctree.insertMemberIntoOctree(newTriangle, tInsert);
451  this->creativeTimer.pauseTimer();
452 
453  generalTriangleList.push_back(newTriangle);
454  }
455 
456  polygon.clear();
457 }
458 
459 void
461 {
462  this->meshingTimer.stopTimer();
463  double _utime = this->meshingTimer.getUtime();
464 
465  this->searchingTimer.stopTimer();
466  double _searchutime = this->searchingTimer.getUtime();
467 
468  this->polygonTimer.stopTimer();
469  double _polygonutime = this->polygonTimer.getUtime();
470 
471  this->creativeTimer.stopTimer();
472  double _creativeutime = this->creativeTimer.getUtime();
473 
474  printf("\nUser time consumed by searching: %.3f [s]\n\n", _searchutime);
475  printf("\nUser time consumed by building insertion polygon: %.3f [s]\n\n", _polygonutime);
476  printf("\nUser time consumed by creating elements: %.3f [s]\n\n", _creativeutime);
477  printf("\nUser time consumed by meshing: %.3f [s]\n\n", _utime);
478 }
479 
480 void
482 {
483  for ( genIT = generalTriangleList.begin(); genIT != generalTriangleList.end(); ) {
484  int node1 = ( * genIT )->giveNode(1);
485  int node2 = ( * genIT )->giveNode(2);
486  int node3 = ( * genIT )->giveNode(3);
487 
488  if ( node1 == nnode + 1 || node1 == nnode + 2 || node1 == nnode + 3 || node1 == nnode + 4 ||
489  node2 == nnode + 1 || node2 == nnode + 2 || node2 == nnode + 3 || node2 == nnode + 4 ||
490  node3 == nnode + 1 || node3 == nnode + 2 || node3 == nnode + 3 || node3 == nnode + 4 ||
491  !( ( * genIT )->giveValidFlag() ) ) {
492  delete( * genIT );
494  } else {
495  genIT++;
496  }
497  }
498 }
499 
501 {
502  BoundingBox BBX;
503  this->computeBBXBasedOnNodeData(BBX);
504 
505  //int initialDivision = 5;
506  triangleOctree.init(BBX);
507 
508  FloatArray coords;
509 
510  Node *bottomLeftNode = new Node(nnode + 1, domain);
511  BBX.giveOrigin(coords);
512  double diff = BBX.giveSize();
513  for ( int ci = 1; ci <= 2; ci++ ) {
514  coords.at(ci) -= diff;
515  }
516 
517  bottomLeftNode->setCoordinates(coords);
518 
519  Node *bottomRightNode = new Node(nnode + 2, domain);
520  coords.at(1) += BBX.giveSize() + 2.0 * diff;
521  bottomRightNode->setCoordinates(coords);
522 
523  Node *topRightNode = new Node(nnode + 3, domain);
524  coords.at(2) += BBX.giveSize() + 2.0 * diff;
525  topRightNode->setCoordinates(coords);
526 
527  Node *topLeftNode = new Node(nnode + 4, domain);
528  coords.at(1) -= BBX.giveSize() + 2.0 * diff;
529  topLeftNode->setCoordinates(coords);
530 
532  domain->setDofManager(nnode + 1, bottomLeftNode);
533  domain->setDofManager(nnode + 2, bottomRightNode);
534  domain->setDofManager(nnode + 3, topRightNode);
535  domain->setDofManager(nnode + 4, topLeftNode);
536 
537  DelaunayTriangle *firstTriangle = new DelaunayTriangle(domain, nnode + 1, nnode + 2, nnode + 3);
538  generalTriangleList.push_back(firstTriangle);
539 
540  DelaunayTriangle *secondTriangle = new DelaunayTriangle(domain, nnode + 3, nnode + 4, nnode + 1);
541  generalTriangleList.push_back(secondTriangle);
542 
543 
544  triangleOctree.insertMemberIntoOctree(firstTriangle, tInsert);
545  triangleOctree.insertMemberIntoOctree(secondTriangle, tInsert);
546 }
547 
548 void
550 {
551  int i, j, init = 1, nnode = this->domain->giveNumberOfDofManagers();
552  double rootSize, resolutionLimit;
553  FloatArray minc(3), maxc(3), * coords;
554  DofManager *dman;
555 
556  // first determine domain extends (bounding box), and check for degenerated domain type
557  for ( i = 1; i <= nnode; i++ ) {
558  dman = domain->giveDofManager(i);
559  coords = static_cast< Node * >( dman )->giveCoordinates();
560  if ( init ) {
561  init = 0;
562  for ( j = 1; j <= coords->giveSize(); j++ ) {
563  minc.at(j) = maxc.at(j) = coords->at(j);
564  }
565  } else {
566  for ( j = 1; j <= coords->giveSize(); j++ ) {
567  if ( coords->at(j) < minc.at(j) ) {
568  minc.at(j) = coords->at(j);
569  }
570 
571  if ( coords->at(j) > maxc.at(j) ) {
572  maxc.at(j) = coords->at(j);
573  }
574  }
575  }
576  } // end loop over nodes
577 
578  BBX.setOrigin(minc);
579 
580  // determine root size
581  rootSize = 0.0;
582  for ( i = 1; i <= 3; i++ ) {
583  rootSize = 1.000001 * max( rootSize, maxc.at(i) - minc.at(i) );
584  }
585 
586  BBX.setSize(rootSize);
587 
588  // check for degenerated domain
589  resolutionLimit = min(1.e-3, rootSize / 1.e6);
590  for ( i = 1; i <= 3; i++ ) {
591  if ( ( maxc.at(i) - minc.at(i) ) > resolutionLimit ) {
592  BBX.setMask(i, 1);
593  } else {
594  BBX.setMask(i, 0);
595  }
596  }
597 }
598 
599 
600 } // end namespace oofem
int giveAssociatedCrossSectionNumber()
Returns number of cross section to be associated with created elements.
Definition: pfem.h:275
Squared bounding box for templated octree localizer.
void resizeDofManagers(int _newSize)
Resizes the internal data structure to accommodate space for _newSize dofManagers.
Definition: domain.C:444
This class is the implementation of triangular PFEM element with linear (and equal order) interpolati...
Definition: tr1_2d_pfem.h:68
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.
int giveNumberOfDofManagers() const
Returns number of dof managers in domain.
Definition: domain.h:432
Class for the boundary recognition method - alpha shape.
Definition: edge2d.h:77
int giveAssociatedMaterialNumber()
Returns number of material to be associated with created elements.
Definition: pfem.h:273
void setMask(int i, int mask)
Sets the spatial mask.
Timer meshingTimer
Measures overall time of triangulation procedure.
void resumeTimer()
Definition: timer.C:91
double & at(int i)
Coefficient access function.
Definition: floatarray.h:131
int max(int i, int j)
Returns bigger value form two given decimals.
Definition: mathfem.h:71
AlphaEdge2D * giveBackEdgeIfAlreadyContainedInList(AlphaEdge2D *alphaEdge)
Fills the edgeList with unique alphaEdges.
This class represents PFEM method for solving incompressible Navier-Stokes equations.
Definition: pfem.h:124
Edge class for Delaunay triangulation.
Definition: edge2d.h:49
void setSharing(int n, DelaunayTriangle *pTE)
Stores DelaunayTriangle sharing the receiver.
Definition: edge2d.C:70
EngngModel * giveEngngModel()
Returns engineering model to which receiver is associated.
Definition: domain.C:433
void computeAlphaComplex()
Reads the triangulation and fills tha edgeList container with alpha-shape edges and set their bounds...
Abstract base class for all finite elements.
Definition: element.h:145
Base class for dof managers.
Definition: dofmanager.h:113
void resizeElements(int _newSize)
Resizes the internal data structure to accommodate space for _newSize elements.
Definition: domain.C:445
void giveTimeReport()
Prints the time report.
virtual bool isActive()
Returns the activeFlag.
Definition: pfemparticle.h:94
std::list< DelaunayTriangle * > generalTriangleList
Contains all triangles (even not valid)
Class implementing an array of integers.
Definition: intarray.h:61
Delaunay triangle for the triangulation of a set of nodes.
virtual void setBcId(int bcId)
Overwrites the boundary condition id (0-inactive BC), intended for specific purposes such as coupling...
Definition: dof.h:382
Timer searchingTimer
Measures time needed by searching for non-delaunay triangles.
#define VERBOSE_PRINT0(str, number)
Definition: verbose.h:56
void setValidFlag(bool newFlag)
Sets the flag whether Delaunay condition is fulfilled.
Functor for finding triangles whose circumscribed circles contains given node.
std::list< AlphaEdge2D * > edgeList
contains all edges of the triangulation
std::list< DelaunayTriangle * >::iterator genIT
DofIDItem
Type representing particular dof type.
Definition: dofiditem.h:86
int giveAssociatedPressureBC()
Returns number of zero pressure boundary condition to be prescribed on free surface.
Definition: pfem.h:277
void buildInitialBBXMesh(InsertTriangleBasedOnCircumcircle &tInsert)
Identifies the bounding box of pfemparticles and creates initial triangulation consisting of 2 triang...
void setSize(double s)
Sets the size of the bounding box (all sides are equal)
void writeMesh()
Writes the mesh into the domain by creating new tr1_2d_pfem elements and prescribes zero-pressure bou...
void setInnerAlphaBound(double alphaMax)
Sets the inner limit.
Definition: edge2d.h:88
Timer creativeTimer
Measures time needed for creating new Delaunay triangles.
void setHullFlag(bool flag)
Sets the convex hull property.
Definition: edge2d.h:94
void findNonDelaunayTriangles(int insertedNode, InsertTriangleBasedOnCircumcircle &tInsert, std::list< Edge2D > &polygon)
Looks for non-Delaunay triangles in octree and creates a polygon.
double giveInnerAlphaBound()
Returns the inner limit.
Definition: edge2d.h:92
double giveOuterAlphaBound()
Returns the outer limit.
Definition: edge2d.h:90
void meshPolygon(int insertedNode, InsertTriangleBasedOnCircumcircle &tInsert, std::list< Edge2D > &polygon)
Retriangulates the polygon.
Initializes the variable VERBOSE, in order to get a few intermediate messages on screen: beginning an...
Class representing vector of real numbers.
Definition: floatarray.h:82
void pauseTimer()
Definition: timer.C:83
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.
void setCoordinates(FloatArray coords)
Sets node coordinates to given array.
Definition: node.h:126
void setDofManager(int i, DofManager *obj)
Sets i-th component. The component will be further managed and maintained by domain object...
Definition: domain.C:454
std::list< AlphaEdge2D * > alphaShapeEdgeList
Contains resulting alpha-shape in form of a list.
int giveNode(int i)
Gives the i-node of the triangle.
Dof * giveDofWithID(int dofID) const
Returns DOF with given dofID; issues error if not present.
Definition: dofmanager.C:119
void setElement(int i, Element *obj)
Sets i-th component. The component will be further managed and maintained by domain object...
Definition: domain.C:455
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...
Particle class being used in PFEM computations.
Definition: pfemparticle.h:56
void giveOrigin(FloatArray &answer)
Returns the bounding box origin.
int min(int i, int j)
Returns smaller value from two given decimals.
Definition: mathfem.h:59
int giveSize() const
Returns the size of receiver.
Definition: floatarray.h:218
Node * giveNode(int n)
Service for accessing particular domain node.
Definition: domain.h:371
the oofem namespace is to define a context or scope in which all oofem names are defined.
void setOuterAlphaBound(double alphaMin)
Sets the outer limit.
Definition: edge2d.h:86
Class implementing node in finite element mesh.
Definition: node.h:87
void giveAlphaShape()
Iterates through the edgeList container and compares alpha-value with alphaEdge bounds. Alpha shape is stored in the alphaShapeEdgeList.
Abstract class Dof represents Degree Of Freedom in finite element mesh.
Definition: dof.h:93
DofManager * giveDofManager(int n)
Service for accessing particular domain dof manager.
Definition: domain.C:314
double giveSize()
Gives the size of the bounding box.
DelaunayTriangulator(Domain *d, double setAlpha)
Constructor.
void startTimer()
Definition: timer.C:69
double getUtime()
Returns total user time elapsed in seconds.
Definition: timer.C:105
void stopTimer()
Definition: timer.C:77
void initializeTimers()
Initializes Timers and.
void setOrigin(FloatArray &coords)
Sets the origin of the bounding box.

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