source:
issm/oecreview/Archive/17984-18295/ISSM-18174-18175.diff@
18296
Last change on this file since 18296 was 18296, checked in by , 11 years ago | |
---|---|
File size: 1.8 KB |
-
../trunk-jpl/src/c/classes/Elements/Element.cpp
186 186 /*Compute element divergence*/ 187 187 188 188 /*Intermediaries*/ 189 int dim; 189 190 IssmDouble Jdet; 190 191 IssmDouble divergence=0.; 191 192 IssmDouble dvx[3],dvy[3],dvz[3]; 192 193 IssmDouble *xyz_list = NULL; 193 194 194 195 /*Get inputs and parameters*/ 195 Input* vx_input = this->GetInput(VxEnum); _assert_(vx_input); 196 Input* vy_input = this->GetInput(VyEnum); _assert_(vy_input); 197 Input* vz_input = this->GetInput(VzEnum); _assert_(vz_input); 196 this->FindParam(&dim,DomainDimensionEnum); 197 Input* vx_input = this->GetInput(VxEnum); _assert_(vx_input); 198 Input* vy_input = this->GetInput(VyEnum); _assert_(vy_input); 199 Input* vz_input = NULL; 200 if(dim==3){ 201 vz_input = this->GetInput(VzEnum); _assert_(vz_input); 202 } 198 203 this->GetVerticesCoordinates(&xyz_list); 199 204 200 Gauss* gauss=this->NewGauss Base(5);205 Gauss* gauss=this->NewGauss(5); 201 206 for(int ig=gauss->begin();ig<gauss->end();ig++){ 202 207 gauss->GaussPoint(ig); 203 208 this->JacobianDeterminant(&Jdet,xyz_list,gauss); … … 205 210 /*Get strain rate assuming that epsilon has been allocated*/ 206 211 vx_input->GetInputDerivativeValue(&dvx[0],xyz_list,gauss); 207 212 vy_input->GetInputDerivativeValue(&dvy[0],xyz_list,gauss); 208 vz_input->GetInputDerivativeValue(&dvz[0],xyz_list,gauss); 213 if(dim==2){ 214 divergence += (dvx[0]+dvy[1])*gauss->weight*Jdet; 215 } 216 else{ 217 vz_input->GetInputDerivativeValue(&dvz[0],xyz_list,gauss); 218 divergence += (dvx[0]+dvy[1]+dvz[2])*gauss->weight*Jdet; 219 } 209 220 210 divergence += (dvx[0]+dvy[1]+dvz[2])*gauss->weight*Jdet;211 221 } 212 222 213 223 /*Clean up and return*/
Note:
See TracBrowser
for help on using the repository browser.