Changeset 22990
- Timestamp:
- 07/20/18 16:20:44 (7 years ago)
- Location:
- issm/trunk-jpl/src/c/classes
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/classes/Elements/Element.h
r22989 r22990 319 319 virtual void ViscousHeating(IssmDouble* pphi,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input,Input* vz_input)=0; 320 320 virtual void WriteFieldIsovalueSegment(DataSet* segments,int fieldenum,IssmDouble fieldvalue){_error_("not implemented yet");}; 321 virtual void ZeroLevelsetCoordinates(IssmDouble** pxyz_zero,IssmDouble* xyz_list,int levelsetenum)=0;322 321 323 322 #ifdef _HAVE_GIAIVINS_ -
issm/trunk-jpl/src/c/classes/Elements/Penta.cpp
r22828 r22990 3470 3470 } 3471 3471 /*}}}*/ 3472 void Penta::ZeroLevelsetCoordinates(IssmDouble** pxyz_zero,IssmDouble* xyz_list,int levelsetenum){/*{{{*/3473 /*Compute portion of the element that is grounded*/3474 3475 int normal_orientation=0;3476 IssmDouble s1,s2;3477 IssmDouble levelset[NUMVERTICES];3478 IssmDouble* xyz_zero = xNew<IssmDouble>(4*3);3479 3480 /*Recover parameters and values*/3481 GetInputListOnVertices(&levelset[0],levelsetenum);3482 3483 if(levelset[0]*levelset[1]>0.){ //Nodes 0 and 1 are similar, so points must be found on segment 0-2 and 1-23484 /*Portion of the segments*/3485 s1=levelset[2]/(levelset[2]-levelset[1]);3486 s2=levelset[2]/(levelset[2]-levelset[0]);3487 3488 if(levelset[2]<0.) normal_orientation=1; //orientation of quadrangle at base and top, depending on distribution of levelsetfunction3489 /*New point 1*/3490 xyz_zero[3*normal_orientation+0]=xyz_list[2*3+0]+s1*(xyz_list[1*3+0]-xyz_list[2*3+0]);3491 xyz_zero[3*normal_orientation+1]=xyz_list[2*3+1]+s1*(xyz_list[1*3+1]-xyz_list[2*3+1]);3492 xyz_zero[3*normal_orientation+2]=xyz_list[2*3+2]+s1*(xyz_list[1*3+2]-xyz_list[2*3+2]);3493 3494 /*New point 0*/3495 xyz_zero[3*(1-normal_orientation)+0]=xyz_list[2*3+0]+s2*(xyz_list[0*3+0]-xyz_list[2*3+0]);3496 xyz_zero[3*(1-normal_orientation)+1]=xyz_list[2*3+1]+s2*(xyz_list[0*3+1]-xyz_list[2*3+1]);3497 xyz_zero[3*(1-normal_orientation)+2]=xyz_list[2*3+2]+s2*(xyz_list[0*3+2]-xyz_list[2*3+2]);3498 3499 /*New point 3*/3500 xyz_zero[3*(2+1-normal_orientation)+0]=xyz_list[5*3+0]+s1*(xyz_list[4*3+0]-xyz_list[5*3+0]);3501 xyz_zero[3*(2+1-normal_orientation)+1]=xyz_list[5*3+1]+s1*(xyz_list[4*3+1]-xyz_list[5*3+1]);3502 xyz_zero[3*(2+1-normal_orientation)+2]=xyz_list[5*3+2]+s1*(xyz_list[4*3+2]-xyz_list[5*3+2]);3503 3504 /*New point 4*/3505 xyz_zero[3*(2+normal_orientation)+0]=xyz_list[5*3+0]+s2*(xyz_list[3*3+0]-xyz_list[5*3+0]);3506 xyz_zero[3*(2+normal_orientation)+1]=xyz_list[5*3+1]+s2*(xyz_list[3*3+1]-xyz_list[5*3+1]);3507 xyz_zero[3*(2+normal_orientation)+2]=xyz_list[5*3+2]+s2*(xyz_list[3*3+2]-xyz_list[5*3+2]);3508 }3509 else if(levelset[1]*levelset[2]>0.){ //Nodes 1 and 2 are similar, so points must be found on segment 0-1 and 0-23510 /*Portion of the segments*/3511 s1=levelset[0]/(levelset[0]-levelset[2]);3512 s2=levelset[0]/(levelset[0]-levelset[1]);3513 3514 if(levelset[0]<0.) normal_orientation=1;3515 /*New point 1*/3516 xyz_zero[3*normal_orientation+0]=xyz_list[0*3+0]+s1*(xyz_list[2*3+0]-xyz_list[0*3+0]);3517 xyz_zero[3*normal_orientation+1]=xyz_list[0*3+1]+s1*(xyz_list[2*3+1]-xyz_list[0*3+1]);3518 xyz_zero[3*normal_orientation+2]=xyz_list[0*3+2]+s1*(xyz_list[2*3+2]-xyz_list[0*3+2]);3519 3520 /*New point 2*/3521 xyz_zero[3*(1-normal_orientation)+0]=xyz_list[0*3+0]+s2*(xyz_list[1*3+0]-xyz_list[0*3+0]);3522 xyz_zero[3*(1-normal_orientation)+1]=xyz_list[0*3+1]+s2*(xyz_list[1*3+1]-xyz_list[0*3+1]);3523 xyz_zero[3*(1-normal_orientation)+2]=xyz_list[0*3+2]+s2*(xyz_list[1*3+2]-xyz_list[0*3+2]);3524 3525 /*New point 3*/3526 xyz_zero[3*(2+1-normal_orientation)+0]=xyz_list[3*3+0]+s1*(xyz_list[5*3+0]-xyz_list[3*3+0]);3527 xyz_zero[3*(2+1-normal_orientation)+1]=xyz_list[3*3+1]+s1*(xyz_list[5*3+1]-xyz_list[3*3+1]);3528 xyz_zero[3*(2+1-normal_orientation)+2]=xyz_list[3*3+2]+s1*(xyz_list[5*3+2]-xyz_list[3*3+2]);3529 3530 /*New point 4*/3531 xyz_zero[3*(2+normal_orientation)+0]=xyz_list[3*3+0]+s2*(xyz_list[4*3+0]-xyz_list[3*3+0]);3532 xyz_zero[3*(2+normal_orientation)+1]=xyz_list[3*3+1]+s2*(xyz_list[4*3+1]-xyz_list[3*3+1]);3533 xyz_zero[3*(2+normal_orientation)+2]=xyz_list[3*3+2]+s2*(xyz_list[4*3+2]-xyz_list[3*3+2]);3534 }3535 else if(levelset[0]*levelset[2]>0.){ //Nodes 0 and 2 are similar, so points must be found on segment 1-0 and 1-23536 /*Portion of the segments*/3537 s1=levelset[1]/(levelset[1]-levelset[0]);3538 s2=levelset[1]/(levelset[1]-levelset[2]);3539 3540 if(levelset[1]<0.) normal_orientation=1;3541 /*New point 0*/3542 xyz_zero[3*normal_orientation+0]=xyz_list[1*3+0]+s1*(xyz_list[0*3+0]-xyz_list[1*3+0]);3543 xyz_zero[3*normal_orientation+1]=xyz_list[1*3+1]+s1*(xyz_list[0*3+1]-xyz_list[1*3+1]);3544 xyz_zero[3*normal_orientation+2]=xyz_list[1*3+2]+s1*(xyz_list[0*3+2]-xyz_list[1*3+2]);3545 3546 /*New point 2*/3547 xyz_zero[3*(1-normal_orientation)+0]=xyz_list[1*3+0]+s2*(xyz_list[2*3+0]-xyz_list[1*3+0]);3548 xyz_zero[3*(1-normal_orientation)+1]=xyz_list[1*3+1]+s2*(xyz_list[2*3+1]-xyz_list[1*3+1]);3549 xyz_zero[3*(1-normal_orientation)+2]=xyz_list[1*3+2]+s2*(xyz_list[2*3+2]-xyz_list[1*3+2]);3550 3551 /*New point 3*/3552 xyz_zero[3*(2+1-normal_orientation)+0]=xyz_list[4*3+0]+s1*(xyz_list[3*3+0]-xyz_list[4*3+0]);3553 xyz_zero[3*(2+1-normal_orientation)+1]=xyz_list[4*3+1]+s1*(xyz_list[3*3+1]-xyz_list[4*3+1]);3554 xyz_zero[3*(2+1-normal_orientation)+2]=xyz_list[4*3+2]+s1*(xyz_list[3*3+2]-xyz_list[4*3+2]);3555 3556 /*New point 4*/3557 xyz_zero[3*(2+normal_orientation)+0]=xyz_list[4*3+0]+s2*(xyz_list[5*3+0]-xyz_list[4*3+0]);3558 xyz_zero[3*(2+normal_orientation)+1]=xyz_list[4*3+1]+s2*(xyz_list[5*3+1]-xyz_list[4*3+1]);3559 xyz_zero[3*(2+normal_orientation)+2]=xyz_list[4*3+2]+s2*(xyz_list[5*3+2]-xyz_list[4*3+2]);3560 }3561 else if(levelset[0]==0. && levelset[1]==0.){ //front is on point 0 and 13562 xyz_zero[3*0+0]=xyz_list[0*3+0];3563 xyz_zero[3*0+1]=xyz_list[0*3+1];3564 xyz_zero[3*0+2]=xyz_list[0*3+2];3565 3566 /*New point 2*/3567 xyz_zero[3*1+0]=xyz_list[1*3+0];3568 xyz_zero[3*1+1]=xyz_list[1*3+1];3569 xyz_zero[3*1+2]=xyz_list[1*3+2];3570 3571 /*New point 3*/3572 xyz_zero[3*2+0]=xyz_list[4*3+0];3573 xyz_zero[3*2+1]=xyz_list[4*3+1];3574 xyz_zero[3*2+2]=xyz_list[4*3+2];3575 3576 /*New point 4*/3577 xyz_zero[3*3+0]=xyz_list[3*3+0];3578 xyz_zero[3*3+1]=xyz_list[3*3+1];3579 xyz_zero[3*3+2]=xyz_list[3*3+2];3580 }3581 else if(levelset[0]==0. && levelset[2]==0.){ //front is on point 0 and 13582 xyz_zero[3*0+0]=xyz_list[2*3+0];3583 xyz_zero[3*0+1]=xyz_list[2*3+1];3584 xyz_zero[3*0+2]=xyz_list[2*3+2];3585 3586 /*New point 2*/3587 xyz_zero[3*1+0]=xyz_list[0*3+0];3588 xyz_zero[3*1+1]=xyz_list[0*3+1];3589 xyz_zero[3*1+2]=xyz_list[0*3+2];3590 3591 /*New point 3*/3592 xyz_zero[3*2+0]=xyz_list[3*3+0];3593 xyz_zero[3*2+1]=xyz_list[3*3+1];3594 xyz_zero[3*2+2]=xyz_list[3*3+2];3595 3596 /*New point 4*/3597 xyz_zero[3*3+0]=xyz_list[5*3+0];3598 xyz_zero[3*3+1]=xyz_list[5*3+1];3599 xyz_zero[3*3+2]=xyz_list[5*3+2];3600 }3601 else if(levelset[1]==0. && levelset[2]==0.){ //front is on point 0 and 13602 xyz_zero[3*0+0]=xyz_list[1*3+0];3603 xyz_zero[3*0+1]=xyz_list[1*3+1];3604 xyz_zero[3*0+2]=xyz_list[1*3+2];3605 3606 /*New point 2*/3607 xyz_zero[3*1+0]=xyz_list[2*3+0];3608 xyz_zero[3*1+1]=xyz_list[2*3+1];3609 xyz_zero[3*1+2]=xyz_list[2*3+2];3610 3611 /*New point 3*/3612 xyz_zero[3*2+0]=xyz_list[5*3+0];3613 xyz_zero[3*2+1]=xyz_list[5*3+1];3614 xyz_zero[3*2+2]=xyz_list[5*3+2];3615 3616 /*New point 4*/3617 xyz_zero[3*3+0]=xyz_list[4*3+0];3618 xyz_zero[3*3+1]=xyz_list[4*3+1];3619 xyz_zero[3*3+2]=xyz_list[4*3+2];3620 }3621 else _error_("Case not covered");3622 3623 /*Assign output pointer*/3624 *pxyz_zero= xyz_zero;3625 }3626 /*}}}*/3627 3472 3628 3473 #ifdef _HAVE_GIAIVINS_ -
issm/trunk-jpl/src/c/classes/Elements/Penta.h
r22974 r22990 179 179 void VerticalSegmentIndicesBase(int** pindices,int* pnumseg); 180 180 void ViscousHeating(IssmDouble* pphi,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input,Input* vz_input); 181 void ZeroLevelsetCoordinates(IssmDouble** pxyz_zero,IssmDouble* xyz_list,int levelsetenum);182 181 183 182 #ifdef _HAVE_DAKOTA_ -
issm/trunk-jpl/src/c/classes/Elements/Seg.h
r22974 r22990 165 165 void VerticalSegmentIndicesBase(int** pindices,int* pnumseg){_error_("not implemented yet");}; 166 166 void ViscousHeating(IssmDouble* pphi,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input,Input* vz_input){_error_("not implemented yet");}; 167 void ZeroLevelsetCoordinates(IssmDouble** pxyz_zero,IssmDouble* xyz_list,int levelsetenum){_error_("not implemented");};168 167 IssmDouble GetArea3D(void){_error_("not implemented yet!");}; 169 168 IssmDouble GetAreaSpherical(void){_error_("not implemented yet!");}; -
issm/trunk-jpl/src/c/classes/Elements/Tetra.cpp
r22647 r22990 1029 1029 } 1030 1030 /*}}}*/ 1031 void Tetra::ZeroLevelsetCoordinates(IssmDouble** pxyz_zero,IssmDouble* xyz_list,int levelsetenum){/*{{{*/1032 /*Compute portion of the element that is grounded*/1033 1034 IssmDouble levelset[NUMVERTICES];1035 IssmDouble* xyz_zero = xNew<IssmDouble>(3*3);1036 1037 /*Recover parameters and values*/1038 GetInputListOnVertices(&levelset[0],levelsetenum);1039 1040 if(levelset[0]==0. && levelset[1]==0. && levelset[2]==0.){1041 xyz_zero[3*0+0]=xyz_list[0*3+0];1042 xyz_zero[3*0+1]=xyz_list[0*3+1];1043 xyz_zero[3*0+2]=xyz_list[0*3+2];1044 1045 /*New point 2*/1046 xyz_zero[3*1+0]=xyz_list[1*3+0];1047 xyz_zero[3*1+1]=xyz_list[1*3+1];1048 xyz_zero[3*1+2]=xyz_list[1*3+2];1049 1050 /*New point 3*/1051 xyz_zero[3*2+0]=xyz_list[2*3+0];1052 xyz_zero[3*2+1]=xyz_list[2*3+1];1053 xyz_zero[3*2+2]=xyz_list[2*3+2];1054 }1055 else if(levelset[0]==0. && levelset[1]==0. && levelset[3]==0.){1056 xyz_zero[3*0+0]=xyz_list[0*3+0];1057 xyz_zero[3*0+1]=xyz_list[0*3+1];1058 xyz_zero[3*0+2]=xyz_list[0*3+2];1059 1060 /*New point 2*/1061 xyz_zero[3*1+0]=xyz_list[1*3+0];1062 xyz_zero[3*1+1]=xyz_list[1*3+1];1063 xyz_zero[3*1+2]=xyz_list[1*3+2];1064 1065 /*New point 3*/1066 xyz_zero[3*2+0]=xyz_list[3*3+0];1067 xyz_zero[3*2+1]=xyz_list[3*3+1];1068 xyz_zero[3*2+2]=xyz_list[3*3+2];1069 }1070 else if(levelset[1]==0. && levelset[2]==0. && levelset[3]==0.){1071 xyz_zero[3*0+0]=xyz_list[1*3+0];1072 xyz_zero[3*0+1]=xyz_list[1*3+1];1073 xyz_zero[3*0+2]=xyz_list[1*3+2];1074 1075 /*New point 2*/1076 xyz_zero[3*1+0]=xyz_list[2*3+0];1077 xyz_zero[3*1+1]=xyz_list[2*3+1];1078 xyz_zero[3*1+2]=xyz_list[2*3+2];1079 1080 /*New point 3*/1081 xyz_zero[3*2+0]=xyz_list[3*3+0];1082 xyz_zero[3*2+1]=xyz_list[3*3+1];1083 xyz_zero[3*2+2]=xyz_list[3*3+2];1084 }1085 else if(levelset[2]==0. && levelset[0]==0. && levelset[3]==0.){1086 xyz_zero[3*0+0]=xyz_list[2*3+0];1087 xyz_zero[3*0+1]=xyz_list[2*3+1];1088 xyz_zero[3*0+2]=xyz_list[2*3+2];1089 1090 /*New point 2*/1091 xyz_zero[3*1+0]=xyz_list[0*3+0];1092 xyz_zero[3*1+1]=xyz_list[0*3+1];1093 xyz_zero[3*1+2]=xyz_list[0*3+2];1094 1095 /*New point 3*/1096 xyz_zero[3*2+0]=xyz_list[3*3+0];1097 xyz_zero[3*2+1]=xyz_list[3*3+1];1098 xyz_zero[3*2+2]=xyz_list[3*3+2];1099 }1100 else _error_("Case not covered");1101 1102 /*Assign output pointer*/1103 *pxyz_zero= xyz_zero;1104 }1105 /*}}}*/ -
issm/trunk-jpl/src/c/classes/Elements/Tetra.h
r22974 r22990 174 174 void VerticalSegmentIndicesBase(int** pindices,int* pnumseg){_error_("not implemented yet");}; 175 175 void ViscousHeating(IssmDouble* pphi,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input,Input* vz_input); 176 void ZeroLevelsetCoordinates(IssmDouble** pxyz_zero,IssmDouble* xyz_list,int levelsetenum);177 176 178 177 #ifdef _HAVE_GIAIVINS_ -
issm/trunk-jpl/src/c/classes/Elements/Tria.cpp
r22989 r22990 4119 4119 } 4120 4120 /*}}}*/ 4121 void Tria::ZeroLevelsetCoordinates(IssmDouble** pxyz_zero,IssmDouble* xyz_list,int levelsetenum){/*{{{*/4122 /* Return coordinates where levelset intersects element edges.4123 * Attention: In case that no intersection exists, NULL pointer is returned.*/4124 4125 /*Intermediaries*/4126 int numiceverts;4127 int i,n,e,counter;4128 IssmDouble s[2];4129 int *indices = NULL;4130 IssmDouble *xyz_zero = NULL;4131 4132 this->GetLevelsetIntersection(&indices, &numiceverts, s,levelsetenum,0.);4133 4134 printf("numiceverts = %i\n",numiceverts);4135 if(numiceverts>0) xyz_zero=xNew<IssmDouble>(2*3);4136 4137 if((numiceverts>0) && (numiceverts<NUMVERTICES)){4138 counter=0;4139 for(i=0;i<numiceverts;i++){4140 for(n=numiceverts;n<NUMVERTICES;n++){ // iterate over no-ice vertices4141 for(e=0;e<3;e++){ // spatial direction4142 int ind_ice = 3 *indices[i]+e;4143 int ind_noice = 3 *indices[n]+e;4144 int ind = 3 *counter+e;4145 xyz_zero[ind]=xyz_list[ind_ice]+s[counter]*(xyz_list[ind_noice]-xyz_list[ind_ice]);4146 }4147 counter++;4148 }4149 }4150 }4151 else if(numiceverts==NUMVERTICES){ //NUMVERTICES ice vertices: calving front lies on element edge4152 IssmDouble lsf[NUMVERTICES];4153 this->GetInputListOnVertices(&lsf[0],levelsetenum);4154 counter=0;4155 for(i=0;i<NUMVERTICES;i++){4156 if(lsf[indices[i]]==0.){4157 for(e=0;e<3;e++) xyz_zero[3*counter+e]=xyz_list[3*indices[i]+e];4158 counter++;4159 }4160 if(counter==2) break;4161 }4162 }4163 _assert_(counter==2);4164 4165 /*Cleanup & return*/4166 xDelete<int>(indices);4167 *pxyz_zero=xyz_zero;4168 }4169 /*}}}*/4170 4121 4171 4122 #ifdef _HAVE_GIAIVINS_ -
issm/trunk-jpl/src/c/classes/Elements/Tria.h
r22989 r22990 144 144 void VerticalSegmentIndicesBase(int** pindices,int* pnumseg){_error_("not implemented yet");}; 145 145 void WriteFieldIsovalueSegment(DataSet* segments,int fieldenum,IssmDouble fieldvalue); 146 void ZeroLevelsetCoordinates(IssmDouble** pxyz_zero,IssmDouble* xyz_list,int levelsetenum);147 146 148 147 #ifdef _HAVE_GIAIVINS_ -
issm/trunk-jpl/src/c/classes/FemModel.cpp
r22989 r22990 2067 2067 } 2068 2068 2069 2070 2069 /*Extrude if necessary*/ 2071 2070 int elementtype;
Note:
See TracChangeset
for help on using the changeset viewer.