Nektar++
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Classes | Namespaces | Macros | Typedefs | Enumerations
Triangle/Triangle.h File Reference
#include <boost/shared_ptr.hpp>
#include <LibUtilities/BasicUtils/SharedArray.hpp>
#include <LibUtilities/Memory/NekMemoryManager.hpp>
Include dependency graph for Triangle/Triangle.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  Nektar::NekMeshUtils::triangulateio
 
struct  Nektar::NekMeshUtils::otri
 
struct  Nektar::NekMeshUtils::osub
 
struct  Nektar::NekMeshUtils::badsubseg
 
struct  Nektar::NekMeshUtils::badtriang
 
struct  Nektar::NekMeshUtils::flipstacker
 
struct  Nektar::NekMeshUtils::event
 
struct  Nektar::NekMeshUtils::splaynode
 
struct  Nektar::NekMeshUtils::memorypool
 
struct  Nektar::NekMeshUtils::mesh
 
struct  Nektar::NekMeshUtils::behavior
 
class  Nektar::NekMeshUtils::DelaunayTriangle
 

Namespaces

 Nektar
 <
 
 Nektar::NekMeshUtils
 

Macros

#define TRIPERBLOCK   4092 /* Number of triangles allocated at once. */
 
#define SUBSEGPERBLOCK   508 /* Number of subsegments allocated at once. */
 
#define VERTEXPERBLOCK   4092 /* Number of vertices allocated at once. */
 
#define VIRUSPERBLOCK   1020 /* Number of virus triangles allocated at once. */
 
#define BADSUBSEGPERBLOCK   252
 
#define BADTRIPERBLOCK   4092
 
#define FLIPSTACKERPERBLOCK   252
 
#define SPLAYNODEPERBLOCK   508
 
#define INPUTVERTEX   0
 
#define SEGMENTVERTEX   1
 
#define FREEVERTEX   2
 
#define DEADVERTEX   -32768
 
#define UNDEADVERTEX   -32767
 
#define SAMPLEFACTOR   11
 
#define SAMPLERATE   10
 
#define PI   3.141592653589793238462643383279502884197169399375105820974944592308
 
#define SQUAREROOTTWO   1.4142135623730950488016887242096980785696718753769480732
 
#define ONETHIRD   0.333333333333333333333333333333333333333333333333333333333333
 
#define decode(ptr, otri)
 
#define encode(otri)   (triangle)((unsigned long)(otri).tri | (unsigned long)(otri).orient)
 
#define sym(otri1, otri2)
 
#define symself(otri)
 
#define lnext(otri1, otri2)
 
#define lnextself(otri)   (otri).orient = plus1mod3[(otri).orient]
 
#define lprev(otri1, otri2)
 
#define lprevself(otri)   (otri).orient = minus1mod3[(otri).orient]
 
#define onext(otri1, otri2)
 
#define onextself(otri)
 
#define oprev(otri1, otri2)
 
#define oprevself(otri)
 
#define dnext(otri1, otri2)
 
#define dnextself(otri)
 
#define dprev(otri1, otri2)
 
#define dprevself(otri)
 
#define rnext(otri1, otri2)
 
#define rnextself(otri)
 
#define rprev(otri1, otri2)
 
#define rprevself(otri)
 
#define org(otri, vertexptr)   vertexptr = (vertex)(otri).tri[plus1mod3[(otri).orient] + 3]
 
#define dest(otri, vertexptr)   vertexptr = (vertex)(otri).tri[minus1mod3[(otri).orient] + 3]
 
#define apex(otri, vertexptr)   vertexptr = (vertex)(otri).tri[(otri).orient + 3]
 
#define setorg(otri, vertexptr)   (otri).tri[plus1mod3[(otri).orient] + 3] = (triangle)vertexptr
 
#define setdest(otri, vertexptr)   (otri).tri[minus1mod3[(otri).orient] + 3] = (triangle)vertexptr
 
#define setapex(otri, vertexptr)   (otri).tri[(otri).orient + 3] = (triangle)vertexptr
 
#define bond(otri1, otri2)
 
#define dissolve(otri)   (otri).tri[(otri).orient] = (triangle)m->dummytri
 
#define otricopy(otri1, otri2)
 
#define otriequal(otri1, otri2)   (((otri1).tri == (otri2).tri) && ((otri1).orient == (otri2).orient))
 
#define infect(otri)   (otri).tri[6] = (triangle)((unsigned long)(otri).tri[6] | (unsigned long)2l)
 
#define uninfect(otri)
 
#define infected(otri)   (((unsigned long)(otri).tri[6] & (unsigned long)2l) != 0l)
 
#define elemattribute(otri, attnum)   ((double *)(otri).tri)[m->elemattribindex + (attnum)]
 
#define setelemattribute(otri, attnum, value)   ((double *)(otri).tri)[m->elemattribindex + (attnum)] = value
 
#define areabound(otri)   ((double *)(otri).tri)[m->areaboundindex]
 
#define setareabound(otri, value)   ((double *)(otri).tri)[m->areaboundindex] = value
 
#define deadtri(tria)   ((tria)[1] == (triangle)NULL)
 
#define killtri(tria)
 
#define sdecode(sptr, osub)
 
#define sencode(osub)   (subseg)((unsigned long)(osub).ss | (unsigned long)(osub).ssorient)
 
#define ssym(osub1, osub2)
 
#define ssymself(osub)   (osub).ssorient = 1 - (osub).ssorient
 
#define spivot(osub1, osub2)
 
#define spivotself(osub)
 
#define snext(osub1, osub2)
 
#define snextself(osub)
 
#define sorg(osub, vertexptr)   vertexptr = (vertex)(osub).ss[2 + (osub).ssorient]
 
#define sdest(osub, vertexptr)   vertexptr = (vertex)(osub).ss[3 - (osub).ssorient]
 
#define setsorg(osub, vertexptr)   (osub).ss[2 + (osub).ssorient] = (subseg)vertexptr
 
#define setsdest(osub, vertexptr)   (osub).ss[3 - (osub).ssorient] = (subseg)vertexptr
 
#define segorg(osub, vertexptr)   vertexptr = (vertex)(osub).ss[4 + (osub).ssorient]
 
#define segdest(osub, vertexptr)   vertexptr = (vertex)(osub).ss[5 - (osub).ssorient]
 
#define setsegorg(osub, vertexptr)   (osub).ss[4 + (osub).ssorient] = (subseg)vertexptr
 
#define setsegdest(osub, vertexptr)   (osub).ss[5 - (osub).ssorient] = (subseg)vertexptr
 
#define mark(osub)   (*(int *)((osub).ss + 8))
 
#define setmark(osub, value)   *(int *)((osub).ss + 8) = value
 
#define sbond(osub1, osub2)
 
#define sdissolve(osub)   (osub).ss[(osub).ssorient] = (subseg)m->dummysub
 
#define subsegcopy(osub1, osub2)
 
#define subsegequal(osub1, osub2)   (((osub1).ss == (osub2).ss) && ((osub1).ssorient == (osub2).ssorient))
 
#define deadsubseg(sub)   ((sub)[1] == (subseg)NULL)
 
#define killsubseg(sub)
 
#define tspivot(otri, osub)
 
#define stpivot(osub, otri)
 
#define tsbond(otri, osub)
 
#define tsdissolve(otri)   (otri).tri[6 + (otri).orient] = (triangle)m->dummysub
 
#define stdissolve(osub)   (osub).ss[6 + (osub).ssorient] = (subseg)m->dummytri
 
#define vertexmark(vx)   ((int *)(vx))[m->vertexmarkindex]
 
#define setvertexmark(vx, value)   ((int *)(vx))[m->vertexmarkindex] = value
 
#define vertextype(vx)   ((int *)(vx))[m->vertexmarkindex + 1]
 
#define setvertextype(vx, value)   ((int *)(vx))[m->vertexmarkindex + 1] = value
 
#define vertex2tri(vx)   ((triangle *)(vx))[m->vertex2triindex]
 
#define setvertex2tri(vx, value)   ((triangle *)(vx))[m->vertex2triindex] = value
 

Typedefs

typedef double ** Nektar::NekMeshUtils::triangle
 
typedef double ** Nektar::NekMeshUtils::subseg
 
typedef double * Nektar::NekMeshUtils::vertex
 

Enumerations

enum  Nektar::NekMeshUtils::locateresult { Nektar::NekMeshUtils::INTRIANGLE, Nektar::NekMeshUtils::ONEDGE, Nektar::NekMeshUtils::ONVERTEX, Nektar::NekMeshUtils::OUTSIDE }
 
enum  Nektar::NekMeshUtils::insertvertexresult { Nektar::NekMeshUtils::SUCCESSFULVERTEX, Nektar::NekMeshUtils::ENCROACHINGVERTEX, Nektar::NekMeshUtils::VIOLATINGVERTEX, Nektar::NekMeshUtils::DUPLICATEVERTEX }
 
enum  Nektar::NekMeshUtils::finddirectionresult { Nektar::NekMeshUtils::WITHIN, Nektar::NekMeshUtils::LEFTCOLLINEAR, Nektar::NekMeshUtils::RIGHTCOLLINEAR }
 

Macro Definition Documentation

#define apex (   otri,
  vertexptr 
)    vertexptr = (vertex)(otri).tri[(otri).orient + 3]
#define areabound (   otri)    ((double *)(otri).tri)[m->areaboundindex]

Definition at line 319 of file Triangle/Triangle.h.

#define BADSUBSEGPERBLOCK   252
#define BADTRIPERBLOCK   4092
#define bond (   otri1,
  otri2 
)
#define deadsubseg (   sub)    ((sub)[1] == (subseg)NULL)
#define deadtri (   tria)    ((tria)[1] == (triangle)NULL)
#define DEADVERTEX   -32768
#define decode (   ptr,
  otri 
)
Value:
(otri).orient = (int)((unsigned long)(ptr) & (unsigned long)3l); \
(otri).tri = \
(triangle *)((unsigned long)(ptr) ^ (unsigned long)(otri).orient)

Definition at line 130 of file Triangle/Triangle.h.

Referenced by Nektar::NekMeshUtils::DelaunayTriangle::insertsegment(), Nektar::NekMeshUtils::DelaunayTriangle::splittriangle(), and Nektar::NekMeshUtils::DelaunayTriangle::undovertex().

#define dest (   otri,
  vertexptr 
)    vertexptr = (vertex)(otri).tri[minus1mod3[(otri).orient] + 3]
#define dissolve (   otri)    (otri).tri[(otri).orient] = (triangle)m->dummytri
#define dnext (   otri1,
  otri2 
)
Value:
sym(otri1, otri2); \
lprevself(otri2);
#define sym(otri1, otri2)
#define lprevself(otri)

Definition at line 202 of file Triangle/Triangle.h.

Referenced by Nektar::NekMeshUtils::DelaunayTriangle::deletevertex(), and Nektar::NekMeshUtils::DelaunayTriangle::undovertex().

#define dnextself (   otri)
Value:
symself(otri); \
lprevself(otri);
#define symself(otri)
#define lprevself(otri)

Definition at line 206 of file Triangle/Triangle.h.

Referenced by Nektar::NekMeshUtils::DelaunayTriangle::testtriangle().

#define dprev (   otri1,
  otri2 
)
Value:
lnext(otri1, otri2); \
symself(otri2);
#define symself(otri)
#define lnext(otri1, otri2)

Definition at line 214 of file Triangle/Triangle.h.

Referenced by Nektar::NekMeshUtils::DelaunayTriangle::undovertex().

#define dprevself (   otri)
Value:
lnextself(otri); \
symself(otri);
#define lnextself(otri)
#define symself(otri)

Definition at line 218 of file Triangle/Triangle.h.

#define elemattribute (   otri,
  attnum 
)    ((double *)(otri).tri)[m->elemattribindex + (attnum)]
#define encode (   otri)    (triangle)((unsigned long)(otri).tri | (unsigned long)(otri).orient)
#define FLIPSTACKERPERBLOCK   252
#define FREEVERTEX   2
#define infect (   otri)    (otri).tri[6] = (triangle)((unsigned long)(otri).tri[6] | (unsigned long)2l)
#define infected (   otri)    (((unsigned long)(otri).tri[6] & (unsigned long)2l) != 0l)
#define INPUTVERTEX   0
#define killsubseg (   sub)
Value:
(sub)[1] = (subseg)NULL; \
(sub)[2] = (subseg)NULL

Definition at line 448 of file Triangle/Triangle.h.

Referenced by Nektar::NekMeshUtils::DelaunayTriangle::subsegdealloc().

#define killtri (   tria)
Value:
(tria)[1] = (triangle)NULL; \
(tria)[3] = (triangle)NULL

Definition at line 331 of file Triangle/Triangle.h.

Referenced by Nektar::NekMeshUtils::DelaunayTriangle::triangledealloc().

#define lnext (   otri1,
  otri2 
)
#define lnextself (   otri)    (otri).orient = plus1mod3[(otri).orient]
#define lprev (   otri1,
  otri2 
)
#define lprevself (   otri)    (otri).orient = minus1mod3[(otri).orient]
#define mark (   osub)    (*(int *)((osub).ss + 8))
#define ONETHIRD   0.333333333333333333333333333333333333333333333333333333333333

Definition at line 117 of file Triangle/Triangle.h.

#define onext (   otri1,
  otri2 
)
#define onextself (   otri)
#define oprev (   otri1,
  otri2 
)
#define oprevself (   otri)
#define org (   otri,
  vertexptr 
)    vertexptr = (vertex)(otri).tri[plus1mod3[(otri).orient] + 3]
#define otricopy (   otri1,
  otri2 
)
#define otriequal (   otri1,
  otri2 
)    (((otri1).tri == (otri2).tri) && ((otri1).orient == (otri2).orient))
#define PI   3.141592653589793238462643383279502884197169399375105820974944592308
#define rnext (   otri1,
  otri2 
)
Value:
sym(otri1, otri2); \
lnextself(otri2); \
symself(otri2);
#define sym(otri1, otri2)
#define lnextself(otri)
#define symself(otri)

Definition at line 226 of file Triangle/Triangle.h.

#define rnextself (   otri)
Value:
symself(otri); \
lnextself(otri); \
symself(otri);
#define lnextself(otri)
#define symself(otri)

Definition at line 231 of file Triangle/Triangle.h.

#define rprev (   otri1,
  otri2 
)
Value:
sym(otri1, otri2); \
lprevself(otri2); \
symself(otri2);
#define sym(otri1, otri2)
#define symself(otri)
#define lprevself(otri)

Definition at line 240 of file Triangle/Triangle.h.

#define rprevself (   otri)
Value:
symself(otri); \
lprevself(otri); \
symself(otri);
#define symself(otri)
#define lprevself(otri)

Definition at line 245 of file Triangle/Triangle.h.

#define SAMPLEFACTOR   11

Definition at line 99 of file Triangle/Triangle.h.

Referenced by Nektar::NekMeshUtils::DelaunayTriangle::locate().

#define SAMPLERATE   10

Definition at line 105 of file Triangle/Triangle.h.

#define sbond (   osub1,
  osub2 
)
Value:
(osub1).ss[(osub1).ssorient] = sencode(osub2); \
(osub2).ss[(osub2).ssorient] = sencode(osub1)
#define sencode(osub)

Definition at line 421 of file Triangle/Triangle.h.

Referenced by Nektar::NekMeshUtils::DelaunayTriangle::insertvertex().

#define sdecode (   sptr,
  osub 
)
Value:
(osub).ssorient = (int)((unsigned long)(sptr) & (unsigned long)1l); \
(osub).ss = (subseg *)((unsigned long)(sptr) & ~(unsigned long)3l)

Definition at line 344 of file Triangle/Triangle.h.

Referenced by Nektar::NekMeshUtils::DelaunayTriangle::splitencsegs().

#define sdest (   osub,
  vertexptr 
)    vertexptr = (vertex)(osub).ss[3 - (osub).ssorient]
#define sdissolve (   osub)    (osub).ss[(osub).ssorient] = (subseg)m->dummysub
#define segdest (   osub,
  vertexptr 
)    vertexptr = (vertex)(osub).ss[5 - (osub).ssorient]
#define SEGMENTVERTEX   1
#define segorg (   osub,
  vertexptr 
)    vertexptr = (vertex)(osub).ss[4 + (osub).ssorient]
#define sencode (   osub)    (subseg)((unsigned long)(osub).ss | (unsigned long)(osub).ssorient)
#define setapex (   otri,
  vertexptr 
)    (otri).tri[(otri).orient + 3] = (triangle)vertexptr
#define setareabound (   otri,
  value 
)    ((double *)(otri).tri)[m->areaboundindex] = value

Definition at line 321 of file Triangle/Triangle.h.

#define setdest (   otri,
  vertexptr 
)    (otri).tri[minus1mod3[(otri).orient] + 3] = (triangle)vertexptr
#define setelemattribute (   otri,
  attnum,
  value 
)    ((double *)(otri).tri)[m->elemattribindex + (attnum)] = value
#define setmark (   osub,
  value 
)    *(int *)((osub).ss + 8) = value
#define setorg (   otri,
  vertexptr 
)    (otri).tri[plus1mod3[(otri).orient] + 3] = (triangle)vertexptr
#define setsdest (   osub,
  vertexptr 
)    (osub).ss[3 - (osub).ssorient] = (subseg)vertexptr
#define setsegdest (   osub,
  vertexptr 
)    (osub).ss[5 - (osub).ssorient] = (subseg)vertexptr
#define setsegorg (   osub,
  vertexptr 
)    (osub).ss[4 + (osub).ssorient] = (subseg)vertexptr
#define setsorg (   osub,
  vertexptr 
)    (osub).ss[2 + (osub).ssorient] = (subseg)vertexptr
#define setvertex2tri (   vx,
  value 
)    ((triangle *)(vx))[m->vertex2triindex] = value
#define setvertexmark (   vx,
  value 
)    ((int *)(vx))[m->vertexmarkindex] = value
#define setvertextype (   vx,
  value 
)    ((int *)(vx))[m->vertexmarkindex + 1] = value
#define snext (   osub1,
  osub2 
)
Value:
sptr = (osub1).ss[1 - (osub1).ssorient]; \
sdecode(sptr, osub2)
#define sdecode(sptr, osub)

Definition at line 377 of file Triangle/Triangle.h.

#define snextself (   osub)
Value:
sptr = (osub).ss[1 - (osub).ssorient]; \
sdecode(sptr, osub)
#define sdecode(sptr, osub)

Definition at line 381 of file Triangle/Triangle.h.

Referenced by Nektar::NekMeshUtils::DelaunayTriangle::segmentintersection(), and Nektar::NekMeshUtils::DelaunayTriangle::splitencsegs().

#define sorg (   osub,
  vertexptr 
)    vertexptr = (vertex)(osub).ss[2 + (osub).ssorient]
#define spivot (   osub1,
  osub2 
)
Value:
sptr = (osub1).ss[(osub1).ssorient]; \
sdecode(sptr, osub2)
#define sdecode(sptr, osub)

Definition at line 366 of file Triangle/Triangle.h.

Referenced by Nektar::NekMeshUtils::DelaunayTriangle::insertvertex(), and Nektar::NekMeshUtils::DelaunayTriangle::segmentintersection().

#define spivotself (   osub)
Value:
sptr = (osub).ss[(osub).ssorient]; \
sdecode(sptr, osub)
#define sdecode(sptr, osub)

Definition at line 370 of file Triangle/Triangle.h.

#define SPLAYNODEPERBLOCK   508

Definition at line 81 of file Triangle/Triangle.h.

#define SQUAREROOTTWO   1.4142135623730950488016887242096980785696718753769480732
#define ssym (   osub1,
  osub2 
)
Value:
(osub2).ss = (osub1).ss; \
(osub2).ssorient = 1 - (osub1).ssorient

Definition at line 357 of file Triangle/Triangle.h.

Referenced by Nektar::NekMeshUtils::DelaunayTriangle::checkseg4encroach().

#define ssymself (   osub)    (osub).ssorient = 1 - (osub).ssorient
#define stdissolve (   osub)    (osub).ss[6 + (osub).ssorient] = (subseg)m->dummytri

Definition at line 481 of file Triangle/Triangle.h.

Referenced by Nektar::NekMeshUtils::DelaunayTriangle::plague().

#define stpivot (   osub,
  otri 
)
Value:
ptr = (triangle)(osub).ss[6 + (osub).ssorient]; \
decode(ptr, otri)
#define decode(ptr, otri)

Definition at line 465 of file Triangle/Triangle.h.

Referenced by Nektar::NekMeshUtils::DelaunayTriangle::checkseg4encroach(), and Nektar::NekMeshUtils::DelaunayTriangle::splitencsegs().

#define subsegcopy (   osub1,
  osub2 
)
Value:
(osub2).ss = (osub1).ss; \
(osub2).ssorient = (osub1).ssorient

Definition at line 432 of file Triangle/Triangle.h.

#define subsegequal (   osub1,
  osub2 
)    (((osub1).ss == (osub2).ss) && ((osub1).ssorient == (osub2).ssorient))

Definition at line 438 of file Triangle/Triangle.h.

#define SUBSEGPERBLOCK   508 /* Number of subsegments allocated at once. */
#define sym (   otri1,
  otri2 
)
#define symself (   otri)
#define TRIPERBLOCK   4092 /* Number of triangles allocated at once. */
#define tsbond (   otri,
  osub 
)
#define tsdissolve (   otri)    (otri).tri[6 + (otri).orient] = (triangle)m->dummysub
#define tspivot (   otri,
  osub 
)
#define UNDEADVERTEX   -32767
#define uninfect (   otri)
Value:
(otri).tri[6] = \
(triangle)((unsigned long)(otri).tri[6] & ~(unsigned long)2l)

Definition at line 300 of file Triangle/Triangle.h.

Referenced by Nektar::NekMeshUtils::DelaunayTriangle::plague(), and Nektar::NekMeshUtils::DelaunayTriangle::regionplague().

#define vertex2tri (   vx)    ((triangle *)(vx))[m->vertex2triindex]
#define vertexmark (   vx)    ((int *)(vx))[m->vertexmarkindex]
#define VERTEXPERBLOCK   4092 /* Number of vertices allocated at once. */
#define vertextype (   vx)    ((int *)(vx))[m->vertexmarkindex + 1]
#define VIRUSPERBLOCK   1020 /* Number of virus triangles allocated at once. */