Changeset 15496
- Timestamp:
- 07/16/13 08:40:57 (12 years ago)
- Location:
- issm/trunk-jpl/src/c/classes/Elements
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/classes/Elements/Penta.cpp
r15478 r15496 1011 1011 _assert_(sidlist); 1012 1012 _assert_(nodes); 1013 int numnodes = this-> GetNumberOfNodes();1013 int numnodes = this->NumberOfNodes(); 1014 1014 1015 1015 for(int i=0;i<numnodes;i++){ 1016 1016 sidlist[i]=nodes[i]->Sid(); 1017 }1018 }1019 /*}}}*/1020 /*FUNCTION Penta::GetNumberOfNodes{{{*/1021 int Penta::GetNumberOfNodes(void){1022 1023 if(this->nodes==NULL) return 0;1024 1025 switch(this->element_type){1026 case P1Enum:1027 return 6;1028 case P1DGEnum:1029 return 6;1030 default:1031 _error_("Element type "<<EnumToStringx(this->element_type)<<" not supported yet");1032 1017 } 1033 1018 } … … 2632 2617 2633 2618 /*Intermediaries*/ 2634 const int numnodes = this-> GetNumberOfNodes();2619 const int numnodes = this->NumberOfNodes(); 2635 2620 2636 2621 /*Output */ -
issm/trunk-jpl/src/c/classes/Elements/Penta.h
r15436 r15496 89 89 int GetNodeIndex(Node* node); 90 90 void GetNodesSidList(int* sidlist); 91 int GetNumberOfNodes(void);92 91 void GetSolutionFromInputs(Vector<IssmDouble>* solution); 93 92 IssmDouble GetZcoord(GaussPenta* gauss); -
issm/trunk-jpl/src/c/classes/Elements/PentaRef.cpp
r15495 r15496 18 18 #define NUMNODESP1 6 19 19 #define NUMNODESP1_2d 3 20 #define NUMNODES MINI720 #define NUMNODESP1b 7 21 21 22 22 /*Object constructors and destructor*/ … … 98 98 99 99 int i; 100 IssmDouble dbasismini[3][NUMNODES MINI];100 IssmDouble dbasismini[3][NUMNODESP1b]; 101 101 IssmDouble basis[NUMNODESP1]; 102 102 … … 106 106 107 107 /*Build B: */ 108 for(i=0;i<NUMNODES MINI;i++){108 for(i=0;i<NUMNODESP1b;i++){ 109 109 B[(NDOF4*NUMNODESP1+3)*0+NDOF4*i+0] = dbasismini[0][i]; 110 110 B[(NDOF4*NUMNODESP1+3)*0+NDOF4*i+1] = 0.; … … 221 221 222 222 int i; 223 IssmDouble dbasismini[3][NUMNODES MINI];223 IssmDouble dbasismini[3][NUMNODESP1b]; 224 224 225 225 /*Get dbasis in actual coordinate system: */ … … 227 227 228 228 /*Build Bprime: */ 229 for(i=0;i<NUMNODES MINI;i++){229 for(i=0;i<NUMNODESP1b;i++){ 230 230 Bprime[(NDOF4*NUMNODESP1+3)*0+NDOF4*i+0] = 2.*dbasismini[0][i]; 231 231 Bprime[(NDOF4*NUMNODESP1+3)*0+NDOF4*i+1] = dbasismini[1][i]; … … 266 266 int i; 267 267 268 IssmDouble dbasismini[3][NUMNODES MINI];268 IssmDouble dbasismini[3][NUMNODESP1b]; 269 269 IssmDouble basis[NUMNODESP1]; 270 270 … … 274 274 275 275 /*Build B: */ 276 for(i=0;i<NUMNODES MINI;i++){276 for(i=0;i<NUMNODESP1b;i++){ 277 277 B[(NDOF4*NUMNODESP1+3)*0+NDOF4*i+0] = dbasismini[0][i+0]; //B[0][NDOF4*i+0] = dbasis[0][i+0]; 278 278 B[(NDOF4*NUMNODESP1+3)*0+NDOF4*i+1] = 0.; … … 399 399 400 400 int i; 401 IssmDouble dbasismini[3][NUMNODES MINI];401 IssmDouble dbasismini[3][NUMNODESP1b]; 402 402 IssmDouble basis[NUMNODESP1]; 403 403 … … 407 407 408 408 /*B_primeuild B_prime: */ 409 for(i=0;i<NUMNODES MINI;i++){409 for(i=0;i<NUMNODESP1b;i++){ 410 410 B_prime[(NDOF4*NUMNODESP1+3)*0+NDOF4*i+0] = dbasismini[0][i]; 411 411 B_prime[(NDOF4*NUMNODESP1+3)*0+NDOF4*i+1] = 0.; … … 1198 1198 case P1Enum: case P1DGEnum: 1199 1199 /*Nodal function 1*/ 1200 dbasis[NUMNODESP1*0+0] =-0.5*(1.0-zeta)/2.0;1201 dbasis[NUMNODESP1*1+0] =-SQRT3/6.0*(1.0-zeta)/2.0;1202 dbasis[NUMNODESP1*2+0] =-0.5*gauss->coord1;1200 dbasis[NUMNODESP1*0+0] = (zeta-1.)/4.; 1201 dbasis[NUMNODESP1*1+0] = SQRT3/12.*(zeta-1.); 1202 dbasis[NUMNODESP1*2+0] = -.5*gauss->coord1; 1203 1203 /*Nodal function 2*/ 1204 dbasis[NUMNODESP1*0+1] =0.5*(1.0-zeta)/2.0;1205 dbasis[NUMNODESP1*1+1] =-SQRT3/6.0*(1.0-zeta)/2.0;1206 dbasis[NUMNODESP1*2+1] =-0.5*gauss->coord2;1204 dbasis[NUMNODESP1*0+1] = (1.-zeta)/4.; 1205 dbasis[NUMNODESP1*1+1] = SQRT3/12.*(zeta-1); 1206 dbasis[NUMNODESP1*2+1] = -.5*gauss->coord2; 1207 1207 /*Nodal function 3*/ 1208 dbasis[NUMNODESP1*0+2] =0.;1209 dbasis[NUMNODESP1*1+2] =SQRT3/3.0*(1.0-zeta)/2.0;1210 dbasis[NUMNODESP1*2+2] =-0.5*gauss->coord3;1208 dbasis[NUMNODESP1*0+2] = 0.; 1209 dbasis[NUMNODESP1*1+2] = SQRT3/6.*(1.-zeta); 1210 dbasis[NUMNODESP1*2+2] = -.5*gauss->coord3; 1211 1211 /*Nodal function 4*/ 1212 dbasis[NUMNODESP1*0+3] =-0.5*(1.0+zeta)/2.0;1213 dbasis[NUMNODESP1*1+3] =-SQRT3/6.0*(1.0+zeta)/2.0;1214 dbasis[NUMNODESP1*2+3] =0.5*gauss->coord1;1212 dbasis[NUMNODESP1*0+3] = -(1.+zeta)/4.; 1213 dbasis[NUMNODESP1*1+3] = -SQRT3/12.*(1.+zeta); 1214 dbasis[NUMNODESP1*2+3] = .5*gauss->coord1; 1215 1215 /*Nodal function 5*/ 1216 dbasis[NUMNODESP1*0+4] =0.5*(1.0+zeta)/2.0;1217 dbasis[NUMNODESP1*1+4] =-SQRT3/6.0*(1.0+zeta)/2.0;1218 dbasis[NUMNODESP1*2+4] =0.5*gauss->coord2;1216 dbasis[NUMNODESP1*0+4] = (1.+zeta)/4.; 1217 dbasis[NUMNODESP1*1+4] = -SQRT3/12.*(1.+zeta); 1218 dbasis[NUMNODESP1*2+4] = .5*gauss->coord2; 1219 1219 /*Nodal function 6*/ 1220 dbasis[NUMNODESP1*0+5]=0.; 1221 dbasis[NUMNODESP1*1+5]=SQRT3/3.0*(1.0+zeta)/2.0; 1222 dbasis[NUMNODESP1*2+5]=0.5*gauss->coord3; 1223 case MINIEnum: 1220 dbasis[NUMNODESP1*0+5] = 0.; 1221 dbasis[NUMNODESP1*1+5] = SQRT3/6.*(1.+zeta); 1222 dbasis[NUMNODESP1*2+5] = .5*gauss->coord3; 1223 return; 1224 case P1bubbleEnum: 1224 1225 /*Nodal function 1*/ 1225 dbasis[NUMNODES MINI*0+0]=-0.5*(1.0-zeta)/2.0;1226 dbasis[NUMNODES MINI*1+0]=-SQRT3/6.0*(1.0-zeta)/2.0;1227 dbasis[NUMNODES MINI*2+0]=-0.5*gauss->coord1;1226 dbasis[NUMNODESP1*0+0] = (zeta-1.)/4.; 1227 dbasis[NUMNODESP1*1+0] = SQRT3/12.*(zeta-1.); 1228 dbasis[NUMNODESP1*2+0] = -.5*gauss->coord1; 1228 1229 /*Nodal function 2*/ 1229 dbasis[NUMNODES MINI*0+1]=0.5*(1.0-zeta)/2.0;1230 dbasis[NUMNODES MINI*1+1]=-SQRT3/6.0*(1.0-zeta)/2.0;1231 dbasis[NUMNODES MINI*2+1]=-0.5*gauss->coord2;1230 dbasis[NUMNODESP1*0+1] = (1.-zeta)/4.; 1231 dbasis[NUMNODESP1*1+1] = SQRT3/12.*(zeta-1); 1232 dbasis[NUMNODESP1*2+1] = -.5*gauss->coord2; 1232 1233 /*Nodal function 3*/ 1233 dbasis[NUMNODES MINI*0+2]=0.;1234 dbasis[NUMNODES MINI*1+2]=SQRT3/3.0*(1.0-zeta)/2.0;1235 dbasis[NUMNODES MINI*2+2]=-0.5*gauss->coord3;1234 dbasis[NUMNODESP1*0+2] = 0.; 1235 dbasis[NUMNODESP1*1+2] = SQRT3/6.*(1.-zeta); 1236 dbasis[NUMNODESP1*2+2] = -.5*gauss->coord3; 1236 1237 /*Nodal function 4*/ 1237 dbasis[NUMNODES MINI*0+3]=-0.5*(1.0+zeta)/2.0;1238 dbasis[NUMNODES MINI*1+3]=-SQRT3/6.0*(1.0+zeta)/2.0;1239 dbasis[NUMNODES MINI*2+3]=0.5*gauss->coord1;1238 dbasis[NUMNODESP1*0+3] = -(1.+zeta)/4.; 1239 dbasis[NUMNODESP1*1+3] = -SQRT3/12.*(1.+zeta); 1240 dbasis[NUMNODESP1*2+3] = .5*gauss->coord1; 1240 1241 /*Nodal function 5*/ 1241 dbasis[NUMNODES MINI*0+4]=0.5*(1.0+zeta)/2.0;1242 dbasis[NUMNODES MINI*1+4]=-SQRT3/6.0*(1.0+zeta)/2.0;1243 dbasis[NUMNODES MINI*2+4]=0.5*gauss->coord2;1242 dbasis[NUMNODESP1*0+4] = (1.+zeta)/4.; 1243 dbasis[NUMNODESP1*1+4] = -SQRT3/12.*(1.+zeta); 1244 dbasis[NUMNODESP1*2+4] = .5*gauss->coord2; 1244 1245 /*Nodal function 6*/ 1245 dbasis[NUMNODES MINI*0+5]=0.;1246 dbasis[NUMNODES MINI*1+5]=SQRT3/3.0*(1.0+zeta)/2.0;1247 dbasis[NUMNODES MINI*2+5]=0.5*gauss->coord3;1246 dbasis[NUMNODESP1*0+5] = 0.; 1247 dbasis[NUMNODESP1*1+5] = SQRT3/6.*(1.+zeta); 1248 dbasis[NUMNODESP1*2+5] = .5*gauss->coord3; 1248 1249 /*Nodal function 7*/ 1249 dbasis[NUMNODES MINI*0+6]=27.*(1.+zeta)*(1.-zeta)*(-.5*gauss->coord2*gauss->coord3 + .5*gauss->coord1*gauss->coord3);1250 dbasis[NUMNODES MINI*1+6]=27.*(1.+zeta)*(1.-zeta)*SQRT3*(-1./6.*gauss->coord2*gauss->coord3 - 1./6.*gauss->coord1*gauss->coord3 +1./3.*gauss->coord1*gauss->coord2);1251 dbasis[NUMNODES MINI*2+6]=27*gauss->coord1*gauss->coord2*gauss->coord3*(-2.0*zeta);1250 dbasis[NUMNODESP1b*0+6] = 27.*(1.+zeta)*(1.-zeta)*(-.5*gauss->coord2*gauss->coord3 + .5*gauss->coord1*gauss->coord3); 1251 dbasis[NUMNODESP1b*1+6] = 27.*(1.+zeta)*(1.-zeta)*SQRT3*(-1./6.*gauss->coord2*gauss->coord3 - 1./6.*gauss->coord1*gauss->coord3 +1./3.*gauss->coord1*gauss->coord2); 1252 dbasis[NUMNODESP1b*2+6] = -54*gauss->coord1*gauss->coord2*gauss->coord3*zeta; 1252 1253 return; 1253 1254 default: … … 1278 1279 * actual coordinate system): */ 1279 1280 1280 IssmDouble dbasismini_ref[3][NUMNODES MINI];1281 IssmDouble dbasismini_ref[3][NUMNODESP1b]; 1281 1282 IssmDouble Jinv[3][3]; 1282 1283 … … 1294 1295 */ 1295 1296 1296 for(int i=0;i<NUMNODES MINI;i++){1297 *(dbasismini+NUMNODES MINI*0+i)=Jinv[0][0]*dbasismini_ref[0][i]+Jinv[0][1]*dbasismini_ref[1][i]+Jinv[0][2]*dbasismini_ref[2][i];1298 *(dbasismini+NUMNODES MINI*1+i)=Jinv[1][0]*dbasismini_ref[0][i]+Jinv[1][1]*dbasismini_ref[1][i]+Jinv[1][2]*dbasismini_ref[2][i];1299 *(dbasismini+NUMNODES MINI*2+i)=Jinv[2][0]*dbasismini_ref[0][i]+Jinv[2][1]*dbasismini_ref[1][i]+Jinv[2][2]*dbasismini_ref[2][i];1297 for(int i=0;i<NUMNODESP1b;i++){ 1298 *(dbasismini+NUMNODESP1b*0+i)=Jinv[0][0]*dbasismini_ref[0][i]+Jinv[0][1]*dbasismini_ref[1][i]+Jinv[0][2]*dbasismini_ref[2][i]; 1299 *(dbasismini+NUMNODESP1b*1+i)=Jinv[1][0]*dbasismini_ref[0][i]+Jinv[1][1]*dbasismini_ref[1][i]+Jinv[1][2]*dbasismini_ref[2][i]; 1300 *(dbasismini+NUMNODESP1b*2+i)=Jinv[2][0]*dbasismini_ref[0][i]+Jinv[2][1]*dbasismini_ref[1][i]+Jinv[2][2]*dbasismini_ref[2][i]; 1300 1301 } 1301 1302 … … 1310 1311 1311 1312 /*Nodal function 1*/ 1312 dbasis[NUMNODES MINI*0+0]=-0.5*(1.0-zeta)/2.0;1313 dbasis[NUMNODES MINI*1+0]=-SQRT3/6.0*(1.0-zeta)/2.0;1314 dbasis[NUMNODES MINI*2+0]=-0.5*gauss->coord1;1313 dbasis[NUMNODESP1b*0+0]=-0.5*(1.0-zeta)/2.0; 1314 dbasis[NUMNODESP1b*1+0]=-SQRT3/6.0*(1.0-zeta)/2.0; 1315 dbasis[NUMNODESP1b*2+0]=-0.5*gauss->coord1; 1315 1316 /*Nodal function 2*/ 1316 dbasis[NUMNODES MINI*0+1]=0.5*(1.0-zeta)/2.0;1317 dbasis[NUMNODES MINI*1+1]=-SQRT3/6.0*(1.0-zeta)/2.0;1318 dbasis[NUMNODES MINI*2+1]=-0.5*gauss->coord2;1317 dbasis[NUMNODESP1b*0+1]=0.5*(1.0-zeta)/2.0; 1318 dbasis[NUMNODESP1b*1+1]=-SQRT3/6.0*(1.0-zeta)/2.0; 1319 dbasis[NUMNODESP1b*2+1]=-0.5*gauss->coord2; 1319 1320 /*Nodal function 3*/ 1320 dbasis[NUMNODES MINI*0+2]=0.;1321 dbasis[NUMNODES MINI*1+2]=SQRT3/3.0*(1.0-zeta)/2.0;1322 dbasis[NUMNODES MINI*2+2]=-0.5*gauss->coord3;1321 dbasis[NUMNODESP1b*0+2]=0.; 1322 dbasis[NUMNODESP1b*1+2]=SQRT3/3.0*(1.0-zeta)/2.0; 1323 dbasis[NUMNODESP1b*2+2]=-0.5*gauss->coord3; 1323 1324 /*Nodal function 4*/ 1324 dbasis[NUMNODES MINI*0+3]=-0.5*(1.0+zeta)/2.0;1325 dbasis[NUMNODES MINI*1+3]=-SQRT3/6.0*(1.0+zeta)/2.0;1326 dbasis[NUMNODES MINI*2+3]=0.5*gauss->coord1;1325 dbasis[NUMNODESP1b*0+3]=-0.5*(1.0+zeta)/2.0; 1326 dbasis[NUMNODESP1b*1+3]=-SQRT3/6.0*(1.0+zeta)/2.0; 1327 dbasis[NUMNODESP1b*2+3]=0.5*gauss->coord1; 1327 1328 /*Nodal function 5*/ 1328 dbasis[NUMNODES MINI*0+4]=0.5*(1.0+zeta)/2.0;1329 dbasis[NUMNODES MINI*1+4]=-SQRT3/6.0*(1.0+zeta)/2.0;1330 dbasis[NUMNODES MINI*2+4]=0.5*gauss->coord2;1329 dbasis[NUMNODESP1b*0+4]=0.5*(1.0+zeta)/2.0; 1330 dbasis[NUMNODESP1b*1+4]=-SQRT3/6.0*(1.0+zeta)/2.0; 1331 dbasis[NUMNODESP1b*2+4]=0.5*gauss->coord2; 1331 1332 /*Nodal function 6*/ 1332 dbasis[NUMNODES MINI*0+5]=0.;1333 dbasis[NUMNODES MINI*1+5]=SQRT3/3.0*(1.0+zeta)/2.0;1334 dbasis[NUMNODES MINI*2+5]=0.5*gauss->coord3;1333 dbasis[NUMNODESP1b*0+5]=0.; 1334 dbasis[NUMNODESP1b*1+5]=SQRT3/3.0*(1.0+zeta)/2.0; 1335 dbasis[NUMNODESP1b*2+5]=0.5*gauss->coord3; 1335 1336 /*Nodal function 7*/ 1336 dbasis[NUMNODES MINI*0+6]=27.*(1.+zeta)*(1.-zeta)*(-.5*gauss->coord2*gauss->coord3 + .5*gauss->coord1*gauss->coord3);1337 dbasis[NUMNODES MINI*1+6]=27.*(1.+zeta)*(1.-zeta)*SQRT3*(-1./6.*gauss->coord2*gauss->coord3 - 1./6.*gauss->coord1*gauss->coord3 +1./3.*gauss->coord1*gauss->coord2);1338 dbasis[NUMNODES MINI*2+6]=27*gauss->coord1*gauss->coord2*gauss->coord3*(-2.0*zeta);1337 dbasis[NUMNODESP1b*0+6]=27.*(1.+zeta)*(1.-zeta)*(-.5*gauss->coord2*gauss->coord3 + .5*gauss->coord1*gauss->coord3); 1338 dbasis[NUMNODESP1b*1+6]=27.*(1.+zeta)*(1.-zeta)*SQRT3*(-1./6.*gauss->coord2*gauss->coord3 - 1./6.*gauss->coord1*gauss->coord3 +1./3.*gauss->coord1*gauss->coord2); 1339 dbasis[NUMNODESP1b*2+6]=27*gauss->coord1*gauss->coord2*gauss->coord3*(-2.0*zeta); 1339 1340 } 1340 1341 /*}}}*/ … … 1504 1505 switch(this->element_type){ 1505 1506 case P1Enum: return NUMNODESP1; 1506 case MINIEnum: return NUMNODES MINI;1507 case MINIEnum: return NUMNODESP1b; 1507 1508 default: _error_("Element type "<<EnumToStringx(this->element_type)<<" not supported yet"); 1508 1509 } -
issm/trunk-jpl/src/c/classes/Elements/Tria.cpp
r15486 r15496 122 122 123 123 /*Intermediaries*/ 124 const int numnodes = this-> GetNumberOfNodes();124 const int numnodes = this->NumberOfNodes(); 125 125 126 126 /*Output */ … … 896 896 _assert_(sidlist); 897 897 _assert_(nodes); 898 int numnodes = this-> GetNumberOfNodes();898 int numnodes = this->NumberOfNodes(); 899 899 900 900 for(int i=0;i<numnodes;i++){ 901 901 sidlist[i]=nodes[i]->Sid(); 902 }903 }904 /*}}}*/905 /*FUNCTION Tria::GetNumberOfNodes{{{*/906 int Tria::GetNumberOfNodes(void){907 908 if(this->nodes==NULL) return 0;909 910 switch(this->element_type){911 case P1Enum:912 return 3;913 case P1DGEnum:914 return 3;915 case P2Enum:916 return 6;917 default:918 _error_("Element type "<<EnumToStringx(this->element_type)<<" not supported yet");919 902 } 920 903 } … … 5216 5199 5217 5200 /*Constants*/ 5218 const int numnodes = this-> GetNumberOfNodes();5201 const int numnodes = this->NumberOfNodes(); 5219 5202 const int numdof = NDOF2*numnodes; 5220 5203 -
issm/trunk-jpl/src/c/classes/Elements/Tria.h
r15433 r15496 83 83 void Delta18oParameterization(void); 84 84 int GetNodeIndex(Node* node); 85 int GetNumberOfNodes(void);86 85 void GetNodesSidList(int* sidlist); 87 86 int Sid(); -
issm/trunk-jpl/src/c/classes/Elements/TriaRef.cpp
r15492 r15496 530 530 /*Nodal function 1*/ 531 531 dbasis[NUMNODESP1*0+0] = -0.5; 532 dbasis[NUMNODESP1*1+0] = - 1.0/(2.0*SQRT3);532 dbasis[NUMNODESP1*1+0] = -SQRT3/6.; 533 533 /*Nodal function 2*/ 534 534 dbasis[NUMNODESP1*0+1] = 0.5; 535 dbasis[NUMNODESP1*1+1] = - 1.0/(2.0*SQRT3);535 dbasis[NUMNODESP1*1+1] = -SQRT3/6.; 536 536 /*Nodal function 3*/ 537 537 dbasis[NUMNODESP1*0+2] = 0; 538 dbasis[NUMNODESP1*1+2] = 1.0/SQRT3;538 dbasis[NUMNODESP1*1+2] = SQRT3/3.; 539 539 return; 540 540 case P2Enum:
Note:
See TracChangeset
for help on using the changeset viewer.