Changeset 16839 for issm/trunk-jpl/src/c/classes/Elements/Penta.cpp
- Timestamp:
- 11/20/13 19:08:46 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/classes/Elements/Penta.cpp
r16838 r16839 1511 1511 } 1512 1512 /*}}}*/ 1513 /*FUNCTION Penta:: GetQuadNormal{{{*/1514 void Penta:: GetQuadNormal(IssmDouble* normal,IssmDouble* xyz_list){1513 /*FUNCTION Penta::NormalSection{{{*/ 1514 void Penta::NormalSection(IssmDouble* normal,IssmDouble* xyz_list){ 1515 1515 1516 1516 /*Build unit outward pointing vector*/ … … 1634 1634 /*}}}*/ 1635 1635 /*FUNCTION Penta::GetZcoord {{{*/ 1636 IssmDouble Penta::GetZcoord(Gauss Penta* gauss){1636 IssmDouble Penta::GetZcoord(Gauss* gauss){ 1637 1637 1638 1638 int i; … … 2466 2466 } 2467 2467 /*}}}*/ 2468 /*FUNCTION Penta::JacobianDeterminantSurface{{{*/ 2469 void Penta::JacobianDeterminantSurface(IssmDouble* pJdet,IssmDouble* xyz_list_quad,Gauss* gauss){ 2470 2471 _assert_(gauss->Enum()==GaussPentaEnum); 2472 this->GetQuadJacobianDeterminant(pJdet,xyz_list_quad,(GaussPenta*)gauss); 2473 2474 } 2475 /*}}}*/ 2468 2476 /*FUNCTION Penta::NoIceInElement {{{*/ 2469 2477 bool Penta::NoIceInElement(){ … … 2542 2550 Gauss* Penta::NewGauss(int order){ 2543 2551 return new GaussPenta(order,order); 2552 } 2553 /*}}}*/ 2554 /*FUNCTION Penta::NewGauss(IssmDouble* xyz_list, IssmDouble* xyz_list_front,int order_horiz,int order_vert){{{*/ 2555 Gauss* Penta::NewGauss(IssmDouble* xyz_list, IssmDouble* xyz_list_front,int order_horiz,int order_vert){ 2556 2557 IssmDouble area_coordinates[4][3]; 2558 2559 GetAreaCoordinates(&area_coordinates[0][0],xyz_list_front,xyz_list,4); 2560 2561 return new GaussPenta(area_coordinates,order_horiz,order_vert); 2544 2562 } 2545 2563 /*}}}*/ … … 3123 3141 return S; 3124 3142 } 3125 }3126 /*}}}*/3127 /*FUNCTION Penta::SurfaceNormal {{{*/3128 void Penta::SurfaceNormal(IssmDouble* surface_normal, IssmDouble xyz_list[3][3]){3129 3130 int i;3131 IssmDouble v13[3],v23[3];3132 IssmDouble normal[3];3133 IssmDouble normal_norm;3134 3135 for (i=0;i<3;i++){3136 v13[i]=xyz_list[0][i]-xyz_list[2][i];3137 v23[i]=xyz_list[1][i]-xyz_list[2][i];3138 }3139 3140 normal[0]=v13[1]*v23[2]-v13[2]*v23[1];3141 normal[1]=v13[2]*v23[0]-v13[0]*v23[2];3142 normal[2]=v13[0]*v23[1]-v13[1]*v23[0];3143 3144 normal_norm=sqrt( pow(normal[0],2)+pow(normal[1],2)+pow(normal[2],2) );3145 3146 *(surface_normal)=normal[0]/normal_norm;3147 *(surface_normal+1)=normal[1]/normal_norm;3148 *(surface_normal+2)=normal[2]/normal_norm;3149 3143 } 3150 3144 /*}}}*/ … … 6072 6066 6073 6067 /*Get normal vector to the bed */ 6074 SurfaceNormal(&surface_normal[0],xyz_list_tria);6068 NormalTop(&surface_normal[0],&xyz_list_tria[0][0]); 6075 6069 6076 6070 bed_normal[0]=-surface_normal[0]; //Function is for upper surface, so the normal to the bed is the opposite of the result … … 8123 8117 ::GetVerticesCoordinates(&xyz_list[0][0],vertices,NUMVERTICES); 8124 8118 for(i=0;i<NUMVERTICES2D;i++) for(j=0;j<3;j++) xyz_list_tria[i][j]=xyz_list[i+3][j]; 8125 SurfaceNormal(&surface_normal[0],xyz_list_tria);8119 NormalTop(&surface_normal[0],&xyz_list_tria[0][0]); 8126 8120 8127 8121 /* Start looping on the number of gaussian points: */ … … 8788 8782 ZeroLevelsetCoordinates(&xyz_list_front,&xyz_list[0][0],MaskIceLevelsetEnum); 8789 8783 GetAreaCoordinates(&area_coordinates[0][0],xyz_list_front,&xyz_list[0][0],4); 8790 GetQuadNormal(&normal[0],xyz_list_front);8784 NormalSection(&normal[0],xyz_list_front); 8791 8785 8792 8786 /*Initialize gauss points*/ … … 8821 8815 /*Clean up and return*/ 8822 8816 xDelete<IssmDouble>(basis); 8817 xDelete<IssmDouble>(xyz_list_front); 8823 8818 delete gauss; 8824 8819 return pe; … … 8883 8878 ZeroLevelsetCoordinates(&xyz_list_front,&xyz_list[0][0],MaskIceLevelsetEnum); 8884 8879 GetAreaCoordinates(&area_coordinates[0][0],xyz_list_front,&xyz_list[0][0],4); 8885 GetQuadNormal(&normal[0],xyz_list_front);8880 NormalSection(&normal[0],xyz_list_front); 8886 8881 8887 8882 /*Start looping on Gaussian points*/
Note:
See TracChangeset
for help on using the changeset viewer.