Changeset 16036
- Timestamp:
- 08/30/13 10:31:53 (12 years ago)
- Location:
- issm/trunk-jpl/src/c/classes/Elements
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/classes/Elements/Penta.cpp
r16034 r16036 3263 3263 for(int i=0;i<numnodes;i++){ 3264 3264 3265 if(!flags[this->nodes[i]-> Sid()]){3265 if(!flags[this->nodes[i]->Lid()]){ 3266 3266 3267 3267 /*flag current node so that no other element processes it*/ 3268 flags[this->nodes[i]-> Sid()]=true;3268 flags[this->nodes[i]->Lid()]=true; 3269 3269 3270 3270 /*if node is clone, we have an off-diagonal non-zero, else it is a diagonal non-zero*/ -
issm/trunk-jpl/src/c/classes/Elements/Tria.cpp
r16021 r16036 131 131 for(int i=0;i<numnodes;i++){ 132 132 133 if(!flags[this->nodes[i]-> Sid()]){133 if(!flags[this->nodes[i]->Lid()]){ 134 134 135 135 /*flag current node so that no other element processes it*/ 136 flags[this->nodes[i]-> Sid()]=true;136 flags[this->nodes[i]->Lid()]=true; 137 137 138 138 /*if node is clone, we have an off-diagonal non-zero, else it is a diagonal non-zero*/ … … 7230 7230 IssmDouble h,gamma,thickness; 7231 7231 IssmDouble hnx,hny,dhnx[2],dhny[2]; 7232 IssmDouble vel,vx,vy,dvxdx,dvydy;7233 IssmDouble D[2][2];7234 int stabilization=0;7235 7232 7236 7233 /*Fetch number of nodes and dof for this finite element*/ … … 7250 7247 /*Retrieve all Inputs and parameters: */ 7251 7248 GetVerticesCoordinates(&xyz_list[0][0],vertices,NUMVERTICES); 7252 Input* H_input=inputs->GetInput(ThicknessEnum); _assert_(H_input); 7253 7254 /*Get vector N for all nodes*/ 7249 Input* H_input =inputs->GetInput(ThicknessEnum); _assert_(H_input); 7250 h=sqrt(2.*this->GetArea()); 7251 7252 /*Get vector N for all nodes and build HNx and HNy*/ 7255 7253 GetInputListOnNodes(Nx,SurfaceSlopeXEnum); 7256 7254 GetInputListOnNodes(Ny,SurfaceSlopeYEnum); 7255 GetInputListOnNodes(H,ThicknessEnum); 7257 7256 for(int i=0;i<numnodes;i++){ 7258 7257 IssmDouble norm=sqrt(Nx[i]*Nx[i]+Ny[i]*Ny[i]+1.e-10); 7259 Nx[i] = -Nx[i]/norm; 7260 Ny[i] = -Ny[i]/norm; 7261 } 7262 7263 /*Build HNx and HNy*/ 7264 GetInputListOnNodes(H,ThicknessEnum); 7265 for(int i=0;i<numnodes;i++){ 7266 HNx[i]=H[i]*Nx[i]; 7267 HNy[i]=H[i]*Ny[i]; 7268 } 7269 7270 h=sqrt(2.*this->GetArea()); 7258 HNx[i] = -H[i]*Nx[i]/norm; 7259 HNy[i] = -H[i]*Ny[i]/norm; 7260 } 7271 7261 7272 7262 /*Start looping on the number of gaussian points:*/ … … 7296 7286 ); 7297 7287 } 7298 }7299 7300 vx=hnx;7301 vy=hny;7302 if(stabilization==2){7303 /*Streamline upwinding*/7304 vel=sqrt(vx*vx+vy*vy)+1.e-8;7305 D[0][0]=h/(2*vel)*vx*vx;7306 D[1][0]=h/(2*vel)*vy*vx;7307 D[0][1]=h/(2*vel)*vx*vy;7308 D[1][1]=h/(2*vel)*vy*vy;7309 }7310 else if(stabilization==1){7311 /*MacAyeal*/7312 D[0][0]=h/2.0*fabs(vx);7313 D[0][1]=0.;7314 D[1][0]=0.;7315 D[1][1]=h/2.0*fabs(vy);7316 }7317 if(stabilization==1 || stabilization==2){7318 GetBprimeMasstransport(B,&xyz_list[0][0],gauss);7319 D[0][0]=gauss->weight*Jdet*D[0][0];7320 D[1][0]=gauss->weight*Jdet*D[1][0];7321 D[0][1]=gauss->weight*Jdet*D[0][1];7322 D[1][1]=gauss->weight*Jdet*D[1][1];7323 TripleMultiply(B,2,numnodes,1,7324 &D[0][0],2,2,0,7325 B,2,numnodes,0,7326 &Ke->values[0],1);7327 7288 } 7328 7289 } … … 7348 7309 IssmDouble xyz_list[NUMVERTICES][3]; 7349 7310 IssmDouble D[2][2]; 7350 IssmDouble l= 12.;7311 IssmDouble l=8.; 7351 7312 7352 7313 /*Fetch number of nodes and dof for this finite element*/ … … 7518 7479 Input* dhdt_input=inputs->GetInput(BalancethicknessThickeningRateEnum); _assert_(dhdt_input); 7519 7480 Input* H_input=inputs->GetInput(ThicknessEnum); _assert_(H_input); 7481 h=sqrt(2.*this->GetArea()); 7520 7482 7521 7483 /*Get vector N for all nodes*/ 7522 7484 GetInputListOnNodes(Nx,SurfaceSlopeXEnum); 7523 7485 GetInputListOnNodes(Ny,SurfaceSlopeYEnum); 7486 GetInputListOnNodes(H,ThicknessEnum); 7524 7487 for(int i=0;i<numnodes;i++){ 7525 7488 IssmDouble norm=sqrt(Nx[i]*Nx[i]+Ny[i]*Ny[i]+1.e-10); 7526 Nx[i] = -Nx[i]/norm; 7527 Ny[i] = -Ny[i]/norm; 7528 } 7529 7530 /*Build HNx and HNy*/ 7531 GetInputListOnNodes(H,ThicknessEnum); 7532 for(int i=0;i<numnodes;i++){ 7533 HNx[i]=H[i]*Nx[i]; 7534 HNy[i]=H[i]*Ny[i]; 7535 } 7536 7537 h=sqrt(2.*this->GetArea()); 7489 Nx[i] = -H[i]*Nx[i]/norm; 7490 Ny[i] = -H[i]*Ny[i]/norm; 7491 } 7538 7492 7539 7493 /* Start looping on the number of gaussian points: */ … … 7586 7540 IssmDouble Jdet; 7587 7541 IssmDouble thickness,slope[2]; 7588 IssmDouble taud_x ;7542 IssmDouble taud_x,norms,normv,vx,vy; 7589 7543 7590 7544 /*Fetch number of nodes and dof for this finite element*/ … … 7594 7548 ElementVector* pe = new ElementVector(nodes,numnodes,this->parameters); 7595 7549 IssmDouble* basis = xNew<IssmDouble>(numnodes); 7550 IssmDouble* Vx = xNew<IssmDouble>(numnodes); 7551 IssmDouble* Vy = xNew<IssmDouble>(numnodes); 7596 7552 7597 7553 /*Retrieve all inputs and parameters*/ … … 7599 7555 Input* H_input = inputs->GetInput(ThicknessEnum); _assert_(H_input); 7600 7556 Input* surface_input = inputs->GetInput(SurfaceEnum); _assert_(surface_input); 7557 Input* vx_input = inputs->GetInput(VxEnum); 7558 Input* vy_input = inputs->GetInput(VyEnum); 7601 7559 7602 7560 /* Start looping on the number of gaussian points: */ … … 7608 7566 H_input->GetInputValue(&thickness,gauss); 7609 7567 surface_input->GetInputDerivativeValue(&slope[0],&xyz_list[0][0],gauss); 7568 if(vx_input && vy_input){ 7569 vx_input->GetInputValue(&vx,gauss); 7570 vy_input->GetInputValue(&vy,gauss); 7571 norms = sqrt(slope[0]*slope[0]+slope[1]*slope[1]); 7572 normv = sqrt(vx*vx + vy*vy); 7573 if(normv>15./(365.*24.*3600.)) slope[0] = -vx/normv*norms; 7574 } 7610 7575 taud_x = matpar->GetRhoIce()*matpar->GetG()*thickness*slope[0]; 7611 //taud_x = slope[0];7612 7576 7613 7577 GetJacobianDeterminant(&Jdet, &xyz_list[0][0],gauss); … … 7630 7594 IssmDouble Jdet; 7631 7595 IssmDouble thickness,slope[2]; 7632 IssmDouble taud_y ;7596 IssmDouble taud_y,norms,normv,vx,vy; 7633 7597 7634 7598 /*Fetch number of nodes and dof for this finite element*/ … … 7637 7601 /*Initialize Element vector and other vectors*/ 7638 7602 ElementVector* pe = new ElementVector(nodes,numnodes,this->parameters); 7639 IssmDouble* basis 7603 IssmDouble* basis = xNew<IssmDouble>(numnodes); 7640 7604 7641 7605 /*Retrieve all inputs and parameters*/ … … 7643 7607 Input* H_input = inputs->GetInput(ThicknessEnum); _assert_(H_input); 7644 7608 Input* surface_input = inputs->GetInput(SurfaceEnum); _assert_(surface_input); 7609 Input* vx_input = inputs->GetInput(VxEnum); 7610 Input* vy_input = inputs->GetInput(VyEnum); 7645 7611 7646 7612 /* Start looping on the number of gaussian points: */ … … 7652 7618 H_input->GetInputValue(&thickness,gauss); 7653 7619 surface_input->GetInputDerivativeValue(&slope[0],&xyz_list[0][0],gauss); 7620 if(vx_input && vy_input){ 7621 vx_input->GetInputValue(&vx,gauss); 7622 vy_input->GetInputValue(&vy,gauss); 7623 norms = sqrt(slope[0]*slope[0]+slope[1]*slope[1]); 7624 normv = sqrt(vx*vx + vy*vy); 7625 if(normv>15./(365.*24.*3600.)) slope[1] = -vy/normv*norms; 7626 } 7654 7627 taud_y = matpar->GetRhoIce()*matpar->GetG()*thickness*slope[1]; 7655 //taud_y = slope[1];7656 7628 7657 7629 GetJacobianDeterminant(&Jdet, &xyz_list[0][0],gauss);
Note:
See TracChangeset
for help on using the changeset viewer.