Changeset 23720
- Timestamp:
- 02/13/19 11:49:32 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/modules/IoModelToConstraintsx/IoModelToConstraintsx.cpp
r23576 r23720 478 478 } 479 479 } 480 for(i=0;i<iomodel->numberofedges;i++){ 481 if(iomodel->edges[i*3+2]==2){ 482 if(iomodel->my_edges[i]){ 483 v1 = iomodel->edges[3*i+0]-1; 484 v2 = iomodel->edges[3*i+1]-1; 485 values=xNew<IssmDouble>(N); 486 spcpresent=false; 487 for(j=0;j<N;j++){ 488 values[j]=(spcdata[v1*N+j]+spcdata[v2*N+j])/2.; 489 if(!xIsNan<IssmDouble>(values[j])) spcpresent=true; //NaN means no spc by default 490 } 491 if(spcpresent){ 492 constraints->AddObject(new SpcTransient(count+1,iomodel->numberofvertices+i+1,dof,N,times,values,analysis_type)); 493 count++; 494 } 495 xDelete<IssmDouble>(values); 496 } 480 for(i=0;i<iomodel->numberofverticaledges;i++){ 481 if(iomodel->my_vedges[i]){ 482 v1 = iomodel->verticaledges[2*i+0]-1; 483 v2 = iomodel->verticaledges[2*i+1]-1; 484 values=xNew<IssmDouble>(N); 485 spcpresent=false; 486 for(j=0;j<N;j++){ 487 values[j]=(spcdata[v1*N+j]+spcdata[v2*N+j])/2.; 488 if(!xIsNan<IssmDouble>(values[j])) spcpresent=true; //NaN means no spc by default 489 } 490 if(spcpresent){ 491 constraints->AddObject(new SpcTransient(count+1,iomodel->numberofvertices+i+1,dof,N,times,values,analysis_type)); 492 count++; 493 } 494 xDelete<IssmDouble>(values); 497 495 } 498 496 } … … 517 515 } 518 516 } 519 for(i=0;i<iomodel->numberofedges;i++){ 520 if(iomodel->edges[i*3+2]==2){ 521 if(iomodel->my_edges[i]){ 522 v1 = iomodel->edges[3*i+0]-1; 523 v2 = iomodel->edges[3*i+1]-1; 524 values=xNew<IssmDouble>(N); 525 spcpresent=false; 526 for(j=0;j<N;j++){ 527 values[j]=2./3.*spcdata[v1*N+j]+1./3.*spcdata[v2*N+j]; 528 if(!xIsNan<IssmDouble>(values[j])) spcpresent=true; //NaN means no spc by default 529 } 530 if(spcpresent){ 531 constraints->AddObject(new SpcTransient(count+1,iomodel->numberofvertices+2*i+1,dof,N,times,values,analysis_type)); 532 count++; 533 } 534 spcpresent=false; 535 for(j=0;j<N;j++){ 536 values[j]=1./3.*spcdata[v1*N+j]+2./3.*spcdata[v2*N+j]; 537 if(!xIsNan<IssmDouble>(values[j])) spcpresent=true; //NaN means no spc by default 538 } 539 if(spcpresent){ 540 constraints->AddObject(new SpcTransient(count+1,iomodel->numberofvertices+2*i+2,dof,N,times,values,analysis_type)); 541 count++; 542 } 543 xDelete<IssmDouble>(values); 544 } 517 for(i=0;i<iomodel->numberofverticaledges;i++){ 518 if(iomodel->my_vedges[i]){ 519 v1 = iomodel->verticaledges[2*i+0]-1; 520 v2 = iomodel->verticaledges[2*i+1]-1; 521 values=xNew<IssmDouble>(N); 522 spcpresent=false; 523 for(j=0;j<N;j++){ 524 values[j]=2./3.*spcdata[v1*N+j]+1./3.*spcdata[v2*N+j]; 525 if(!xIsNan<IssmDouble>(values[j])) spcpresent=true; //NaN means no spc by default 526 } 527 if(spcpresent){ 528 constraints->AddObject(new SpcTransient(count+1,iomodel->numberofvertices+2*i+1,dof,N,times,values,analysis_type)); 529 count++; 530 } 531 spcpresent=false; 532 for(j=0;j<N;j++){ 533 values[j]=1./3.*spcdata[v1*N+j]+2./3.*spcdata[v2*N+j]; 534 if(!xIsNan<IssmDouble>(values[j])) spcpresent=true; //NaN means no spc by default 535 } 536 if(spcpresent){ 537 constraints->AddObject(new SpcTransient(count+1,iomodel->numberofvertices+2*i+2,dof,N,times,values,analysis_type)); 538 count++; 539 } 540 xDelete<IssmDouble>(values); 545 541 } 546 542 }
Note:
See TracChangeset
for help on using the changeset viewer.