Changeset 17359
- Timestamp:
- 02/26/14 20:46:50 (11 years ago)
- Location:
- issm/trunk-jpl/src/c
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp
r17341 r17359 7 7 #include "../cores/cores.h" 8 8 9 //#define FSANALYTICAL 39 //#define FSANALYTICAL 101 10 10 11 11 /*Model processing*/ … … 2273 2273 return Ke; 2274 2274 }/*}}}*/ 2275 #ifdef FSANALYTICAL 2276 ElementVector* StressbalanceAnalysis::CreatePVectorHO(Element* element){/*{{{*/ 2277 2278 /*Intermediaries */ 2279 int dim,meshtype; 2280 IssmDouble x_coord,y_coord,z_coord; 2281 IssmDouble Jdet,forcex,forcey,forcez; 2282 IssmDouble* xyz_list = NULL; 2283 2284 /*Get problem dimension*/ 2285 element->FindParam(&meshtype,MeshTypeEnum); 2286 switch(meshtype){ 2287 case Mesh2DverticalEnum: dim = 2; break; 2288 case Mesh3DEnum: dim = 3; break; 2289 default: _error_("mesh "<<EnumToStringx(meshtype)<<" not supported yet"); 2290 } 2291 2292 /*Fetch number of nodes and dof for this finite element*/ 2293 int numnodes = element->GetNumberOfNodes(); 2294 2295 /*Initialize Element vector and vectors*/ 2296 ElementVector* pe=element->NewElementVector(HOApproximationEnum); 2297 IssmDouble* basis = xNew<IssmDouble>(numnodes); 2298 2299 /*Retrieve all inputs and parameters*/ 2300 element->GetVerticesCoordinates(&xyz_list); 2301 2302 /* Start looping on the number of gaussian points: */ 2303 Gauss* gauss=element->NewGauss(3); 2304 for(int ig=gauss->begin();ig<gauss->end();ig++){ 2305 gauss->GaussPoint(ig); 2306 2307 element->JacobianDeterminant(&Jdet,xyz_list,gauss); 2308 element->NodalFunctions(basis, gauss); 2309 2310 x_coord=element->GetXcoord(gauss); 2311 y_coord=element->GetYcoord(gauss); 2312 if(dim==3) z_coord=element->GetZcoord(gauss); 2313 else z_coord=0.; 2314 2315 forcex=fx(x_coord,y_coord,z_coord,FSANALYTICAL); 2316 forcey=fy(x_coord,y_coord,z_coord,FSANALYTICAL); 2317 2318 for(int i=0;i<numnodes;i++){ 2319 pe->values[i*(dim-1)+0]+=forcex*Jdet*gauss->weight*basis[i]; 2320 pe->values[i*(dim-1)+1]+=forcey*Jdet*gauss->weight*basis[i]; 2321 } 2322 } 2323 2324 /*Transform coordinate system*/ 2325 if(dim==3) element->TransformLoadVectorCoord(pe,XYEnum); 2326 2327 /*Clean up and return*/ 2328 xDelete<IssmDouble>(basis); 2329 xDelete<IssmDouble>(xyz_list); 2330 delete gauss; 2331 return pe; 2332 }/*}}}*/ 2333 #else 2275 2334 ElementVector* StressbalanceAnalysis::CreatePVectorHO(Element* element){/*{{{*/ 2276 2335 … … 2285 2344 return pe; 2286 2345 }/*}}}*/ 2346 #endif 2287 2347 ElementVector* StressbalanceAnalysis::CreatePVectorHODrivingStress(Element* element){/*{{{*/ 2288 2348 -
issm/trunk-jpl/src/c/shared/FSanalyticals/fsanalyticals.cpp
r17306 r17359 36 36 case 8: 37 37 return fx=1.0; 38 39 case 101: 40 return fx=fx101(x,y,z); 38 41 default: 39 42 _error_("FS analytical solution"<<testid<<" not implemented yet"); … … 61 64 case 8: 62 65 return fy=1.0; 66 67 case 101: 68 return fy=fy101(x,y,z); 63 69 default: 64 70 _error_("FS analytical solution"<<testid<<" not implemented yet"); … … 253 259 } 254 260 /*}}}*/ 261 262 IssmDouble fx101(IssmDouble x,IssmDouble y,IssmDouble z){ /*{{{*/ 263 264 return 4*pow(x, 2)*y*z*pow(x - 1, 2)*(z - 1) + 8*pow(x, 2)*y*z*(y - 1)*(2*y - 1)*(z - 1) + 2*pow(x, 2)*y*pow(x - 1, 2)*(y - 1)*(2*y - 1) + 4*pow(x, 2)*z*pow(x - 1, 2)*(y - 1)*(z - 1) + 2*pow(x, 2)*z*pow(x - 1, 2)*(2*y - 1)*(z - 1) - 12*x*pow(y, 2)*z*(x - 1)*(y - 1)*(z - 1) - 6*x*pow(y, 2)*z*(2*x - 1)*(y - 1)*(z - 1) - 12*x*y*z*(x - 1)*pow(y - 1, 2)*(z - 1) + 32*x*y*z*(x - 1)*(y - 1)*(2*y - 1)*(z - 1) - 6*x*y*z*(2*x - 1)*pow(y - 1, 2)*(z - 1) - 6*pow(y, 2)*z*(x - 1)*(2*x - 1)*(y - 1)*(z - 1) + 8*y*z*pow(x - 1, 2)*(y - 1)*(2*y - 1)*(z - 1) - 6*y*z*(x - 1)*(2*x - 1)*pow(y - 1, 2)*(z - 1); 265 } 266 /*}}}*/ 267 IssmDouble fy101(IssmDouble x,IssmDouble y,IssmDouble z){ /*{{{*/ 268 269 return 12*pow(x, 2)*y*z*(x - 1)*(y - 1)*(z - 1) + 6*pow(x, 2)*y*z*(x - 1)*(2*y - 1)*(z - 1) + 6*pow(x, 2)*z*(x - 1)*(y - 1)*(2*y - 1)*(z - 1) - 8*x*pow(y, 2)*z*(x - 1)*(2*x - 1)*(z - 1) - 4*x*pow(y, 2)*z*pow(y - 1, 2)*(z - 1) - 2*x*pow(y, 2)*(x - 1)*(2*x - 1)*pow(y - 1, 2) + 12*x*y*z*pow(x - 1, 2)*(y - 1)*(z - 1) + 6*x*y*z*pow(x - 1, 2)*(2*y - 1)*(z - 1) - 32*x*y*z*(x - 1)*(2*x - 1)*(y - 1)*(z - 1) + 6*x*z*pow(x - 1, 2)*(y - 1)*(2*y - 1)*(z - 1) - 8*x*z*(x - 1)*(2*x - 1)*pow(y - 1, 2)*(z - 1) - 4*pow(y, 2)*z*(x - 1)*pow(y - 1, 2)*(z - 1) - 2*pow(y, 2)*z*(2*x - 1)*pow(y - 1, 2)*(z - 1); 270 } 271 /*}}}*/ -
issm/trunk-jpl/src/c/shared/FSanalyticals/fsanalyticals.h
r17306 r17359 30 30 IssmDouble fy7(IssmDouble x_coord, IssmDouble y_coord); 31 31 32 IssmDouble fx101(IssmDouble x_coord, IssmDouble y_coord, IssmDouble z_coord); 33 IssmDouble fy101(IssmDouble x_coord, IssmDouble y_coord, IssmDouble z_coord); 32 34 #endif //ifndef _SHARED_ANALYTICALS_H_
Note:
See TracChangeset
for help on using the changeset viewer.