Changeset 16521
- Timestamp:
- 10/22/13 14:18:40 (11 years ago)
- Location:
- issm/trunk-jpl/src/c
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/bamg/BamgQuadtree.cpp
r16233 r16521 350 350 351 351 /*if the next box exists:*/ 352 if (b=b->b[k]){352 if((b=b->b[k])){ 353 353 354 354 /*Get size (hb) and coordinates of the current sub-box lowest left corner*/ -
issm/trunk-jpl/src/c/bamg/Mesh.cpp
r16280 r16521 1152 1152 1153 1153 //some checks 1154 if (( infvertexindex <0 ) && (detOld <0) || ( infvertexindex >=0 ) && (detOld >0) ){1154 if(((infvertexindex <0 ) && (detOld <0)) || ((infvertexindex >=0) && (detOld >0)) ){ 1155 1155 _error_("inconsistent configuration (Contact ISSM developers)"); 1156 1156 } … … 2761 2761 vertices=new BamgVertex[maxnbv]; 2762 2762 _assert_(vertices); 2763 orderedvertices=new (BamgVertex* [maxnbv]);2763 orderedvertices=new BamgVertex* [maxnbv]; 2764 2764 _assert_(orderedvertices); 2765 2765 triangles=new Triangle[maxnbt]; … … 3010 3010 _error_("!Gh.nbe"); 3011 3011 } 3012 Edge **e= new (Edge* [Gh.nbe]);3012 Edge **e= new Edge* [Gh.nbe]; 3013 3013 3014 3014 long i; … … 3115 3115 for (int j=0;j<3;j++){ 3116 3116 Triangle &tt = *t.TriangleAdj(j); 3117 if ( ! &tt || it < GetId(tt) && ( tt.link || t.link)){3117 if ( (!&tt || it < GetId(tt)) && ( tt.link || t.link)){ 3118 3118 BamgVertex &v0 = t[VerticesOfTriangularEdge[j][0]]; 3119 3119 BamgVertex &v1 = t[VerticesOfTriangularEdge[j][1]]; … … 4967 4967 } 4968 4968 BamgVertex *aa = tc.EdgeVertex(0), *bb = tc.EdgeVertex(1); 4969 if (( aa == &a ) && (bb == &b) || (bb == &a ) && (aa == &b)){4969 if (((aa == &a ) && (bb == &b)) ||((bb == &a ) && (aa == &b))){ 4970 4970 tc.SetLock(); 4971 4971 a.Optim(1,0); … … 5109 5109 detsb=-detsb; 5110 5110 5111 if (ToSwap)5111 if(ToSwap){ 5112 5112 if (dets2 < 0) {// haut 5113 5113 dets1 = (ToSwap ? dets1 : detsa) ; 5114 5114 detsa = dets2; 5115 5115 tt1 = Previous(tt2) ;} 5116 else if 5116 else if(dets2 > 0){// bas 5117 5117 dets1 = (ToSwap ? dets1 : detsb) ; 5118 5118 detsb = dets2; … … 5122 5122 tt1 = Next(tt2); 5123 5123 ret =0;} 5124 } 5124 5125 5125 5126 } -
issm/trunk-jpl/src/c/classes/Elements/PentaRef.cpp
r16350 r16521 1226 1226 if(*Jdet<0) _error_("negative jacobian determinant!"); 1227 1227 } 1228 /*}}}* 1228 /*}}}*/ 1229 1229 /*FUNCTION PentaRef::GetSegmentJacobianDeterminant{{{*/ 1230 1230 void PentaRef::GetSegmentJacobianDeterminant(IssmDouble* Jdet, IssmDouble* xyz_list,GaussPenta* gauss){ -
issm/trunk-jpl/src/c/kml/KMLFileReadUtils.cpp
r15843 r16521 314 314 315 315 /* return next non " =?/>" and move past subsequent " =?/>" */ 316 while (ktokn=strtok(NULL," =?/>")){316 while((ktokn=strtok(NULL," =?/>"))){ 317 317 318 318 /* return next non quote and move past subsequent quote */ … … 358 358 /* get additional token and compare to closing tag */ 359 359 360 if (ktag)360 if(ktag){ 361 361 if (!(kstr=KMLFileToken(fid, 362 362 NULL,NULL)) || … … 365 365 (strncmp(&(kstr[2]),&(ktag[1]),strlen(ktag)-1))) 366 366 {_error_("KMLFileTokenParse -- Missing closing tag for " << ktag << ".\n");} 367 else 367 else{ 368 368 xDelete<char>(kstr); 369 } 370 } 369 371 370 372 // _printf0_("KMLFileTokenParse -- " << ktag << "=" << *pival << ".\n"); … … 392 394 /* get additional token and compare to closing tag */ 393 395 394 if (ktag)396 if(ktag){ 395 397 if (!(kstr=KMLFileToken(fid, 396 398 NULL,NULL)) || … … 401 403 else 402 404 xDelete<char>(kstr); 405 } 403 406 404 407 // _printf0_("KMLFileTokenParse -- " << ktag << "=" << (*pbval ? "true" : "false") << ".\n"); … … 453 456 /* get additional token and compare to closing tag */ 454 457 455 if (ktag)458 if(ktag){ 456 459 if (!(kstr=KMLFileToken(fid, 457 460 NULL,NULL)) || … … 462 465 else 463 466 xDelete<char>(kstr); 467 } 464 468 465 469 // _printf0_("KMLFileTokenParse -- " << ktag << "=\"" << pstr << "\".\n"); … … 487 491 /* get additional token and compare to closing tag */ 488 492 489 if (ktag)493 if(ktag){ 490 494 if (!(kstr=KMLFileToken(fid, 491 495 NULL,NULL)) || … … 496 500 else 497 501 xDelete<char>(kstr); 502 } 498 503 499 504 // _printf0_("KMLFileTokenParse -- " << ktag << "=" << *pfval << ".\n"); … … 521 526 /* get additional token and compare to closing tag */ 522 527 523 if (ktag)528 if(ktag){ 524 529 if (!(kstr=KMLFileToken(fid, 525 530 NULL,NULL)) || … … 530 535 else 531 536 xDelete<char>(kstr); 537 } 532 538 533 539 // _printf0_("KMLFileTokenParse -- " << ktag << "=" << *pdval << ".\n"); … … 554 560 _error_("KMLFileTokenParse -- Missing double [m] field for " << ktag << ".\n"); 555 561 556 if (!*pdval)562 if(!*pdval){ 557 563 if (maxlen) 558 564 *pdval=xNew<IssmPDouble>(maxlen ); 559 565 else 560 566 *pdval=xNew<IssmPDouble>((strlen(kstr)+1)/2); 567 } 561 568 562 569 /* loop through string to get all values */ … … 585 592 /* get additional token and compare to closing tag */ 586 593 587 if (ktag)594 if(ktag){ 588 595 if (!(kstr=KMLFileToken(fid, 589 596 NULL,NULL)) || … … 594 601 else 595 602 xDelete<char>(kstr); 603 } 596 604 597 605 // _printf0_("KMLFileTokenParse -- " << ktag << "=...\n"); … … 620 628 _error_("KMLFileTokenParse -- Missing double [m x n] field for " << ktag << ".\n"); 621 629 622 if (!*pdval)630 if(!*pdval){ 623 631 if (maxlen) 624 632 *pdval=xNew<IssmPDouble>(maxlen*n ); 625 633 else 626 634 *pdval=xNew<IssmPDouble>((strlen(kstr)+1)/2); 635 } 627 636 628 637 /* loop through string to get all values */ … … 655 664 /* get additional token and compare to closing tag */ 656 665 657 if (ktag)666 if(ktag){ 658 667 if (!(kstr=KMLFileToken(fid, 659 668 NULL,NULL)) || … … 664 673 else 665 674 xDelete<char>(kstr); 675 } 666 676 667 677 // _printf0_("KMLFileTokenParse -- " << ktag << "=...\n"); … … 673 683 /*}}}*/ 674 684 /*FUNCTION KMLFileTagSkip {{{*/ 675 int KMLFileTagSkip(char* ktag, 676 FILE* fid){ 685 int KMLFileTagSkip(char* ktag, FILE* fid){ 677 686 678 687 char* kstr; … … 685 694 /* if next token is a closing tag, compare to input */ 686 695 687 while (kstr=KMLFileToken(fid, 688 NULL,NULL)) { 689 if ((kstr[0] == '<') && 690 (kstr[1] == '/') && 691 (!strncmp(&(kstr[2]),&(ktag[1]),(strcspn(ktag," >")-1)/sizeof(char)))) { 696 while((kstr=KMLFileToken(fid,NULL,NULL))){ 697 if((kstr[0] == '<') && (kstr[1] == '/') && (!strncmp(&(kstr[2]),&(ktag[1]),(strcspn(ktag," >")-1)/sizeof(char)))){ 692 698 _printf0_("KMLFileTagSkip -- closing tag " << kstr << ".\n"); 693 699 xDelete<char>(kstr); -
issm/trunk-jpl/src/c/modules/Exp2Kmlx/Exp2Kmlx.cpp
r15104 r16521 86 86 sprintf(klsty->color ,"ff000000"); 87 87 sprintf(klsty->colormode ,"normal"); 88 klsty->width ,lwidth;88 klsty->width =lwidth; 89 89 kpsty =new KML_PolyStyle(); 90 90 sprintf(kpsty->color ,"00ffffff"); -
issm/trunk-jpl/src/c/modules/InterpFromMeshToMesh2dx/InterpFromMeshToMesh2dx.cpp
r15557 r16521 99 99 100 100 /*Inside convex but outside mesh*/ 101 if (reft[it]<0 & isdefault){101 if (reft[it]<0 && isdefault){ 102 102 for(j=0;j<N_data;j++) data_interp[i*N_data+j]=defaultvalue; 103 103 continue; -
issm/trunk-jpl/src/c/modules/ModelProcessorx/Damage/CreateLoadsDamage.cpp
r16188 r16521 19 19 20 20 /*keep only this partition's nodes:*/ 21 if( (iomodel->my_vertices[i]==1)){21 if(iomodel->my_vertices[i]){ 22 22 if (xIsNan<IssmDouble>(iomodel->Data(DamageSpcdamageEnum)[i])){ //No penalty applied on spc nodes! 23 23 loads->AddObject(new Pengrid(iomodel->loadcounter+i+1,i,iomodel,DamageEvolutionAnalysisEnum)); -
issm/trunk-jpl/src/c/modules/ModelProcessorx/HydrologyDCInefficient/CreateLoadsHydrologyDCInefficient.cpp
r16291 r16521 24 24 if (iomodel->meshtype==Mesh3DEnum){ 25 25 /*keep only this partition's nodes:*/ 26 if( (iomodel->my_vertices[i]==1)){26 if(iomodel->my_vertices[i]){ 27 27 loads->AddObject(new Pengrid(iomodel->loadcounter+i+1,i,iomodel,HydrologyDCInefficientAnalysisEnum)); 28 28 } 29 29 } 30 30 else if(reCast<int>(iomodel->Data(MeshVertexonbedEnum)[i])){ 31 if( (iomodel->my_vertices[i]==1)){31 if(iomodel->my_vertices[i]){ 32 32 loads->AddObject(new Pengrid(iomodel->loadcounter+i+1,i,iomodel,HydrologyDCInefficientAnalysisEnum)); 33 33 } -
issm/trunk-jpl/src/c/modules/ModelProcessorx/Melting/CreateLoadsMelting.cpp
r16291 r16521 20 20 21 21 for(int i=0;i<iomodel->numberofvertices;i++){ 22 if( (iomodel->my_vertices[i]==1)){22 if(iomodel->my_vertices[i]){ 23 23 if (reCast<int>(iomodel->Data(MeshVertexonbedEnum)[i])){ 24 24 loads->AddObject(new Pengrid(iomodel->loadcounter+i+1,i,iomodel,MeltingAnalysisEnum)); -
issm/trunk-jpl/src/c/modules/ModelProcessorx/StressbalanceSIA/CreateConstraintsStressbalanceSIA.cpp
r16164 r16521 38 38 /*keep only this partition's nodes:*/ 39 39 if((iomodel->my_vertices[i])){ 40 if ( !reCast<int,IssmDouble>(iomodel->Data(FlowequationVertexEquationEnum)[i])==SIAApproximationEnum){40 if (reCast<int,IssmDouble>(iomodel->Data(FlowequationVertexEquationEnum)[i])!=SIAApproximationEnum){ 41 41 42 42 constraints->AddObject(new SpcStatic(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,1,0,StressbalanceSIAAnalysisEnum)); -
issm/trunk-jpl/src/c/modules/ModelProcessorx/Thermal/CreateLoadsThermal.cpp
r16291 r16521 21 21 22 22 /*keep only this partition's nodes:*/ 23 if( (iomodel->my_vertices[i]==1)){23 if(iomodel->my_vertices[i]){ 24 24 if (xIsNan<IssmDouble>(iomodel->Data(ThermalSpctemperatureEnum)[i])){ //No penalty applied on spc nodes! 25 25 loads->AddObject(new Pengrid(iomodel->loadcounter+i+1,i,iomodel,ThermalAnalysisEnum)); -
issm/trunk-jpl/src/c/modules/Shp2Kmlx/Shp2Kmlx.cpp
r16149 r16521 223 223 sprintf(klsty->color ,"ff000000"); 224 224 sprintf(klsty->colormode ,"normal"); 225 klsty->width ,lwidth;225 klsty->width =lwidth; 226 226 kpsty =new KML_PolyStyle(); 227 227 sprintf(kpsty->color ,"00ffffff"); -
issm/trunk-jpl/src/c/shared/TriMesh/TriMeshUtils.cpp
r16231 r16521 474 474 node3=segments[3*k+0]-1; node4=segments[3*k+1]-1; 475 475 /*We are trying to find 2 elements, where position of node3 == position of node1, and position of node4 == position of node2*/ 476 if ( ( x[node3]==x[node1]) && (y[node3]==y[node1]) && (x[node4]==x[node2]) && (y[node4]==y[node2])477 || ( x[node3]==x[node2]) && (y[node3]==y[node2]) && (x[node4]==x[node1]) && (y[node4]==y[node1]) ){476 if ( ((x[node3]==x[node1]) && (y[node3]==y[node1]) && (x[node4]==x[node2]) && (y[node4]==y[node2])) 477 || ((x[node3]==x[node2]) && (y[node3]==y[node2]) && (x[node4]==x[node1]) && (y[node4]==y[node1])) ){ 478 478 /*We found the corresponding element: */ 479 479 pairs[2*j+1]=segments[3*k+2];
Note:
See TracChangeset
for help on using the changeset viewer.