Changeset 16010
- Timestamp:
- 08/29/13 09:41:24 (12 years ago)
- Location:
- issm/trunk-jpl/src/c
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/analyses/balancevelocity_core.cpp
r16007 r16010 20 20 21 21 if(VerboseSolution()) _printf0_("call computational core:\n"); 22 surfaceslope_core(femmodel); 22 femmodel->SetCurrentConfiguration(SurfaceSlopeAnalysisEnum,SmoothedSurfaceSlopeXAnalysisEnum); 23 solutionsequence_linear(femmodel); 24 femmodel->SetCurrentConfiguration(SurfaceSlopeAnalysisEnum,SmoothedSurfaceSlopeYAnalysisEnum); 25 solutionsequence_linear(femmodel); 23 26 24 27 if(VerboseSolution()) _printf0_("call computational core:\n"); … … 28 31 if(save_results){ 29 32 if(VerboseSolution()) _printf0_(" saving results\n"); 33 InputToResultx(femmodel,SurfaceSlopeXEnum); 34 InputToResultx(femmodel,SurfaceSlopeYEnum); 30 35 InputToResultx(femmodel,VelEnum); 31 36 } -
issm/trunk-jpl/src/c/classes/Elements/Tria.cpp
r16007 r16010 247 247 return CreateKMatrixBalancevelocity(); 248 248 break; 249 case SmoothedSurfaceSlopeXAnalysisEnum: case SmoothedSurfaceSlopeYAnalysisEnum: 250 return CreateKMatrixSmoothedSlope(); 251 break; 249 252 #endif 250 253 #ifdef _HAVE_CONTROL_ … … 391 394 case BalancevelocityAnalysisEnum: 392 395 return CreatePVectorBalancevelocity(); 396 break; 397 case SmoothedSurfaceSlopeXAnalysisEnum: 398 return CreatePVectorSmoothedSlopeX(); 399 break; 400 case SmoothedSurfaceSlopeYAnalysisEnum: 401 return CreatePVectorSmoothedSlopeY(); 393 402 break; 394 403 #endif … … 1608 1617 case BalancevelocityAnalysisEnum: 1609 1618 InputUpdateFromSolutionOneDof(solution,VelEnum); 1619 break; 1620 case SmoothedSurfaceSlopeXAnalysisEnum: 1621 InputUpdateFromSolutionOneDof(solution,SurfaceSlopeXEnum); 1622 break; 1623 case SmoothedSurfaceSlopeYAnalysisEnum: 1624 InputUpdateFromSolutionOneDof(solution,SurfaceSlopeYEnum); 1610 1625 break; 1611 1626 #endif … … 7296 7311 } 7297 7312 /*}}}*/ 7313 /*FUNCTION Tria::CreateKMatrixSmoothedSlope {{{*/ 7314 ElementMatrix* Tria::CreateKMatrixSmoothedSlope(void){ 7315 7316 /* Intermediaries */ 7317 IssmDouble D_scalar,Jdet,thickness; 7318 IssmDouble xyz_list[NUMVERTICES][3]; 7319 IssmDouble D[2][2]; 7320 IssmDouble l=12.; 7321 7322 /*Fetch number of nodes and dof for this finite element*/ 7323 int numnodes = this->NumberofNodes(); 7324 7325 /*Initialize Element matrix and vectors*/ 7326 ElementMatrix* Ke = CreateMassMatrix(); 7327 IssmDouble* B = xNew<IssmDouble>(2*numnodes); 7328 7329 /*Retrieve all inputs and parameters*/ 7330 GetVerticesCoordinates(&xyz_list[0][0],vertices,NUMVERTICES); 7331 Input* thickness_input=inputs->GetInput(ThicknessEnum); _assert_(thickness_input); 7332 7333 /* Start looping on the number of gaussian points: */ 7334 GaussTria* gauss=new GaussTria(2); 7335 for(int ig=gauss->begin();ig<gauss->end();ig++){ 7336 7337 gauss->GaussPoint(ig); 7338 7339 GetBMasstransport(B,&xyz_list[0][0], gauss); 7340 GetJacobianDeterminant(&Jdet, &xyz_list[0][0],gauss); 7341 thickness_input->GetInputValue(&thickness,gauss); 7342 7343 D_scalar=gauss->weight*Jdet*(l*thickness)*(l*thickness); 7344 D[0][0]=D_scalar; 7345 D[1][0]=0.; 7346 D[0][1]=0.; 7347 D[1][1]=D_scalar; 7348 7349 TripleMultiply(B,2,numnodes,1, 7350 &D[0][0],2,2,0, 7351 B,2,numnodes,0, 7352 &Ke->values[0],1); 7353 } 7354 7355 /*Clean up and return*/ 7356 delete gauss; 7357 xDelete<IssmDouble>(B); 7358 return Ke; 7359 } 7360 /*}}}*/ 7298 7361 /*FUNCTION Tria::CreatePVectorBalancethickness{{{*/ 7299 7362 ElementVector* Tria::CreatePVectorBalancethickness(void){ … … 7477 7540 xDelete<IssmDouble>(HNx); 7478 7541 xDelete<IssmDouble>(HNy); 7542 delete gauss; 7543 return pe; 7544 } 7545 /*}}}*/ 7546 /*FUNCTION Tria::CreatePVectorSmoothedSlopeX{{{*/ 7547 ElementVector* Tria::CreatePVectorSmoothedSlopeX(void){ 7548 7549 /*Intermediaries */ 7550 IssmDouble xyz_list[NUMVERTICES][3]; 7551 IssmDouble Jdettria; 7552 IssmDouble thickness,slope[2]; 7553 IssmDouble taud_x; 7554 7555 /*Fetch number of nodes and dof for this finite element*/ 7556 int numnodes = this->NumberofNodes(); 7557 7558 /*Initialize Element vector and other vectors*/ 7559 ElementVector* pe = new ElementVector(nodes,numnodes,this->parameters); 7560 IssmDouble* basis = xNew<IssmDouble>(numnodes); 7561 7562 /*Retrieve all inputs and parameters*/ 7563 GetVerticesCoordinates(&xyz_list[0][0],vertices,NUMVERTICES); 7564 Input* H_input = inputs->GetInput(ThicknessEnum); _assert_(H_input); 7565 Input* surface_input = inputs->GetInput(SurfaceEnum); _assert_(surface_input); 7566 7567 /* Start looping on the number of gaussian points: */ 7568 GaussTria* gauss=new GaussTria(2); 7569 for(int ig=gauss->begin();ig<gauss->end();ig++){ 7570 7571 gauss->GaussPoint(ig); 7572 7573 H_input->GetInputValue(&thickness,gauss); 7574 surface_input->GetInputDerivativeValue(&slope[0],&xyz_list[0][0],gauss); 7575 taud_x = matpar->GetRhoIce()*matpar->GetG()*thickness*slope[0]; 7576 7577 GetJacobianDeterminant(&Jdettria, &xyz_list[0][0],gauss); 7578 GetNodalFunctions(basis,gauss); 7579 7580 for(int i=0;i<numnodes;i++) pe->values[i]+=Jdettria*gauss->weight*taud_x*basis[i]; 7581 } 7582 7583 /*Clean up and return*/ 7584 xDelete<IssmDouble>(basis); 7585 delete gauss; 7586 return pe; 7587 } 7588 /*}}}*/ 7589 /*FUNCTION Tria::CreatePVectorSmoothedSlopeY{{{*/ 7590 ElementVector* Tria::CreatePVectorSmoothedSlopeY(void){ 7591 7592 /*Intermediaries */ 7593 IssmDouble xyz_list[NUMVERTICES][3]; 7594 IssmDouble Jdettria; 7595 IssmDouble thickness,slope[2]; 7596 IssmDouble taud_y; 7597 7598 /*Fetch number of nodes and dof for this finite element*/ 7599 int numnodes = this->NumberofNodes(); 7600 7601 /*Initialize Element vector and other vectors*/ 7602 ElementVector* pe = new ElementVector(nodes,numnodes,this->parameters); 7603 IssmDouble* basis = xNew<IssmDouble>(numnodes); 7604 7605 /*Retrieve all inputs and parameters*/ 7606 GetVerticesCoordinates(&xyz_list[0][0],vertices,NUMVERTICES); 7607 Input* H_input = inputs->GetInput(ThicknessEnum); _assert_(H_input); 7608 Input* surface_input = inputs->GetInput(SurfaceEnum); _assert_(surface_input); 7609 7610 /* Start looping on the number of gaussian points: */ 7611 GaussTria* gauss=new GaussTria(2); 7612 for(int ig=gauss->begin();ig<gauss->end();ig++){ 7613 7614 gauss->GaussPoint(ig); 7615 7616 H_input->GetInputValue(&thickness,gauss); 7617 surface_input->GetInputDerivativeValue(&slope[0],&xyz_list[0][0],gauss); 7618 taud_y = matpar->GetRhoIce()*matpar->GetG()*thickness*slope[1]; 7619 7620 GetJacobianDeterminant(&Jdettria, &xyz_list[0][0],gauss); 7621 GetNodalFunctions(basis,gauss); 7622 7623 for(int i=0;i<numnodes;i++) pe->values[i]+=Jdettria*gauss->weight*taud_y*basis[i]; 7624 } 7625 7626 /*Clean up and return*/ 7627 xDelete<IssmDouble>(basis); 7479 7628 delete gauss; 7480 7629 return pe; -
issm/trunk-jpl/src/c/classes/Elements/Tria.h
r16007 r16010 184 184 ElementMatrix* CreateKMatrixBalancethickness_CG(void); 185 185 ElementMatrix* CreateKMatrixBalancevelocity(void); 186 ElementMatrix* CreateKMatrixSmoothedSlope(void); 186 187 ElementMatrix* CreateKMatrixMelting(void); 187 188 ElementMatrix* CreateKMatrixMasstransport(void); … … 196 197 ElementVector* CreatePVectorBalancethickness_CG(void); 197 198 ElementVector* CreatePVectorBalancevelocity(void); 199 ElementVector* CreatePVectorSmoothedSlopeX(void); 200 ElementVector* CreatePVectorSmoothedSlopeY(void); 198 201 ElementVector* CreatePVectorMasstransport(void); 199 202 ElementVector* CreatePVectorMasstransport_CG(void); -
issm/trunk-jpl/src/c/shared/Enum/EnumDefinitions.h
r16007 r16010 301 301 SurfaceSlopeXAnalysisEnum, 302 302 SurfaceSlopeYAnalysisEnum, 303 SmoothedSurfaceSlopeXAnalysisEnum, 304 SmoothedSurfaceSlopeYAnalysisEnum, 303 305 ThermalAnalysisEnum, 304 306 ThermalSolutionEnum, -
issm/trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp
r16007 r16010 307 307 case SurfaceSlopeXAnalysisEnum : return "SurfaceSlopeXAnalysis"; 308 308 case SurfaceSlopeYAnalysisEnum : return "SurfaceSlopeYAnalysis"; 309 case SmoothedSurfaceSlopeXAnalysisEnum : return "SmoothedSurfaceSlopeXAnalysis"; 310 case SmoothedSurfaceSlopeYAnalysisEnum : return "SmoothedSurfaceSlopeYAnalysis"; 309 311 case ThermalAnalysisEnum : return "ThermalAnalysis"; 310 312 case ThermalSolutionEnum : return "ThermalSolution"; -
issm/trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp
r16007 r16010 313 313 else if (strcmp(name,"SurfaceSlopeXAnalysis")==0) return SurfaceSlopeXAnalysisEnum; 314 314 else if (strcmp(name,"SurfaceSlopeYAnalysis")==0) return SurfaceSlopeYAnalysisEnum; 315 else if (strcmp(name,"SmoothedSurfaceSlopeXAnalysis")==0) return SmoothedSurfaceSlopeXAnalysisEnum; 316 else if (strcmp(name,"SmoothedSurfaceSlopeYAnalysis")==0) return SmoothedSurfaceSlopeYAnalysisEnum; 315 317 else if (strcmp(name,"ThermalAnalysis")==0) return ThermalAnalysisEnum; 316 318 else if (strcmp(name,"ThermalSolution")==0) return ThermalSolutionEnum; … … 381 383 else if (strcmp(name,"Profiler")==0) return ProfilerEnum; 382 384 else if (strcmp(name,"MatrixParam")==0) return MatrixParamEnum; 383 else if (strcmp(name,"NodeSId")==0) return NodeSIdEnum;384 else if (strcmp(name,"VectorParam")==0) return VectorParamEnum;385 385 else stage=4; 386 386 } 387 387 if(stage==4){ 388 if (strcmp(name,"Riftfront")==0) return RiftfrontEnum; 388 if (strcmp(name,"NodeSId")==0) return NodeSIdEnum; 389 else if (strcmp(name,"VectorParam")==0) return VectorParamEnum; 390 else if (strcmp(name,"Riftfront")==0) return RiftfrontEnum; 389 391 else if (strcmp(name,"RiftfrontType")==0) return RiftfrontTypeEnum; 390 392 else if (strcmp(name,"Segment")==0) return SegmentEnum; … … 504 506 else if (strcmp(name,"P1bubble")==0) return P1bubbleEnum; 505 507 else if (strcmp(name,"P1bubblecondensed")==0) return P1bubblecondensedEnum; 506 else if (strcmp(name,"P2")==0) return P2Enum;507 else if (strcmp(name,"P2xP1")==0) return P2xP1Enum;508 508 else stage=5; 509 509 } 510 510 if(stage==5){ 511 if (strcmp(name,"P1xP2")==0) return P1xP2Enum; 511 if (strcmp(name,"P2")==0) return P2Enum; 512 else if (strcmp(name,"P2xP1")==0) return P2xP1Enum; 513 else if (strcmp(name,"P1xP2")==0) return P1xP2Enum; 512 514 else if (strcmp(name,"P1P1")==0) return P1P1Enum; 513 515 else if (strcmp(name,"P1P1GLS")==0) return P1P1GLSEnum;
Note:
See TracChangeset
for help on using the changeset viewer.