00001
00053 #ifndef _VES_H_
00054 #define _VES_H_
00055
00056 #include <mc/mc_base.h>
00057
00058 #include <mc/vel.h>
00059
00060
00061
00062
00063
00064
00065
00071 struct sVV {
00073 Gip g;
00075 Vip d;
00076 };
00077
00083 typedef struct sVV VV;
00084
00090 struct sEE {
00092 Gip g;
00094 Eip d;
00095 };
00096
00102 typedef struct sEE EE;
00103
00109 struct sFF {
00111 Gip g;
00113 Fip d;
00114 };
00115
00121 typedef struct sFF FF;
00122
00128 struct sSS {
00130 Gip g;
00132 Sip d;
00133 };
00134
00140 typedef struct sSS SS;
00141
00142
00148 typedef struct TT {
00149
00151 int gchart;
00153 int chart[4];
00154
00156 double D;
00158 double Dcook;
00160 double faceD[4];
00161
00163 double ff[3][3];
00165 double bb[3];
00167 double gg[3][3];
00169 double cc[3];
00170
00172 int loc[4][3];
00174 double vx[4][3];
00176 double nvec[4][3];
00178 double evec[6][3];
00180 double elen[6];
00182 double bc[4];
00183
00185 int dimV;
00187 int dimE;
00189 int dimF;
00191 int dimS;
00192
00194 int sid;
00196 int vid[4];
00198 int fid[4];
00200 int eid[6];
00201
00203 int stype;
00205 int vtype[4];
00207 int ftype[4];
00209 int etype[6];
00210
00212 SS *s;
00214 VV *v[4];
00215
00217 double phi[4], phix[4][3];
00218
00220 int focusFace, focusIV, focusIW;
00221 } TT;
00222
00223
00224
00225
00226
00227
00228
00229 #if !defined(VINLINE_GEM)
00230
00240 void VV_init(VV *thee, int dim, int id);
00241
00250 void VV_reinit(VV *thee);
00251
00261 void VV_setReality(VV *thee, int type);
00262
00272 void VV_setDim(VV *thee, int dim);
00273
00283 void VV_setClass(VV *thee, int type);
00284
00294 void VV_setType(VV *thee, int type);
00295
00305 void VV_setChart(VV *thee, int chart);
00306
00316 void VV_setId(VV *thee, int id);
00317
00326 unsigned int VV_reality(VV *thee);
00327
00336 unsigned int VV_dim(VV *thee);
00337
00346 unsigned int VV_dimVV(VV *thee);
00347
00356 unsigned int VV_dimEE(VV *thee);
00357
00366 unsigned int VV_dimFF(VV *thee);
00367
00376 unsigned int VV_class(VV *thee);
00377
00386 unsigned int VV_type(VV *thee);
00387
00396 unsigned int VV_chart(VV *thee);
00397
00406 unsigned int VV_id(VV *thee);
00407
00418 void VV_setCoord(VV *thee, int i, double val);
00419
00429 void VV_setFirstEE(VV *thee, EE *eg);
00430
00440 void VV_setFirstSS(VV *thee, SS *sm);
00441
00451 void VV_setParentEE(VV *thee, EE *eg);
00452
00462 double VV_coord(VV *thee, int i);
00463
00472 EE* VV_firstEE(VV *thee);
00473
00482 SS* VV_firstSS(VV *thee);
00483
00492 EE* VV_parentEE(VV *thee);
00493
00503 void VV_addEdgeToRing(VV *thee, EE *eg);
00504
00514 void VV_addSimplexToRing(VV *thee, SS *sm);
00515 #else
00516
00517 # define VV_init(thee,dim,id) ( \
00518 (thee)->d.ePtr = VNULL, \
00519 (thee)->d.sPtr = VNULL, \
00520 (thee)->d.x[0] = 0.0, \
00521 (thee)->d.x[1] = 0.0, \
00522 (thee)->d.x[2] = 0.0, \
00523 Vel_init((Vel*)(thee), dim, id) \
00524 )
00525
00526 # define VV_reinit(thee) ( \
00527 (thee)->d.ePtr = VNULL, \
00528 (thee)->d.sPtr = VNULL, \
00529 (thee)->d.x[0] = 0.0, \
00530 (thee)->d.x[1] = 0.0, \
00531 (thee)->d.x[2] = 0.0, \
00532 Vel_reinit((Vel*)(thee)) \
00533 )
00534
00536 # define VV_setReality(thee,reel) Vel_setReality( (Vel*)(thee), (reel) )
00537
00538 # define VV_setDim(thee,dim) Vel_setDim( (Vel*)(thee), (dim) )
00539
00540 # define VV_setClass(thee,clas) Vel_setClass( (Vel*)(thee), (clas) )
00541
00542 # define VV_setType(thee,type) Vel_setType( (Vel*)(thee), (type) )
00543
00544 # define VV_setChart(thee,chart) Vel_setChart( (Vel*)(thee), (chart) )
00545
00546 # define VV_setId(thee,id) Vel_setId( (Vel*)(thee), (id) )
00547
00549 # define VV_reality(thee) Vel_reality( (Vel*)(thee) )
00550
00551 # define VV_dim(thee) Vel_dim( (Vel*)(thee) )
00552
00553 # define VV_dimVV(thee) Vel_dimVV( (Vel*)(thee) )
00554
00555 # define VV_dimEE(thee) Vel_dimEE( (Vel*)(thee) )
00556
00557 # define VV_dimFF(thee) Vel_dimFF( (Vel*)(thee) )
00558
00559 # define VV_class(thee) Vel_class( (Vel*)(thee) )
00560
00561 # define VV_type(thee) Vel_type( (Vel*)(thee) )
00562
00563 # define VV_chart(thee) Vel_chart( (Vel*)(thee) )
00564
00565 # define VV_id(thee) Vel_id( (Vel*)(thee) )
00566
00568 # define VV_setCoord(thee,i,val) ((thee)->d.x[(i)] = (val))
00569
00570 # define VV_setFirstEE(thee,eg) ((thee)->d.ePtr = (eg))
00571
00572 # define VV_setFirstSS(thee,eg) ((thee)->d.sPtr = (eg))
00573
00574 # define VV_setParentEE(thee,eg) ((thee)->d.eParent = (eg))
00575
00577 # define VV_coord(thee,i) ((thee)->d.x[(i)])
00578
00579 # define VV_firstEE(thee) (EE*)((thee)->d.ePtr)
00580
00581 # define VV_firstSS(thee) (SS*)((thee)->d.sPtr)
00582
00583 # define VV_parentEE(thee) (EE*)((thee)->d.eParent)
00584
00586 # define VV_addEdgeToRing(thee,eg) ( \
00587 EE_setLink( (eg), (thee), VV_firstEE(thee) ), \
00588 VV_setFirstEE( (thee), (eg) ) \
00589 )
00590
00591 # define VV_addSimplexToRing(thee,sm) ( \
00592 SS_setLink( (sm), (thee), VV_firstSS(thee) ), \
00593 VV_setFirstSS( (thee), (sm) ) \
00594 )
00595 #endif
00596
00597
00598
00599
00600
00601
00602
00612 VV* VV_ctor(int dim, int myid);
00613
00622 void VV_dtor(VV **thee);
00623
00633 void VV_removeEdgeFromRing(VV *thee, EE *eg);
00634
00644 void VV_removeSimplexFromRing(VV *thee, SS *sm);
00645
00655 int VV_edgeInRing(VV *thee, EE *eg);
00656
00666 int VV_simplexInRing(VV *thee, SS *sm);
00667
00677 EE* VV_commonEdge(VV *thee, VV *v0);
00678
00688 EE* VV_parentEdge(VV *thee, VV *v0);
00689
00702 SS* VV_commonSimplex2(VV *thee, VV *v0, SS *sm);
00703
00717 SS* VV_commonSimplex3(VV *thee, VV *v0, VV *v1, SS *sm);
00718
00733 SS* VV_commonSimplex4(VV *thee, VV *v0, VV *v1, VV *v2, SS *sm);
00734
00745 VV* VV_commonVertex3(VV *thee, VV *v0, VV *v1);
00746
00758 VV* VV_commonVertex4(VV *thee, VV *v0, VV *v1, VV *v2);
00759
00760
00761 #if !defined(VINLINE_GEM)
00762
00772 void EE_init(EE *thee, int dim, int id);
00773
00782 void EE_reinit(EE *thee);
00783
00793 void EE_setReality(EE *thee, int type);
00794
00804 void EE_setDim(EE *thee, int dim);
00805
00815 void EE_setClass(EE *thee, int type);
00816
00826 void EE_setType(EE *thee, int type);
00827
00837 void EE_setChart(EE *thee, int chart);
00838
00848 void EE_setId(EE *thee, int id);
00849
00858 unsigned int EE_dim(EE *thee);
00859
00868 unsigned int EE_dimVV(EE *thee);
00869
00878 unsigned int EE_dimEE(EE *thee);
00879
00888 unsigned int EE_dimFF(EE *thee);
00889
00898 unsigned int EE_reality(EE *thee);
00899
00908 unsigned int EE_class(EE *thee);
00909
00918 unsigned int EE_type(EE *thee);
00919
00928 unsigned int EE_chart(EE *thee);
00929
00938 unsigned int EE_id(EE *thee);
00939
00950 void EE_setVertex(EE *thee, int i, VV *vx);
00951
00961 void EE_setMidPoint(EE *thee, VV *vx);
00962
00972 void EE_setParent(EE *thee, EE *eg);
00973
00983 void EE_setVertexOrder(EE *thee, VV* vxTmp);
00984
00995 void EE_setLink(EE *thee, VV *vx, EE *eg);
00996
01006 VV* EE_vertex(EE *thee, int i);
01007
01016 VV* EE_midPoint(EE *thee);
01017
01026 EE* EE_parent(EE *thee);
01027
01037 VV* EE_otherVertex(EE *thee, VV *vx);
01038
01048 EE* EE_link(EE *thee, VV *vx);
01049 #else
01050
01051 # define EE_init(thee,dim,id) ( \
01052 (thee)->d.vPtr[0] = VNULL, \
01053 (thee)->d.vPtr[1] = VNULL, \
01054 (thee)->d.ePtr[0] = VNULL, \
01055 (thee)->d.ePtr[1] = VNULL, \
01056 (thee)->d.midPtr = VNULL, \
01057 Vel_init((Vel*)(thee), dim, id) \
01058 )
01059
01060 # define EE_reinit(thee) ( \
01061 (thee)->d.vPtr[0] = VNULL, \
01062 (thee)->d.vPtr[1] = VNULL, \
01063 (thee)->d.ePtr[0] = VNULL, \
01064 (thee)->d.ePtr[1] = VNULL, \
01065 (thee)->d.midPtr = VNULL, \
01066 Vel_reinit((Vel*)(thee)) \
01067 )
01068
01070 # define EE_setReality(thee,reel) Vel_setReality( (Vel*)(thee), (reel) )
01071
01072 # define EE_setDim(thee,dim) Vel_setDim( (Vel*)(thee), (dim) )
01073
01074 # define EE_setClass(thee,clas) Vel_setClass( (Vel*)(thee), (clas) )
01075
01076 # define EE_setType(thee,type) Vel_setType( (Vel*)(thee), (type) )
01077
01078 # define EE_setChart(thee,chart) Vel_setChart( (Vel*)(thee), (chart) )
01079
01080 # define EE_setId(thee,id) Vel_setId( (Vel*)(thee), (id) )
01081
01083 # define EE_reality(thee) Vel_reality( (Vel*)(thee) )
01084
01085 # define EE_dim(thee) Vel_dim( (Vel*)(thee) )
01086
01087 # define EE_dimVV(thee) Vel_dimVV( (Vel*)(thee) )
01088
01089 # define EE_dimEE(thee) Vel_dimEE( (Vel*)(thee) )
01090
01091 # define EE_dimFF(thee) Vel_dimFF( (Vel*)(thee) )
01092
01093 # define EE_class(thee) Vel_class( (Vel*)(thee) )
01094
01095 # define EE_type(thee) Vel_type( (Vel*)(thee) )
01096
01097 # define EE_chart(thee) Vel_chart( (Vel*)(thee) )
01098
01099 # define EE_id(thee) Vel_id( (Vel*)(thee) )
01100
01102 # define EE_setVertex(thee,i,vx) ((thee)->d.vPtr[(i)]=(vx))
01103
01104 # define EE_setMidPoint(thee,vx) ((thee)->d.midPtr=(vx))
01105
01106 # define EE_setParent(thee,eg) ((thee)->d.eParent = (eg))
01107
01108 # define EE_setVertexOrder(thee,vxTmp) ( \
01109 (VV_id((thee)->d.vPtr[0]) > VV_id((thee)->d.vPtr[1])) \
01110 ? ( (vxTmp) = (thee)->d.vPtr[1], \
01111 (thee)->d.vPtr[1] = (thee)->d.vPtr[0], \
01112 (thee)->d.vPtr[0] = (vxTmp) ) \
01113 : VNULL \
01114 )
01115
01116 # define EE_setLink(thee,vx,eg) ( \
01117 ((vx) == (VV*)(thee)->d.vPtr[0]) ? (thee)->d.ePtr[0] = eg \
01118 : (((vx) == (VV*)(thee)->d.vPtr[1]) ? (thee)->d.ePtr[1] = eg : VNULL) \
01119 )
01120
01121 # define EE_vertex(thee,i) (VV*)((thee)->d.vPtr[(i)])
01122
01123 # define EE_midPoint(thee) (VV*)((thee)->d.midPtr)
01124
01125 # define EE_parent(thee) (EE*)((thee)->d.eParent)
01126
01127 # define EE_otherVertex(thee,vx) (VV*)( \
01128 ((vx) == (VV*)(thee)->d.vPtr[0]) ? (thee)->d.vPtr[1] \
01129 : (((vx) == (VV*)(thee)->d.vPtr[1]) ? (thee)->d.vPtr[0] : VNULL) \
01130 )
01131
01132 # define EE_link(thee,vx) (EE*)( \
01133 ((vx) == (VV*)(thee)->d.vPtr[0]) ? (thee)->d.ePtr[0] \
01134 : (((vx) == (VV*)(thee)->d.vPtr[1]) ? (thee)->d.ePtr[1] : VNULL) \
01135 )
01136 #endif
01137
01138
01139
01140
01141
01142
01143
01153 EE* EE_ctor(int dim, int myid);
01154
01163 void EE_dtor(EE **thee);
01164
01173 void EE_initRing(EE *thee);
01174
01183 void EE_meltRing(EE *thee);
01184
01193 void EE_buildRing(EE *thee);
01194
01195
01196 #if !defined(VINLINE_GEM)
01197
01207 void SS_init(SS *thee, int dim, int id);
01208
01217 void SS_reinit(SS *thee);
01218
01228 void SS_setReality(SS *thee, int type);
01229
01239 void SS_setDim(SS *thee, int dim);
01240
01250 void SS_setClass(SS *thee, int type);
01251
01261 void SS_setType(SS *thee, int type);
01262
01272 void SS_setChart(SS *thee, int chart);
01273
01283 void SS_setId(SS *thee, int id);
01284
01293 unsigned int SS_reality(SS *thee);
01294
01303 unsigned int SS_dim(SS *thee);
01304
01313 unsigned int SS_dimVV(SS *thee);
01314
01323 unsigned int SS_dimEE(SS *thee);
01324
01333 unsigned int SS_dimFF(SS *thee);
01334
01343 unsigned int SS_class(SS *thee);
01344
01353 unsigned int SS_type(SS *thee);
01354
01363 unsigned int SS_chart(SS *thee);
01364
01373 unsigned int SS_id(SS *thee);
01374
01385 void SS_setFaceType(SS *thee, int f, int type);
01386
01396 void SS_setRefinementEdge(SS *thee, int i);
01397
01407 void SS_setMarkedEdge1(SS *thee, int i);
01408
01418 void SS_setMarkedEdge2(SS *thee, int i);
01419
01429 void SS_setMarkedEdge3(SS *thee, int i);
01430
01440 void SS_setDegen(SS *thee, int i);
01441
01451 void SS_setRefinementCount(SS *thee, int i);
01452
01463 void SS_setRefineKey(SS *thee, int which, int key);
01464 # if defined(VG_ELEMENT)
01465
01475 void SS_setFaceNumber(SS *thee, int i, int fn);
01476
01487 void SS_setEdgeNumber(SS *thee, int i, int en);
01488 # endif
01489
01499 void SS_setVertex(SS *thee, int i, VV *vx);
01500
01511 void SS_setLink(SS *thee, VV *vx, SS *sm);
01512
01522 unsigned int SS_faceType(SS *thee, int f);
01523
01532 unsigned int SS_refinementEdge(SS *thee);
01533
01542 unsigned int SS_markedEdge1(SS *thee);
01543
01552 unsigned int SS_markedEdge2(SS *thee);
01553
01562 unsigned int SS_markedEdge3(SS *thee);
01563
01572 unsigned int SS_degen(SS *thee);
01573
01582 unsigned int SS_refinementCount(SS *thee);
01583
01593 unsigned int SS_refineKey(SS *thee, int which);
01594
01595 # if defined(VG_ELEMENT)
01596
01605 int SS_faceNumber(SS *thee, int i);
01606
01616 int SS_edgeNumber(SS *thee, int i);
01617 # endif
01618
01628 VV* SS_vertex(SS *thee, int i);
01629
01639 SS* SS_link(SS *thee, VV *vx);
01640
01651 int SS_faceVertexNumber(SS *thee, int f, int i);
01652
01662 int SS_vptr2localVnum(SS *thee, VV *vx);
01663 #else
01664 # if defined(VG_ELEMENT)
01665
01666 # define SS_init(thee,dim,id) ( \
01667 (thee)->d.vPtr[0] = VNULL, \
01668 (thee)->d.vPtr[1] = VNULL, \
01669 (thee)->d.vPtr[2] = VNULL, \
01670 (thee)->d.vPtr[3] = VNULL, \
01671 (thee)->d.sPtr[0] = VNULL, \
01672 (thee)->d.sPtr[1] = VNULL, \
01673 (thee)->d.sPtr[2] = VNULL, \
01674 (thee)->d.sPtr[3] = VNULL, \
01675 (thee)->d.fNum[0] = -1, \
01676 (thee)->d.fNum[1] = -1, \
01677 (thee)->d.fNum[2] = -1, \
01678 (thee)->d.fNum[3] = -1, \
01679 (thee)->d.eNum[0] = -1, \
01680 (thee)->d.eNum[1] = -1, \
01681 (thee)->d.eNum[2] = -1, \
01682 (thee)->d.eNum[3] = -1, \
01683 (thee)->d.eNum[4] = -1, \
01684 (thee)->d.eNum[5] = -1, \
01685 (thee)->d.tags = MASK_00000000000000000000000000000000, \
01686 Vel_init((Vel*)(thee), dim, id) \
01687 )
01688
01689 # define SS_reinit(thee) ( \
01690 (thee)->d.vPtr[0] = VNULL, \
01691 (thee)->d.vPtr[1] = VNULL, \
01692 (thee)->d.vPtr[2] = VNULL, \
01693 (thee)->d.vPtr[3] = VNULL, \
01694 (thee)->d.sPtr[0] = VNULL, \
01695 (thee)->d.sPtr[1] = VNULL, \
01696 (thee)->d.sPtr[2] = VNULL, \
01697 (thee)->d.sPtr[3] = VNULL, \
01698 (thee)->d.fNum[0] = -1, \
01699 (thee)->d.fNum[1] = -1, \
01700 (thee)->d.fNum[2] = -1, \
01701 (thee)->d.fNum[3] = -1, \
01702 (thee)->d.eNum[0] = -1, \
01703 (thee)->d.eNum[1] = -1, \
01704 (thee)->d.eNum[2] = -1, \
01705 (thee)->d.eNum[3] = -1, \
01706 (thee)->d.eNum[4] = -1, \
01707 (thee)->d.eNum[5] = -1, \
01708 (thee)->d.tags = MASK_00000000000000000000000000000000, \
01709 Vel_reinit((Vel*)(thee)) \
01710 )
01711 # else
01712
01713 # define SS_init(thee,dim,id) ( \
01714 (thee)->d.vPtr[0] = VNULL, \
01715 (thee)->d.vPtr[1] = VNULL, \
01716 (thee)->d.vPtr[2] = VNULL, \
01717 (thee)->d.vPtr[3] = VNULL, \
01718 (thee)->d.sPtr[0] = VNULL, \
01719 (thee)->d.sPtr[1] = VNULL, \
01720 (thee)->d.sPtr[2] = VNULL, \
01721 (thee)->d.sPtr[3] = VNULL, \
01722 (thee)->d.tags = MASK_00000000000000000000000000000000, \
01723 Vel_init((Vel*)(thee), dim, id) \
01724 )
01725
01726 # define SS_reinit(thee) ( \
01727 (thee)->d.vPtr[0] = VNULL, \
01728 (thee)->d.vPtr[1] = VNULL, \
01729 (thee)->d.vPtr[2] = VNULL, \
01730 (thee)->d.vPtr[3] = VNULL, \
01731 (thee)->d.sPtr[0] = VNULL, \
01732 (thee)->d.sPtr[1] = VNULL, \
01733 (thee)->d.sPtr[2] = VNULL, \
01734 (thee)->d.sPtr[3] = VNULL, \
01735 (thee)->d.tags = MASK_00000000000000000000000000000000, \
01736 Vel_reinit((Vel*)(thee)) \
01737 )
01738 # endif
01739
01741 # define SS_setReality(thee,reel) Vel_setReality( (Vel*)(thee), (reel) )
01742
01743 # define SS_setDim(thee,dim) Vel_setDim( (Vel*)(thee), (dim) )
01744
01745 # define SS_setClass(thee,clas) Vel_setClass( (Vel*)(thee), (clas) )
01746
01747 # define SS_setType(thee,type) Vel_setType( (Vel*)(thee), (type) )
01748
01749 # define SS_setChart(thee,chart) Vel_setChart( (Vel*)(thee), (chart) )
01750
01751 # define SS_setId(thee,id) Vel_setId( (Vel*)(thee), (id) )
01752
01754 # define SS_reality(thee) Vel_reality( (Vel*)(thee) )
01755
01756 # define SS_dim(thee) Vel_dim( (Vel*)(thee) )
01757
01758 # define SS_dimVV(thee) Vel_dimVV( (Vel*)(thee) )
01759
01760 # define SS_dimEE(thee) Vel_dimEE( (Vel*)(thee) )
01761
01762 # define SS_dimFF(thee) Vel_dimFF( (Vel*)(thee) )
01763
01764 # define SS_class(thee) Vel_class( (Vel*)(thee) )
01765
01766 # define SS_type(thee) Vel_type( (Vel*)(thee) )
01767
01768 # define SS_chart(thee) Vel_chart( (Vel*)(thee) )
01769
01770 # define SS_id(thee) Vel_id( (Vel*)(thee) )
01771
01773 # define SS_setFaceType(thee,f,type) (void)( \
01774 ((f) == 0) ? \
01775 ( (thee)->d.faces &= MASK_11111111111111111111111100000000, \
01776 (thee)->d.faces |= (type) ) \
01777 : (((f) == 1) ? \
01778 ( (thee)->d.faces &= MASK_11111111111111110000000011111111, \
01779 (thee)->d.faces |= ((type) << 8) ) \
01780 : (((f) == 2) ? \
01781 ( (thee)->d.faces &= MASK_11111111000000001111111111111111, \
01782 (thee)->d.faces |= ((type) << 16) ) \
01783 : (((f) == 3) ? \
01784 ( (thee)->d.faces &= MASK_00000000111111111111111111111111, \
01785 (thee)->d.faces |= ((type) << 24) ) \
01786 : 0))) \
01787 )
01788
01789 # define SS_setRefinementEdge(thee,i) ( \
01790 (thee)->d.tags &= MASK_11111111111111111111111111111000, \
01791 (thee)->d.tags |= (i) \
01792 )
01793
01794 # define SS_setMarkedEdge1(thee,i) ( \
01795 (thee)->d.tags &= MASK_11111111111111111111111111000111, \
01796 (thee)->d.tags |= ((i) << 3) \
01797 )
01798
01799 # define SS_setMarkedEdge2(thee,i) ( \
01800 (thee)->d.tags &= MASK_11111111111111111111111000111111, \
01801 (thee)->d.tags |= ((i) << 6) \
01802 )
01803
01804 # define SS_setMarkedEdge3(thee,i) ( \
01805 (thee)->d.tags &= MASK_11111111111111111111000111111111, \
01806 (thee)->d.tags |= ((i) << 9) \
01807 )
01808
01809 # define SS_setDegen(thee,i) ( \
01810 (thee)->d.tags &= MASK_11111111111111111000111111111111, \
01811 (thee)->d.tags |= ((i) << 12) \
01812 )
01813
01814 # define SS_setRefinementCount(thee,i) ( \
01815 (thee)->d.tags &= MASK_11111111111111000111111111111111, \
01816 (thee)->d.tags |= ((i) << 15) \
01817 )
01818
01819 # define SS_setRefineKey(thee,which,key) (void)( \
01820 ((which) == 0) \
01821 ? ( (thee)->d.tags &= MASK_11111111111110111111111111111111, \
01822 (thee)->d.tags |= ((key) << 18) ) \
01823 : ( (thee)->d.tags &= MASK_11111111111101111111111111111111, \
01824 (thee)->d.tags |= ((key) << 19) ) \
01825 )
01826 # if defined(VG_ELEMENT)
01827
01828 # define SS_setFaceNumber(thee,i,fn) ((thee)->d.fNum[(i)] = (fn))
01829
01830 # define SS_setEdgeNumber(thee,i,en) ((thee)->d.eNum[(i)] = (en))
01831 # endif
01832
01833 # define SS_setVertex(thee,i,vx) ((thee)->d.vPtr[(i)] = (vx))
01834
01835 # define SS_setLink(thee,vx,sm) ( \
01836 ((vx) == (VV*)(thee)->d.vPtr[0]) ? (thee)->d.sPtr[0] = sm \
01837 : (((vx) == (VV*)(thee)->d.vPtr[1]) ? (thee)->d.sPtr[1] = sm \
01838 : (((vx) == (VV*)(thee)->d.vPtr[2]) ? (thee)->d.sPtr[2] = sm \
01839 : (((vx) == (VV*)(thee)->d.vPtr[3]) ? (thee)->d.sPtr[3] = sm \
01840 : VNULL))) \
01841 )
01842
01844 # define SS_faceType(thee,f) ( \
01845 ((f) == 0) ? \
01846 ((thee)->d.faces & MASK_00000000000000000000000011111111) \
01847 : (((f) == 1) ? \
01848 ((thee)->d.faces & MASK_00000000000000001111111100000000) >> 8 \
01849 : (((f) == 2) ? \
01850 ((thee)->d.faces & MASK_00000000111111110000000000000000) >> 16 \
01851 : (((f) == 3) ? \
01852 ((thee)->d.faces & MASK_11111111000000000000000000000000) >> 24 \
01853 : 0))) \
01854 )
01855
01856 # define SS_refinementEdge(thee) ( \
01857 ((thee)->d.tags & MASK_00000000000000000000000000000111) \
01858 )
01859
01860 # define SS_markedEdge1(thee) ( \
01861 (((thee)->d.tags & MASK_00000000000000000000000000111000) >> 3) \
01862 )
01863
01864 # define SS_markedEdge2(thee) ( \
01865 (((thee)->d.tags & MASK_00000000000000000000000111000000) >> 6) \
01866 )
01867
01868 # define SS_markedEdge3(thee) ( \
01869 (((thee)->d.tags & MASK_00000000000000000000111000000000) >> 9) \
01870 )
01871
01872 # define SS_degen(thee) ( \
01873 (((thee)->d.tags & MASK_00000000000000000111000000000000) >> 12) \
01874 )
01875
01876 # define SS_refinementCount(thee) ( \
01877 (((thee)->d.tags & MASK_00000000000000111000000000000000) >> 15) \
01878 )
01879
01880 # define SS_refineKey(thee,which) ( \
01881 (which == 0) \
01882 ? (((thee)->d.tags & MASK_00000000000001000000000000000000) >> 18) \
01883 : (((thee)->d.tags & MASK_00000000000010000000000000000000) >> 19) \
01884 )
01885 # if defined(VG_ELEMENT)
01886
01887 # define SS_faceNumber(thee,i) ((thee)->d.fNum[(i)])
01888
01889 # define SS_edgeNumber(thee,i) ((thee)->d.eNum[(i)])
01890 # endif
01891
01892 # define SS_vertex(thee,i) (VV*)((thee)->d.vPtr[(i)])
01893
01894 # define SS_link(thee,vx) (SS*)( \
01895 ((vx) == (VV*)((thee)->d.vPtr[0])) \
01896 ? ((thee)->d.sPtr[0]) \
01897 : (((vx) == (VV*)((thee)->d.vPtr[1])) \
01898 ? ((thee)->d.sPtr[1]) \
01899 : (((vx) == (VV*)((thee)->d.vPtr[2])) \
01900 ? ((thee)->d.sPtr[2]) \
01901 : (((vx) == (VV*)((thee)->d.vPtr[3])) \
01902 ? ((thee)->d.sPtr[3]) : VNULL))) \
01903 )
01904
01906 # define SS_faceVertexNumber(thee,f,i) (vmapF[(f)][(i)])
01907
01908 # define SS_vptr2localVnum(thee,vx) ( \
01909 ((vx) == (VV*)(thee)->d.vPtr[0]) ? 0 \
01910 : (((vx) == (VV*)(thee)->d.vPtr[1]) ? 1 \
01911 : (((vx) == (VV*)(thee)->d.vPtr[2]) ? 2 \
01912 : (((vx) == (VV*)(thee)->d.vPtr[3]) ? 3 \
01913 : 0))) \
01914 )
01915 #endif
01916
01917
01918
01919
01920
01921
01922
01932 SS* SS_ctor(int dim, int myid);
01933
01942 void SS_dtor(SS **thee);
01943
01952 void SS_initRing(SS *thee);
01953
01962 void SS_meltRing(SS *thee);
01963
01972 void SS_buildRing(SS *thee);
01973
01983 SS* SS_nabor(SS *thee, int i);
01984
01995 EE* SS_edge(SS *thee, int i, int j);
01996
02006 int SS_sharedFaceLocNum(SS *thee, SS *sm);
02007
02033 int SS_localEdgeType(SS *thee, VV *v0, VV *v1);
02034
02043 void SS_reverse(SS *thee);
02044
02055 VPUBLIC FF* FF_ctor(int grandParentFace, SS *sPtr, int color);
02056
02057 #endif
02058
02059