Changeset 5400
- Timestamp:
- 08/19/10 09:28:10 (15 years ago)
- Location:
- issm/trunk/src/c
- Files:
-
- 9 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/c/Makefile.am
r5378 r5400 53 53 ./objects/Bamg/ListofIntersectionTriangles.cpp\ 54 54 ./objects/Bamg/ListofIntersectionTriangles.h\ 55 ./objects/Bamg/ MatVVP2x2.cpp\55 ./objects/Bamg/EigenMetric.cpp\ 56 56 ./objects/Bamg/Metric.cpp\ 57 57 ./objects/Bamg/Metric.h\ … … 605 605 ./objects/Bamg/ListofIntersectionTriangles.cpp\ 606 606 ./objects/Bamg/ListofIntersectionTriangles.h\ 607 ./objects/Bamg/ MatVVP2x2.cpp\607 ./objects/Bamg/EigenMetric.cpp\ 608 608 ./objects/Bamg/Metric.cpp\ 609 609 ./objects/Bamg/Metric.h\ -
issm/trunk/src/c/modules/Bamgx/Bamgx.cpp
r5187 r5400 53 53 for(i=0;i<Gh.nbv;i++){ 54 54 Metric M=Gh[i]; 55 MatVVP2x2Vp(M/coef);55 EigenMetric Vp(M/coef); 56 56 Vp.Maxh(bamgopts->hmax); 57 57 Vp.Minh(bamgopts->hmin); … … 131 131 if (!isnan(bamgopts->hminVertices[i])){ 132 132 Metric M=BTh.vertices[i].m; 133 MatVVP2x2Vp(M/coef);133 EigenMetric Vp(M/coef); 134 134 Vp.Minh(bamgopts->hminVertices[i]); 135 135 BTh.vertices[i].m=Vp; … … 144 144 if (!isnan(bamgopts->hmaxVertices[i])){ 145 145 Metric M=BTh.vertices[i].m; 146 MatVVP2x2Vp(M/coef);146 EigenMetric Vp(M/coef); 147 147 Vp.Minh(bamgopts->hmaxVertices[i]); 148 148 BTh.vertices[i].m=Vp; -
issm/trunk/src/c/objects/Bamg/BamgVertex.cpp
r5180 r5400 83 83 84 84 //Get eigen values and vectors of Miv 85 MatVVP2x2Vp(Miv);85 EigenMetric Vp(Miv); 86 86 87 87 //move eigen valuse to their absolute values -
issm/trunk/src/c/objects/Bamg/Curve.cpp
r5397 r5400 11 11 /*Constructors/Destructors*/ 12 12 /*FUNCTION Curve::Curve(){{{1*/ 13 Curve::Curve():be(0),ee(0),kb(0),ke(0),next(0){ 14 13 Curve::Curve(){ 14 FirstEdge=NULL; 15 LastEdge=NULL; 16 FirstVertexIndex=0; 17 LastVertexIndex=0; 18 next=NULL; 15 19 } 16 20 /*}}}*/ … … 20 24 void Curve::Reverse() { 21 25 /*reverse the direction of the curve */ 22 Exchange( be,ee);23 Exchange( kb,ke);26 Exchange(FirstEdge,LastEdge); 27 Exchange(FirstVertexIndex,LastVertexIndex); 24 28 } 25 29 /*}}}*/ … … 27 31 void Curve::Set(const Curve & rec,const Geometry & Gh ,Geometry & GhNew){ 28 32 *this = rec; 29 be = GhNew.edges + Gh.GetId(be);30 ee = GhNew.edges + Gh.GetId(ee);33 FirstEdge = GhNew.edges + Gh.GetId(FirstEdge); 34 LastEdge = GhNew.edges + Gh.GetId(LastEdge); 31 35 if(next) next= GhNew.curves + Gh.GetId(next); 32 36 } -
issm/trunk/src/c/objects/Bamg/Curve.h
r5397 r5400 13 13 class Curve { 14 14 public: 15 GeometricalEdge *be,*ee; // begin et end edge 16 int kb,ke; // begin vetex and end vertex 15 GeometricalEdge *FirstEdge; //First edge of the curve 16 GeometricalEdge *LastEdge; //Last edge of the curve 17 int FirstVertexIndex; //Last vertex index in the last edge 18 int LastVertexIndex; //First Vertex index in the first edge 17 19 Curve* next; // next curve equi to this 18 20 -
issm/trunk/src/c/objects/Bamg/EigenMetric.cpp
r5397 r5400 9 9 10 10 /*Constructor*/ 11 /*FUNCTION MatVVP2x2::MatVVP2x2(const Metric M){{{1*/12 MatVVP2x2::MatVVP2x2(const Metric M){11 /*FUNCTION EigenMetric::EigenMetric(const Metric M){{{1*/ 12 EigenMetric::EigenMetric(const Metric M){ 13 13 /*From a metric (a11,a21,a22), get eigen values lambda1 and lambda2 and one eigen vector v*/ 14 14 … … 89 89 } 90 90 /*}}}1*/ 91 /*FUNCTION MatVVP2x2::MatVVP2x2(double r1,double r2,const D2 vp1){{{1*/92 MatVVP2x2::MatVVP2x2(double r1,double r2,const D2 vp1): lambda1(r1),lambda2(r2),v(vp1){91 /*FUNCTION EigenMetric::EigenMetric(double r1,double r2,const D2 vp1){{{1*/ 92 EigenMetric::EigenMetric(double r1,double r2,const D2 vp1): lambda1(r1),lambda2(r2),v(vp1){ 93 93 94 94 }/*}}}*/ 95 95 96 96 /*Methods*/ 97 /*FUNCTION MatVVP2x2::Abs{{{1*/98 void MatVVP2x2::Abs(){97 /*FUNCTION EigenMetric::Abs{{{1*/ 98 void EigenMetric::Abs(){ 99 99 lambda1=bamg::Abs(lambda1),lambda2=bamg::Abs(lambda2); 100 100 }/*}}}*/ 101 /*FUNCTION MatVVP2x2::Aniso{{{1*/102 double MatVVP2x2::Aniso() const {101 /*FUNCTION EigenMetric::Aniso{{{1*/ 102 double EigenMetric::Aniso() const { 103 103 return sqrt( Aniso2()); 104 104 }/*}}}*/ 105 /*FUNCTION MatVVP2x2::Aniso2{{{1*/106 double MatVVP2x2::Aniso2() const {105 /*FUNCTION EigenMetric::Aniso2{{{1*/ 106 double EigenMetric::Aniso2() const { 107 107 return lmax()/lmin(); 108 108 }/*}}}*/ 109 /*FUNCTION MatVVP2x2::BoundAniso{{{1*/110 void MatVVP2x2::BoundAniso(const double c){109 /*FUNCTION EigenMetric::BoundAniso{{{1*/ 110 void EigenMetric::BoundAniso(const double c){ 111 111 BoundAniso2(1/(c*c)); 112 112 }/*}}}*/ 113 /*FUNCTION MatVVP2x2::Echo {{{1*/114 void MatVVP2x2::Echo(void){113 /*FUNCTION EigenMetric::Echo {{{1*/ 114 void EigenMetric::Echo(void){ 115 115 116 printf(" MatVVP2x2:\n");116 printf("EigenMetric:\n"); 117 117 printf(" lambda1: %g\n",lambda1); 118 118 printf(" lambda2: %g\n",lambda2); … … 123 123 } 124 124 /*}}}*/ 125 /*FUNCTION MatVVP2x2::hmin{{{1*/126 double MatVVP2x2::hmin() const {125 /*FUNCTION EigenMetric::hmin{{{1*/ 126 double EigenMetric::hmin() const { 127 127 return sqrt(1/bamg::Max3(lambda1,lambda2,1e-30)); 128 128 }/*}}}*/ 129 /*FUNCTION MatVVP2x2::hmax{{{1*/130 double MatVVP2x2::hmax() const {129 /*FUNCTION EigenMetric::hmax{{{1*/ 130 double EigenMetric::hmax() const { 131 131 return sqrt(1/bamg::Max(bamg::Min(lambda1,lambda2),1e-30)); 132 132 }/*}}}*/ 133 /*FUNCTION MatVVP2x2::Isotrope{{{1*/134 void MatVVP2x2::Isotrope() {133 /*FUNCTION EigenMetric::Isotrope{{{1*/ 134 void EigenMetric::Isotrope() { 135 135 lambda1=lambda2=bamg::Max(lambda1,lambda2); 136 136 }/*}}}*/ 137 /*FUNCTION MatVVP2x2::lmax{{{1*/138 double MatVVP2x2::lmax() const {137 /*FUNCTION EigenMetric::lmax{{{1*/ 138 double EigenMetric::lmax() const { 139 139 return bamg::Max3(lambda1,lambda2,1e-30); 140 140 }/*}}}*/ 141 /*FUNCTION MatVVP2x2::lmin{{{1*/142 double MatVVP2x2::lmin() const {141 /*FUNCTION EigenMetric::lmin{{{1*/ 142 double EigenMetric::lmin() const { 143 143 return bamg::Max(bamg::Min(lambda1,lambda2),1e-30); 144 144 }/*}}}*/ 145 /*FUNCTION MatVVP2x2::Min{{{1*/146 void MatVVP2x2::Min(double a) {145 /*FUNCTION EigenMetric::Min{{{1*/ 146 void EigenMetric::Min(double a) { 147 147 lambda1=bamg::Min(a,lambda1); lambda2=bamg::Min(a,lambda2) ; 148 148 }/*}}}*/ 149 /*FUNCTION MatVVP2x2::Max{{{1*/150 void MatVVP2x2::Max(double a) {149 /*FUNCTION EigenMetric::Max{{{1*/ 150 void EigenMetric::Max(double a) { 151 151 lambda1=bamg::Max(a,lambda1); lambda2=bamg::Max(a,lambda2) ; 152 152 }/*}}}*/ 153 /*FUNCTION MatVVP2x2::Minh{{{1*/154 void MatVVP2x2::Minh(double h) {153 /*FUNCTION EigenMetric::Minh{{{1*/ 154 void EigenMetric::Minh(double h) { 155 155 Min(1.0/(h*h)); 156 156 }/*}}}*/ 157 /*FUNCTION MatVVP2x2::Maxh{{{1*/158 void MatVVP2x2::Maxh(double h) {157 /*FUNCTION EigenMetric::Maxh{{{1*/ 158 void EigenMetric::Maxh(double h) { 159 159 Max(1.0/(h*h)); 160 160 }/*}}}*/ 161 /*FUNCTION MatVVP2x2::pow{{{1*/162 void MatVVP2x2::pow(double p){161 /*FUNCTION EigenMetric::pow{{{1*/ 162 void EigenMetric::pow(double p){ 163 163 lambda1=::pow(lambda1,p);lambda2=::pow(lambda2,p); 164 164 }/*}}}*/ -
issm/trunk/src/c/objects/Bamg/Geometry.cpp
r5397 r5400 400 400 401 401 /*Methods*/ 402 /*FUNCTION Geometry::Echo {{{1*/ 403 void Geometry::Echo(void){ 404 405 printf("Geometry:\n"); 406 printf(" nbv (number of vertices) : %i\n",nbv); 407 printf(" nbe (number of edges) : %i\n",nbe); 408 printf(" nbsubdomains: %i\n",nbsubdomains); 409 printf(" nbcurves: %i\n",nbcurves); 410 printf(" vertices: %p\n",vertices); 411 printf(" edges: %p\n",edges); 412 printf(" quadtree: %p\n",quadtree); 413 printf(" subdomains: %p\n",subdomains); 414 printf(" curves: %p\n",curves); 415 printf(" pmin (x,y): (%g %g)\n",pmin.x,pmin.y); 416 printf(" pmax (x,y): (%g %g)\n",pmax.x,pmax.y); 417 printf(" coefIcoor: %g\n",coefIcoor); 418 printf(" MaxCornerAngle: %g\n",MaxCornerAngle); 419 420 return; 421 } 422 /*}}}*/ 423 /*FUNCTION Geometry::Init{{{1*/ 424 void Geometry::Init(void){ 425 /*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, MeshGeom.cpp/EmptyGeometry)*/ 426 427 NbRef=0; 428 nbv=0; 429 nbe=0; 430 quadtree=NULL; 431 curves=NULL; 432 edges=NULL; 433 vertices=NULL; 434 nbsubdomains=0; 435 nbcurves=0; 436 subdomains=NULL; 437 MaxCornerAngle = 10*Pi/180; //default is 10 degres 438 } 439 /*}}}1*/ 440 /*FUNCTION Geometry::MinimalHmin{{{1*/ 441 double Geometry::MinimalHmin() { 442 /* coeffIcoor = (2^30-1)/D 443 * We cannot go beyond hmin = D/2^30 because of the quadtree 444 * hmin is therefore approximately 2/coeffIcoor */ 445 return 2.0/coefIcoor; 446 }/*}}}*/ 447 /*FUNCTION Geometry::MaximalHmax{{{1*/ 448 double Geometry::MaximalHmax() { 449 return Max(pmax.x-pmin.x,pmax.y-pmin.y); 450 }/*}}}*/ 451 /*FUNCTION Geometry::GetId(const GeometricalVertex &t){{{1*/ 452 long Geometry::GetId(const GeometricalVertex & t) const { 453 return &t - vertices; 454 }/*}}}*/ 455 /*FUNCTION Geometry::GetId(const GeometricalVertex * t){{{1*/ 456 long Geometry::GetId(const GeometricalVertex * t) const { 457 return t - vertices; 458 }/*}}}*/ 459 /*FUNCTION Geometry::GetId(const GeometricalEdge & t){{{1*/ 460 long Geometry::GetId(const GeometricalEdge & t) const { 461 return &t - edges; 462 }/*}}}*/ 463 /*FUNCTION Geometry::GetId(const GeometricalEdge * t){{{1*/ 464 long Geometry::GetId(const GeometricalEdge * t) const { 465 return t - edges; 466 }/*}}}*/ 467 /*FUNCTION Geometry::GetId(const Curve * c){{{1*/ 468 long Geometry::GetId(const Curve * c) const { 469 return c - curves; 470 }/*}}}*/ 471 /*FUNCTION Geometry::Containing{{{1*/ 472 GeometricalEdge* Geometry::Containing(const R2 P, GeometricalEdge * start) const { 473 /*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, MeshGeom.cpp/Contening)*/ 474 475 GeometricalEdge* on =start,* pon=0; 476 // walk with the cos on geometry 477 int counter=0; 478 while(pon != on){ 479 counter++; 480 ISSMASSERT(counter<100); 481 pon = on; 482 R2 A= (*on)[0]; 483 R2 B= (*on)[1]; 484 R2 AB = B-A; 485 R2 AP = P-A; 486 R2 BP = P-B; 487 if ( (AB,AP) < 0) 488 on = on->Adj[0]; 489 else if ( (AB,BP) > 0) 490 on = on->Adj[1]; 491 else 492 return on; 493 } 494 return on; 495 } 496 /*}}}1*/ 402 497 /*FUNCTION Geometry::PostRead{{{1*/ 403 498 void Geometry::PostRead(){ … … 420 515 421 516 /*build integer coordinates (non unique) 422 these coordinates are used by the quadtree to group423 the vertices by groups of 5:424 All the coordinates are transformed to ]0,1[^2425 then, the integer coordinates are computed using426 the transformation ]0,1[^2 -> [0 2^30-1[^2 for a quadtree of depth 30*/517 these coordinates are used by the quadtree to group 518 the vertices by groups of 5: 519 All the coordinates are transformed to ]0,1[^2 520 then, the integer coordinates are computed using 521 the transformation ]0,1[^2 -> [0 2^30-1[^2 for a quadtree of depth 30*/ 427 522 vertices[i].i=R2ToI2(vertices[i].r); 428 523 … … 669 764 GeometricalVertex *a=(*e)(k0); // begin 670 765 if(curves){ 671 curves[nbcurves]. be=e;672 curves[nbcurves]. kb=k0;766 curves[nbcurves].FirstEdge=e; 767 curves[nbcurves].FirstVertexIndex=k0; 673 768 } 674 769 int nee=0; … … 679 774 nb_marked_edges++; 680 775 e->CurveNumber=nbcurves; 681 if(curves){682 curves[nbcurves].ee=e;683 curves[nbcurves].ke=k1;684 }685 686 776 GeometricalVertex *b=(*e)(k1); 687 777 688 778 //break if we have reached the other end of the curve 689 779 if (a==b || b->Required()){ 780 if(curves){ 781 curves[nbcurves].LastEdge=e; 782 curves[nbcurves].LastVertexIndex=k1; 783 } 690 784 break; 691 785 } … … 706 800 if(step==0) curves=new Curve[nbcurves]; 707 801 } 708 for(int i=0;i<nbcurves ;i++){709 GeometricalEdge * be=curves[i].be, *eqbe=be;710 //GeometricalEdge * ee=curves[i].ee, *eqee=be;711 }712 802 713 803 /*clean up*/ … … 716 806 delete [] eangle; 717 807 718 }719 /*}}}1*/720 /*FUNCTION Geometry::Echo {{{1*/721 void Geometry::Echo(void){722 723 printf("Geometry:\n");724 printf(" nbv (number of vertices) : %i\n",nbv);725 printf(" nbe (number of edges) : %i\n",nbe);726 printf(" nbsubdomains: %i\n",nbsubdomains);727 printf(" nbcurves: %i\n",nbcurves);728 printf(" vertices: %p\n",vertices);729 printf(" edges: %p\n",edges);730 printf(" quadtree: %p\n",quadtree);731 printf(" subdomains: %p\n",subdomains);732 printf(" curves: %p\n",curves);733 printf(" pmin (x,y): (%g %g)\n",pmin.x,pmin.y);734 printf(" pmax (x,y): (%g %g)\n",pmax.x,pmax.y);735 printf(" coefIcoor: %g\n",coefIcoor);736 printf(" MaxCornerAngle: %g\n",MaxCornerAngle);737 738 return;739 }740 /*}}}*/741 /*FUNCTION Geometry::Init{{{1*/742 void Geometry::Init(void){743 /*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, MeshGeom.cpp/EmptyGeometry)*/744 745 NbRef=0;746 nbv=0;747 nbe=0;748 quadtree=NULL;749 curves=NULL;750 edges=NULL;751 vertices=NULL;752 nbsubdomains=0;753 nbcurves=0;754 subdomains=NULL;755 MaxCornerAngle = 10*Pi/180; //default is 10 degres756 }757 /*}}}1*/758 /*FUNCTION Geometry::MinimalHmin{{{1*/759 double Geometry::MinimalHmin() {760 /* coeffIcoor = (2^30-1)/D761 * We cannot go beyond hmin = D/2^30 because of the quadtree762 * hmin is therefore approximately 2/coeffIcoor */763 return 2.0/coefIcoor;764 }/*}}}*/765 /*FUNCTION Geometry::MaximalHmax{{{1*/766 double Geometry::MaximalHmax() {767 return Max(pmax.x-pmin.x,pmax.y-pmin.y);768 }/*}}}*/769 /*FUNCTION Geometry::GetId(const GeometricalVertex &t){{{1*/770 long Geometry::GetId(const GeometricalVertex & t) const {771 return &t - vertices;772 }/*}}}*/773 /*FUNCTION Geometry::GetId(const GeometricalVertex * t){{{1*/774 long Geometry::GetId(const GeometricalVertex * t) const {775 return t - vertices;776 }/*}}}*/777 /*FUNCTION Geometry::GetId(const GeometricalEdge & t){{{1*/778 long Geometry::GetId(const GeometricalEdge & t) const {779 return &t - edges;780 }/*}}}*/781 /*FUNCTION Geometry::GetId(const GeometricalEdge * t){{{1*/782 long Geometry::GetId(const GeometricalEdge * t) const {783 return t - edges;784 }/*}}}*/785 /*FUNCTION Geometry::GetId(const Curve * c){{{1*/786 long Geometry::GetId(const Curve * c) const {787 return c - curves;788 }/*}}}*/789 /*FUNCTION Geometry::Containing{{{1*/790 GeometricalEdge* Geometry::Containing(const R2 P, GeometricalEdge * start) const {791 /*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, MeshGeom.cpp/Contening)*/792 793 GeometricalEdge* on =start,* pon=0;794 // walk with the cos on geometry795 int counter=0;796 while(pon != on){797 counter++;798 ISSMASSERT(counter<100);799 pon = on;800 R2 A= (*on)[0];801 R2 B= (*on)[1];802 R2 AB = B-A;803 R2 AP = P-A;804 R2 BP = P-B;805 if ( (AB,AP) < 0)806 on = on->Adj[0];807 else if ( (AB,BP) > 0)808 on = on->Adj[1];809 else810 return on;811 }812 return on;813 808 } 814 809 /*}}}1*/ -
issm/trunk/src/c/objects/Bamg/Mesh.cpp
r5397 r5400 957 957 c=bamgopts->metric[i*3+2]; 958 958 Metric M(a,b,c); 959 MatVVP2x2Vp(M/coef);959 EigenMetric Vp(M/coef); 960 960 961 961 Vp.Maxh(hmax); … … 1028 1028 ISSMERROR("ht<=0 || hn<=0"); 1029 1029 } 1030 MatVVP2x2Vp(1/(ht*ht),1/(hn*hn),tg);1030 EigenMetric Vp(1/(ht*ht),1/(hn*hn),tg); 1031 1031 Metric MVp(Vp); 1032 1032 edges[i][j].m.IntersectWith(MVp); … … 1212 1212 //loop over all vertices 1213 1213 for (int i=0;i<nbv;i++){ 1214 MatVVP2x2Vp(vertices[i]);1214 EigenMetric Vp(vertices[i]); 1215 1215 double lmax=Vp.lmax(); 1216 1216 Vp*=Min(lminaniso,lmax)/lmax; … … 2109 2109 // Compute the matrix with abs(eigen value) 2110 2110 Metric M(dxdx[iv], dxdy[iv], dydy[iv]); 2111 MatVVP2x2Vp(M);2111 EigenMetric Vp(M); 2112 2112 Vp.Abs(); 2113 2113 M = Vp; … … 3935 3935 D2xD2 B1B1 = B1K.t()*B1K; 3936 3936 Metric MK(B1B1.x.x,B1B1.x.y,B1B1.y.y); 3937 MatVVP2x2VMK(MK);3937 EigenMetric VMK(MK); 3938 3938 alpha2 = Max(alpha2,Max(VMK.lambda1/VMK.lambda2,VMK.lambda2/VMK.lambda1)); 3939 3939 double betaK=0; … … 3950 3950 D2xD2 BMB = BK.t()*M*BK; 3951 3951 Metric M1(BMB.x.x,BMB.x.y,BMB.y.y); 3952 MatVVP2x2VM1(M1);3952 EigenMetric VM1(M1); 3953 3953 gammamn=Min3(gammamn,VM1.lambda1,VM1.lambda2); 3954 3954 gammamx=Max3(gammamx,VM1.lambda1,VM1.lambda2); … … 5278 5278 5279 5279 //printf("Dealing with curve number %i\n",nc); 5280 //printf("edge on geometry is same as GhCurve? %s\n",(ei.GeometricalEdgeHook==Gh.curves[nc]. be || ei.GeometricalEdgeHook==Gh.curves[nc].ee)?"yes":"no");5281 //if(ei.GeometricalEdgeHook==Gh.curves[nc]. be || ei.GeometricalEdgeHook==Gh.curves[nc].ee){5282 // printf("Do we have the right extremity? curve first vertex -> %s\n",((GeometricalVertex *)*ei[je].GeometricalEdgeHook==&(*Gh.curves[nc]. be)[Gh.curves[nc].kb])?"yes":"no");5283 // printf("Do we have the right extremity? curve last vertex -> %s\n",((GeometricalVertex *)*ei[je].GeometricalEdgeHook==&(*Gh.curves[nc]. ee)[Gh.curves[nc].ke])?"yes":"no");5280 //printf("edge on geometry is same as GhCurve? %s\n",(ei.GeometricalEdgeHook==Gh.curves[nc].FirstEdge || ei.GeometricalEdgeHook==Gh.curves[nc].LastEdge)?"yes":"no"); 5281 //if(ei.GeometricalEdgeHook==Gh.curves[nc].FirstEdge || ei.GeometricalEdgeHook==Gh.curves[nc].LastEdge){ 5282 // printf("Do we have the right extremity? curve first vertex -> %s\n",((GeometricalVertex *)*ei[je].GeometricalEdgeHook==&(*Gh.curves[nc].FirstEdge)[Gh.curves[nc].FirstVertexIndex])?"yes":"no"); 5283 // printf("Do we have the right extremity? curve last vertex -> %s\n",((GeometricalVertex *)*ei[je].GeometricalEdgeHook==&(*Gh.curves[nc].LastEdge)[Gh.curves[nc].LastVertexIndex])?"yes":"no"); 5284 5284 //} 5285 5285 //BUG FIX from original bamg 5286 5286 /*Check that we are on the same edge and right vertex (0 or 1) */ 5287 if(ei.GeometricalEdgeHook==Gh.curves[nc]. be && (GeometricalVertex *)*ei[je].GeometricalEdgeHook==&(*Gh.curves[nc].be)[Gh.curves[nc].kb]){5287 if(ei.GeometricalEdgeHook==Gh.curves[nc].FirstEdge && (GeometricalVertex *)*ei[je].GeometricalEdgeHook==&(*Gh.curves[nc].FirstEdge)[Gh.curves[nc].FirstVertexIndex]){ 5288 5288 bcurve[nc]=iedge*2+je; 5289 5289 bfind++; 5290 5290 } 5291 else if ((ei.GeometricalEdgeHook==Gh.curves[nc]. ee && (GeometricalVertex *)*ei[je].GeometricalEdgeHook==&(*Gh.curves[nc].ee)[Gh.curves[nc].ke]) && bcurve[nc]==-1){5291 else if ((ei.GeometricalEdgeHook==Gh.curves[nc].LastEdge && (GeometricalVertex *)*ei[je].GeometricalEdgeHook==&(*Gh.curves[nc].LastEdge)[Gh.curves[nc].LastVertexIndex]) && bcurve[nc]==-1){ 5292 5292 bcurve[nc]=iedge*2+je; 5293 5293 bfind++; -
issm/trunk/src/c/objects/Bamg/Metric.cpp
r5397 r5400 34 34 a[0]*m0.a22 + a[1]*m1.a22 + a[2]*m2.a22); 35 35 36 MatVVP2x2vab(mab);36 EigenMetric vab(mab); 37 37 38 38 R2 v1(vab.v.x,vab.v.y); … … 49 49 /*FUNCTION Metric::Metric(double a,const Metric ma, double b,const Metric mb){{{1*/ 50 50 Metric::Metric(double a,const Metric ma, double b,const Metric mb) { 51 /*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, Metric.cpp/ MatVVP2x2)*/51 /*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, Metric.cpp/EigenMetric)*/ 52 52 53 53 Metric mab(a*ma.a11+b*mb.a11,a*ma.a21+b*mb.a21,a*ma.a22+b*mb.a22); 54 MatVVP2x2vab(mab);54 EigenMetric vab(mab); 55 55 56 56 R2 v1(vab.v.x,vab.v.y); -
issm/trunk/src/c/objects/Bamg/Metric.h
r5151 r5400 12 12 13 13 class Metric; 14 class MatVVP2x2;14 class EigenMetric; 15 15 16 16 class Metric{ … … 22 22 23 23 //friends 24 friend class MatVVP2x2;24 friend class EigenMetric; 25 25 26 26 //functions 27 27 Metric(); 28 Metric(const MatVVP2x2);28 Metric(const EigenMetric); 29 29 Metric(double a); 30 30 Metric(double a,double b,double c); … … 51 51 }; 52 52 53 class MatVVP2x2{53 class EigenMetric{ 54 54 public: 55 55 … … 62 62 63 63 //functions 64 MatVVP2x2(const Metric );65 MatVVP2x2(double r1,double r2,const D2 vp1);64 EigenMetric(const Metric ); 65 EigenMetric(double r1,double r2,const D2 vp1); 66 66 void Echo(); 67 67 void Abs(); … … 100 100 101 101 //inlines 102 inline void MatVVP2x2::BoundAniso2(const double coef){102 inline void EigenMetric::BoundAniso2(const double coef){ 103 103 if (coef<=1.00000000001){ 104 104 if (lambda1 < lambda2) … … 114 114 } 115 115 } 116 inline Metric::Metric(const MatVVP2x2M) {116 inline Metric::Metric(const EigenMetric M) { 117 117 double v00=M.v.x*M.v.x; 118 118 double v11=M.v.y*M.v.y;
Note:
See TracChangeset
for help on using the changeset viewer.