Changeset 10527
- Timestamp:
- 11/08/11 11:46:01 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/c/objects/Elements/Penta.cpp
r10526 r10527 5346 5346 5347 5347 /*Constants*/ 5348 const int numdofm=NDOF2*NUMVERTICES2D; 5349 const int numdofs=NDOF4*NUMVERTICES; 5350 const int numdoftotal=2*numdofm+numdofs; 5348 const int numnodes = 2 *NUMVERTICES; 5349 const int numdofm = NDOF2 *NUMVERTICES2D; 5350 const int numdofs = NDOF4 *NUMVERTICES; 5351 const int numdoftotal = 2 *numdofm+numdofs; 5351 5352 5352 5353 /*Intermediaries */ … … 5369 5370 GaussPenta *gauss=NULL; 5370 5371 GaussTria *gauss_tria=NULL; 5372 Node *node_list[numnodes]; 5373 int cs_list[numnodes]; 5371 5374 5372 5375 /*Find penta on bed as stokes must be coupled to the dofs on the bed: */ 5373 5376 Penta* pentabase=GetBasalElement(); 5374 5377 Tria* tria=pentabase->SpawnTria(0,1,2); //nodes 0, 1 and 2 make the new tria. 5378 5379 /*Prepare node list*/ 5380 for(i=0;i<NUMVERTICES;i++){ 5381 node_list[i+0*NUMVERTICES] = pentabase->nodes[i]; 5382 node_list[i+1*NUMVERTICES] = this->nodes[i]; 5383 cs_list[i+0*NUMVERTICES] = XYEnum; 5384 cs_list[i+1*NUMVERTICES] = XYZPEnum; 5385 } 5375 5386 5376 5387 /*Initialize Element matrix and return if necessary*/ … … 5425 5436 for(i=0;i<numdofm;i++) for(j=0;j<numdofs;j++) Ke->values[i*numdoftotal+(j+2*numdofm)]+=Ke_gg2[i][j]; 5426 5437 5438 /*Transform Coordinate System*/ 5439 TransformStiffnessMatrixCoord(Ke,node_list,numnodes,cs_list); 5440 5427 5441 /*Clean-up and return*/ 5428 5442 delete tria->matice; delete tria; … … 5436 5450 5437 5451 /*Constants*/ 5438 const int numdof=NUMVERTICES*NDOF4; 5439 const int numdofm=NUMVERTICES*NDOF2; 5440 const int numdof2d=NUMVERTICES2D*NDOF4; 5441 const int numdof2dm=NUMVERTICES2D*NDOF2; 5442 const int numdoftot=numdof+numdofm; 5452 const int numnodes = 2 *NUMVERTICES; 5453 const int numdof = NUMVERTICES *NDOF4; 5454 const int numdofm = NUMVERTICES *NDOF2; 5455 const int numdof2d = NUMVERTICES2D *NDOF4; 5456 const int numdof2dm = NUMVERTICES2D *NDOF2; 5457 const int numdoftot = numdof+numdofm; 5443 5458 5444 5459 /*Intermediaries */ … … 5461 5476 Friction* friction=NULL; 5462 5477 GaussPenta *gauss=NULL; 5478 Node *node_list[numnodes]; 5479 int cs_list[numnodes]; 5463 5480 5464 5481 /*If on water or not Stokes, skip stiffness: */ … … 5469 5486 ElementMatrix* Ke=new ElementMatrix(Ke1,Ke2); 5470 5487 delete Ke1; delete Ke2; 5488 5489 /*Prepare node list*/ 5490 for(i=0;i<NUMVERTICES;i++){ 5491 node_list[i+0*NUMVERTICES] = this->nodes[i]; 5492 node_list[i+1*NUMVERTICES] = this->nodes[i]; 5493 cs_list[i+0*NUMVERTICES] = XYEnum; 5494 cs_list[i+1*NUMVERTICES] = XYZPEnum; 5495 } 5471 5496 5472 5497 /*Retrieve all inputs and parameters*/ … … 5527 5552 for(i=0;i<numdof2d;i++) for(j=0;j<numdof2dm;j++) Ke->values[(i+numdofm)*numdoftot+j]+=Ke_drag_gaussian2[i][j]; 5528 5553 } 5554 5555 /*Transform Coordinate System*/ 5556 TransformStiffnessMatrixCoord(Ke,node_list,numnodes,cs_list); 5529 5557 5530 5558 /*Clean up and return*/ … … 6324 6352 } 6325 6353 6354 /*Transform coordinate system*/ 6355 TransformLoadVectorCoord(pe,nodes,NUMVERTICES,XYZPEnum); 6356 6326 6357 /*Clean up and return*/ 6327 6358 delete gauss; … … 6394 6425 } 6395 6426 } 6427 6428 /*Transform coordinate system*/ 6429 TransformLoadVectorCoord(pe,nodes,NUMVERTICES,XYZPEnum); 6396 6430 6397 6431 /*Clean up and return*/ … … 7474 7508 } 7475 7509 7510 /*Transform solution in Cartesian Space*/ 7511 TransformSolutionCoord(&macayeal_values[0],this->nodes,NUMVERTICES,XYEnum); 7512 TransformSolutionCoord(&stokes_values[0],this->nodes,NUMVERTICES,XYZPEnum); 7513 7476 7514 /*Ok, we have vx and vy in values, fill in vx and vy arrays: */ 7477 7515 for(i=0;i<NUMVERTICES;i++){
Note:
See TracChangeset
for help on using the changeset viewer.