source:
issm/oecreview/Archive/24684-25833/ISSM-24917-24918.diff
Last change on this file was 25834, checked in by , 4 years ago | |
---|---|
File size: 2.0 KB |
-
../trunk-jpl/src/c/analyses/EnthalpyAnalysis.cpp
590 590 ElementMatrix* Ke = element->NewElementMatrix(); 591 591 IssmDouble* basis = xNew<IssmDouble>(numnodes); 592 592 IssmDouble* dbasis = xNew<IssmDouble>(3*numnodes); 593 IssmDouble* Bprime = xNew<IssmDouble>(3*numnodes);594 593 IssmDouble K[3][3]; 595 594 596 595 /*Retrieve all inputs and parameters*/ … … 666 665 K[2][0]=h/(2.*vel)*fabs(vz*vx); K[2][1]=h/(2.*vel)*fabs(vz*vy); K[2][2]=h/(2.*vel)*fabs(vz*vz); 667 666 for(int i=0;i<3;i++) for(int j=0;j<3;j++) K[i][j] = D_scalar*K[i][j]; 668 667 669 GetBAdvecprime(Bprime,element,xyz_list,gauss); 670 TripleMultiply(Bprime,3,numnodes,1, 671 &K[0][0],3,3,0, 672 Bprime,3,numnodes,0, 673 &Ke->values[0],1); 668 for(int i=0;i<numnodes;i++){ 669 for(int j=0;j<numnodes;j++){ 670 Ke->values[i*numnodes+j] += ( 671 dbasis[0*numnodes+i] *(K[0][0]*dbasis[0*numnodes+j] + K[0][1]*dbasis[1*numnodes+j]+ K[0][2]*dbasis[2*numnodes+j]) + 672 dbasis[1*numnodes+i] *(K[1][0]*dbasis[0*numnodes+j] + K[1][1]*dbasis[1*numnodes+j]+ K[1][2]*dbasis[2*numnodes+j]) + 673 dbasis[2*numnodes+i] *(K[2][0]*dbasis[0*numnodes+j] + K[2][1]*dbasis[1*numnodes+j]+ K[2][2]*dbasis[2*numnodes+j]) 674 ); 675 } 676 } 674 677 } 675 678 /*SUPG*/ 676 679 else if(stabilization==2){ … … 714 717 xDelete<IssmDouble>(xyz_list); 715 718 xDelete<IssmDouble>(basis); 716 719 xDelete<IssmDouble>(dbasis); 717 xDelete<IssmDouble>(Bprime);718 720 delete gauss; 719 721 return Ke; 720 722 }/*}}}*/ … … 757 759 758 760 D=gauss->weight*Jdet*rho_water*mixed_layer_capacity*thermal_exchange_vel/(heatcapacity*rho_ice); 759 761 if(reCast<bool,IssmDouble>(dt)) D=dt*D; 760 TripleMultiply(basis,numnodes,1,0, 761 &D,1,1,0, 762 basis,1,numnodes,0, 763 &Ke->values[0],1); 764 762 for(int i=0;i<numnodes;i++) for(int j=0;j<numnodes;j++) Ke->values[i*numnodes+j] += D*basis[i]*basis[j]; 765 763 } 766 764 767 765 /*Clean up and return*/
Note:
See TracBrowser
for help on using the repository browser.