gmsh-TingyuanDoc
0.1
An Open-Source Timing-driven Analytical Mixed-size FPGA Placer
|
Go to the documentation of this file.
445 void poolinit(
int sizeofobject,
int log2objperblk);
447 void *
lookup(
int objectindex);
450 arraypool(
int sizeofobject,
int log2objperblk);
458 #define fastlookup(pool, index) \
459 (void *)((pool)->toparray[(index) >> (pool)->log2objectsperblock] + \
460 ((index) & (pool)->objectsperblockmark) * (pool)->objectbytes)
1118 int intflag,
int *types,
int *poss);
1252 int chkencflag = 0);
1431 if(
bgm != NULL) {
delete bgm; }
1546 printf(
"Error: Out of memory.\n");
1549 printf(
"Please report this bug to Hang.Si@wias-berlin.de. Include\n");
1550 printf(
" the message above, your input data set, and the exact\n");
1551 printf(
" command line you used to run this program, thank you.\n");
1554 printf(
"A self-intersection was detected. Program stopped.\n");
1555 printf(
"Hint: use -d option to detect all self-intersections.\n");
1558 printf(
"A very small input feature size was detected. Program stopped.\n");
1560 printf(
"Hint: use -T option to set a smaller tolerance. Current is %g\n",
1565 printf(
"Two very close input facets were detected. Program stopped.\n");
1566 printf(
"Hint: use -Y option to avoid adding Steiner points in boundary.\n");
1568 case 10: printf(
"An input error was detected. Program stopped.\n");
break;
1571 #endif // #ifdef TETLIBRARY
1586 return (
tetrahedron)((uintptr_t)(t).tet | (uintptr_t)(t).ver);
1591 return (
tetrahedron)((uintptr_t)(ptr) | (uintptr_t)(ver));
1599 (t).ver = (
int)((uintptr_t)(ptr) & (uintptr_t)15);
1600 (t).tet = (
tetrahedron *)((uintptr_t)(ptr) ^ (uintptr_t)(t).ver);
1641 (t2).tet = (t1).tet;
1703 decode((t1).tet[(t1).ver & 3], t2);
1707 #define fsymself(t) \
1709 decode((t).tet[(t).ver & 3], (t)); \
1710 (t).ver = fsymtbl[t1ver][(t).ver]
1722 #define fnextself(t) \
1724 decode((t).tet[facepivot1[(t).ver]], (t)); \
1725 (t).ver = facepivot2[t1ver][(t).ver]
1770 #define setvertices(t, torg, tdest, tapex, toppo) \
1771 (t).tet[orgpivot[(t).ver]] = (tetrahedron)(torg); \
1772 (t).tet[destpivot[(t).ver]] = (tetrahedron)(tdest); \
1773 (t).tet[apexpivot[(t).ver]] = (tetrahedron)(tapex); \
1774 (t).tet[oppopivot[(t).ver]] = (tetrahedron)(toppo)
1806 int *iptr = (
int *)&(ptr[10]);
1812 int *iptr = (
int *)&(ptr[10]);
1965 return ((t.
tet == NULL) || (t.
tet[4] == NULL));
1984 s.
shver = (int)((uintptr_t)(sptr) & (uintptr_t)7);
1995 return (
shellface)((uintptr_t)sh | (uintptr_t)shver);
2069 #define setshvertices(s, pa, pb, pc) \
2150 return (((
int *)((s).sh))[
shmarkindex + 1] & (
int)1) != 0;
2170 return ((((
int *)((s).sh))[
shmarkindex + 1] & (
int)2) != 0);
2190 return ((((
int *)((s).sh))[
shmarkindex + 1] & (
int)4) != 0);
2209 return ((((
int *)((s).sh))[
shmarkindex + 1] & (
int)8) != 0);
2239 if((t).tet[9] == NULL) {
2243 for(
int i = 0; i < 4; i++) { ((
shellface *)(t).tet[9])[i] = NULL; }
2246 ((
shellface *)(t).tet[9])[(t).ver & 3] =
2249 s.
sh[9 + ((s).shver & 1)] =
2260 if((t).tet[9] == NULL) {
2270 #define issubface(t) ((t).tet[9] && ((t).tet[9])[(t).ver & 3])
2279 if((t).tet == NULL) {
return; }
2285 #define isshtet(s) ((s).sh[9 + ((s).shver & 1)])
2291 if((t).tet[9] != NULL) { ((
shellface *)(t).tet[9])[(t).ver & 3] = NULL; }
2335 #define isshsubseg(s) ((s).sh[6 + ((s).shver >> 1)])
2345 if((t).tet[8] == NULL) {
2349 for(
int i = 0; i < 6; i++) { ((
shellface *)(t).tet[8])[i] = NULL; }
2361 if((t).tet[8] != NULL) {
2373 if((t).tet[8] != NULL) {
2383 #define issubseg(t) ((t).tet[8] && ((t).tet[8])[ver2edge[(t).ver]])
2416 ((
int)value << 8) + (((
int *)(pt))[
pointmarkindex + 1] & (int)255);
2574 if((
point)searchtet.
tet[4] == pa) { searchtet.
ver = 11; }
2575 else if((
point)searchtet.
tet[5] == pa) {
2578 else if((
point)searchtet.
tet[6] == pa) {
2591 if((
point)searchsh.
sh[3] == pa) { searchsh.
shver = 0; }
2592 else if((
point)searchsh.
sh[4] == pa) {
2593 searchsh.
shver = (searchsh.
sh[5] != NULL ? 2 : 1);
2605 face travesh, neighsh;
2611 if(neighsh.
sh == NULL)
break;
2615 return sorg(travesh);
2620 face travesh, neighsh;
2624 senext(travesh, neighsh);
2626 if(neighsh.
sh == NULL)
break;
2628 senext(neighsh, travesh);
2630 return sdest(travesh);
2642 return v1[0] * v2[0] + v1[1] * v2[1] + v1[2] * v2[2];
2648 n[0] = v1[1] * v2[2] - v2[1] * v1[2];
2649 n[1] = -(v1[0] * v2[2] - v2[0] * v1[2]);
2650 n[2] = v1[0] * v2[1] - v2[0] * v1[1];
2656 return sqrt((p2[0] - p1[0]) * (p2[0] - p1[0]) +
2657 (p2[1] - p1[1]) * (p2[1] - p1[1]) +
2658 (p2[2] - p1[2]) * (p2[2] - p1[2]));
2663 return (x) * (x) + (y) * (y) + (
z) * (
z);
void setfacetindex(face &f, int value)
static selfint_event sevent
bool facemarked(triface &t)
static int stbondtbl[12][6]
void tspivot(triface &t, face &s)
void enextself(triface &t)
void esym(triface &t1, triface &t2)
bool pmarktested(point pt)
REAL facet_overlap_ang_tol
bool smarktested(face &s)
arraypool * cavesegshlist
void sesym(face &s1, face &s2)
REAL incircle3d(point pa, point pb, point pc, point pd)
void enextesym(triface &t1, triface &t2)
bool issteinerpoint(point pt)
shellface * shellfacetraverse(memorypool *)
void sdecode(shellface sptr, face &s)
void projpt2edge(REAL *p, REAL *e1, REAL *e2, REAL *prj)
void edestoppoself(triface &t)
bool lu_decmp(REAL lu[4][4], int n, int *ps, REAL *d, int N)
void randomsample(point searchpt, triface *searchtet)
REAL interiorangle(REAL *o, REAL *p1, REAL *p2, REAL *n)
void unmarktest(triface &t)
void scarveholes(int, REAL *)
void makeindex2pointmap(point *&)
static int fsymtbl[12][12]
int incrementalflip(point newpt, int, flipconstraints *fc)
enum locateresult locate(point searchpt, triface *searchtet, int chkencflag=0)
char bgmeshfilename[1024]
REAL volumebound(tetrahedron *ptr)
shellface sencode(face &s)
void setorg(triface &t, point p)
int hilbert_split(point *vertexarray, int arraysize, int gc0, int gc1, REAL, REAL, REAL, REAL, REAL, REAL)
void sspivot(face &s, face &edge)
int flipnm(triface *, int n, int level, int, flipconstraints *fc)
arraypool * cavetetseglist
void poolinit(int, int, int, int)
enum tetgenbehavior::objecttype object
void fnextself(triface &t)
void hilbert_sort3(point *vertexarray, int arraysize, int e, int d, REAL, REAL, REAL, REAL, REAL, REAL, int depth)
void flip22(face *, int, int)
void flip41(triface *, int, flipconstraints *fc)
int tri_edge_test(point, point, point, point, point, point, int, int *, int *)
bool smarktest2ed(face &s)
static int edestoppotbl[12]
shellface point2sh(point pt)
static double c(int i, int j, fullMatrix< double > &CA, const std::vector< SPoint3 > &P, const std::vector< SPoint3 > &Q)
bool orthosphere(REAL *, REAL *, REAL *, REAL *, REAL, REAL, REAL, REAL, REAL *, REAL *)
void makeshellface(memorypool *, face *)
void incrementaldelaunay(clock_t &)
int recoveredgebyflips(point, point, face *, triface *, int fullsearch)
void tetrahedrondealloc(tetrahedron *)
void unmarktest2(triface &t)
unsigned long randomnation(unsigned int choices)
void tssbond1(triface &t, face &seg)
void f(int n, double u, double *val)
int report_selfint_face(point, point, point, face *sface, triface *iedge, int intflag, int *types, int *poss)
void decreaseelemcounter(triface &t)
int recoverfacebyflips(point, point, point, face *, triface *)
face & operator=(const face &s)
int tri_tri_inter(point, point, point, point, point, point)
void poolinit(int sizeofobject, int log2objperblk)
void lu_solve(REAL lu[4][4], int n, int *ps, REAL *b, int N)
void tetallnormal(point, point, point, point, REAL N[4][3], REAL *volume)
bool calculateabovepoint(arraypool *, point *, point *, point *)
int flipnm_post(triface *, int n, int nn, int, flipconstraints *fc)
void setpointinsradius(point pt, REAL value)
void increaseelemcounter(triface &t)
void calculateabovepoint4(point, point, point, point)
int elemindex(tetrahedron *ptr)
void marktest2(triface &t)
unsigned long totalmemory
int linelineint(REAL *, REAL *, REAL *, REAL *, REAL *, REAL *, REAL *, REAL *)
void outsurfacemesh(const char *mfilename)
void decode(tetrahedron ptr, triface &t)
void marktest(triface &t)
static int tspivottbl[12][6]
memorypool * badtetrahedrons
tetrahedron encode(triface &t)
void setpoint2sh(point pt, shellface value)
tetrahedron encode2(tetrahedron *ptr, int ver)
tetrahedron * tetrahedrontraverse()
void setdest(triface &t, point p)
void dissolve(triface &t)
void edestoppo(triface &t1, triface &t2)
bool isdeadtet(triface &t)
void setapex(triface &t, point p)
void report_overlapping_facets(face *, face *, REAL dihedang=0.0)
unsigned long totalworkmemory
void esymself(triface &t)
arraypool * caveencseglist
REAL tetaspectratio(point, point, point, point)
REAL orient3dfast(REAL *pa, REAL *pb, REAL *pc, REAL *pd)
int insertpoint(point, triface *, face *, face *, insertvertexflags *)
int suppresssteinerpoints()
enum interresult sscoutsegment(face *, point, int, int, int)
REAL insphere_s(REAL *, REAL *, REAL *, REAL *, REAL *)
enum locateresult slocate(point, face *, int, int, int)
void setpoint2bgmtet(point pt, tetrahedron value)
REAL distance(REAL *p1, REAL *p2)
void setvolumebound(tetrahedron *ptr, REAL value)
void setpointmark(point pt, int value)
void ssbond1(face &s, face &edge)
point point2ppt(point pt)
REAL elemattribute(tetrahedron *ptr, int attnum)
bool edgemarked(triface &t)
void setelemattribute(tetrahedron *ptr, int attnum, REAL value)
void fc(int n, double u, double *val)
void setpointtype(point pt, enum verttype value)
char * getblock(int objectindex)
void setshellmark(face &s, int value)
void makepoint(point *, enum verttype)
void eprevesymself(triface &t)
static int facepivot1[12]
void sbond(face &s1, face &s2)
point * facetverticeslist
void setsorg(face &s, point pointptr)
void enqueuesubface(memorypool *, face *)
bool marktested(triface &t)
void tsbond(triface &t, face &s)
void sunmarktest3(face &s)
int suppressbdrysteinerpoint(point steinerpt)
int splitsliver(triface *, REAL, int)
void terminatetetgen(tetgenmesh *m, int x)
void pmarktest3(point pt)
int report_selfint_edge(point, point, face *sedge, triface *searchtet, enum interresult)
bool infected(triface &t)
bool circumsphere(REAL *, REAL *, REAL *, REAL *, REAL *cent, REAL *radius)
enum verttype pointtype(point pt)
void pmarktest2(point pt)
void setelemmarker(tetrahedron *ptr, int value)
void uninfect(triface &t)
bool reconstructmesh(void *)
int recoversegments(arraypool *, int fullsearch, int steinerflag)
void initializetetgenmesh()
void setelemindex(tetrahedron *ptr, int value)
void tsspivot1(triface &t, face &s)
static int stpivottbl[12][6]
void unmarkedge(triface &t)
void enqueuetetrahedron(triface *)
static int bondtbl[12][12]
int newindex(void **newptr)
int remove_ndelaunay_edge
long improvequalitybysmoothing(optparameters *opm)
void flip23(triface *, int, flipconstraints *fc)
void ssbond(face &s, face &edge)
void facenormal(point pa, point pb, point pc, REAL *n, int pivot, REAL *lav)
void setsdest(face &s, point pointptr)
void initialdelaunay(point pa, point pb, point pc, point pd)
void senext2self(face &s)
void setpointgeomtag(point pt, int value)
void eorgoppo(triface &t1, triface &t2)
int removefacebyflips(triface *, flipconstraints *)
void punmarktest2(point pt)
void identifyinputedges(point *)
tetrahedron point2bgmtet(point pt)
void setelemcounter(triface &t, int value)
void stpivot(face &s, triface &t)
REAL orient4d_s(REAL *, REAL *, REAL *, REAL *, REAL *, REAL, REAL, REAL, REAL, REAL)
void projpt2face(REAL *p, REAL *f1, REAL *f2, REAL *f3, REAL *prj)
bool marktest2ed(triface &t)
void flippush(badface *&, triface *)
void sstpivot1(face &s, triface &t)
int sinsertvertex(point newpt, face *, face *, int iloc, int bowywat, int)
int sremovevertex(point delpt, face *, face *, int lawson)
void unmarkface(triface &t)
void enext(triface &t1, triface &t2)
void bond(triface &t1, triface &t2)
long improvequalitybyflips()
static int tsbondtbl[12][6]
int elemmarker(tetrahedron *ptr)
void sstdissolve1(face &s)
REAL dot(REAL *v1, REAL *v2)
void shellfacedealloc(memorypool *, shellface *)
void sunmarktest2(face &s)
int removevertexbyflips(point steinerpt)
int removeedgebyflips(triface *, flipconstraints *)
void setoppo(triface &t, point p)
int tri_edge_inter_tail(point, point, point, point, point, REAL, REAL)
void setpointgeomuv(point pt, int i, REAL value)
REAL norm2(REAL x, REAL y, REAL z)
void tsdissolve(triface &t)
int add_steinerpt_in_segment(face *, int searchlevel)
void fnext(triface &t1, triface &t2)
bool pmarktest3ed(point pt)
void markface(triface &t)
void point2tetorg(point pt, triface &t)
void senext(face &s1, face &s2)
int recoversubfaces(arraypool *, int steinerflag)
void flip32(triface *, int, flipconstraints *fc)
static int eprevesymtbl[12]
enum interresult finddirection(triface *searchtet, point endpt)
void fsym(triface &t1, triface &t2)
bool parse_commandline(char *switches)
int pointgeomtag(point pt)
static int facepivot2[12][12]
int getedge(point, point, triface *)
int getvertexstar(int, point searchpt, arraypool *, arraypool *, arraypool *)
void punmarktest3(point pt)
void sbond1(face &s1, face &s2)
void eprevself(triface &t)
void sunmarktest(face &s)
void eorgoppoself(triface &t)
void senext2(face &s1, face &s2)
void outmesh2medit(const char *mfilename)
int addsteiner4recoversegment(face *, int)
int reduceedgesatvertex(point startpt, arraypool *endptlist)
void tssdissolve1(triface &t)
REAL getpointinsradius(point pt)
void * lookup(int objectindex)
int getfacetindex(face &f)
void punmarktest(point pt)
static int eorgoppotbl[12]
int add_steinerpt_in_schoenhardtpoly(triface *, int, int chkencflag)
void setareabound(face &s, REAL value)
arraypool * caveencshlist
void point2shorg(point pa, face &s)
bool parse_commandline(int argc, char **argv)
void enextesymself(triface &t)
void setsapex(face &s, point pointptr)
shellface sencode2(shellface *sh, int shver)
REAL pointgeomuv(point pt, int i)
tetrahedron point2tet(point pt)
arraypool * cavetetshlist
REAL triarea(REAL *pa, REAL *pb, REAL *pc)
static int enextesymtbl[12]
triface & operator=(const triface &t)
void setpoint2ppt(point pt, point value)
REAL shortdistance(REAL *p, REAL *e1, REAL *e2)
int tri_edge_tail(point, point, point, point, point, point, REAL, REAL, int, int *, int *)
void fsymself(triface &t)
void markedge(triface &t)
void setpoint2tet(point pt, tetrahedron value)
bool ishulltet(triface &t)
arraypool * cavetetvertlist
REAL tetprismvol(REAL *pa, REAL *pb, REAL *pc, REAL *pd)
void cross(REAL *v1, REAL *v2, REAL *n)
int tri_edge_2d(point, point, point, point, point, point, int, int *, int *)
bool pmarktest2ed(point pt)
arraypool(int sizeofobject, int log2objperblk)
bool tetalldihedral(point, point, point, point, REAL *, REAL *, REAL *)
long lawsonflip3d(flipconstraints *fc)
bool smarktest3ed(face &s)
memorypool * tetrahedrons
void eprev(triface &t1, triface &t2)
void recoverboundary(clock_t &)
void brio_multiscale_sort(point *, int, int threshold, REAL ratio, int *depth)
REAL facet_separate_ang_tol
point * segmentendpointslist
int elemcounter(triface &t)
void makepoint2submap(memorypool *, int *&, face *&)
void sstbond1(face &s, triface &t)
int smoothpoint(point smtpt, arraypool *, int ccw, optparameters *opm)
tetrahedron * alltetrahedrontraverse()
arraypool * caveoldtetlist
point farsdest(face &seg)
void spivot(face &s1, face &s2)
void eprevesym(triface &t1, triface &t2)
int gettetrahedron(point, point, point, point, triface *)
void maketetrahedron(triface *)
void planelineint(REAL *, REAL *, REAL *, REAL *, REAL *, REAL *, REAL *)
void insertpoint_abort(face *, insertvertexflags *)
int checkflipeligibility(int fliptype, point, point, point, point, point, int level, int edgepivot, flipconstraints *fc)