Changeset 16007
- Timestamp:
- 08/29/13 08:53:59 (12 years ago)
- Location:
- issm/trunk-jpl/src/c
- Files:
-
- 6 added
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified issm/trunk-jpl/src/c/Makefile.am ¶
r15915 r16007 501 501 ./modules/ModelProcessorx/Balancethickness/CreateConstraintsBalancethickness.cpp\ 502 502 ./modules/ModelProcessorx/Balancethickness/CreateLoadsBalancethickness.cpp\ 503 ./modules/ModelProcessorx/Balancevelocity/UpdateElementsBalancevelocity.cpp\ 504 ./modules/ModelProcessorx/Balancevelocity/CreateNodesBalancevelocity.cpp\ 505 ./modules/ModelProcessorx/Balancevelocity/CreateConstraintsBalancevelocity.cpp\ 506 ./modules/ModelProcessorx/Balancevelocity/CreateLoadsBalancevelocity.cpp\ 503 507 ./analyses/balancethickness_core.cpp \ 508 ./analyses/balancevelocity_core.cpp \ 504 509 ./analyses/dummy_core.cpp 505 510 #}}} -
TabularUnified issm/trunk-jpl/src/c/analyses/AnalysisConfiguration.cpp ¶
r15877 r16007 89 89 break; 90 90 91 case BalancevelocitySolutionEnum: 92 numanalyses=2; 93 analyses=xNew<int>(numanalyses); 94 analyses[0]=BalancevelocityAnalysisEnum; 95 analyses[1]=SurfaceSlopeAnalysisEnum; 96 break; 97 91 98 case SurfaceSlopeSolutionEnum: 92 99 numanalyses=1; -
TabularUnified issm/trunk-jpl/src/c/analyses/CorePointerFromSolutionEnum.cpp ¶
r15771 r16007 65 65 #endif 66 66 break; 67 case BalancevelocitySolutionEnum: 68 #ifdef _HAVE_BALANCED_ 69 solutioncore=&balancevelocity_core; 70 #else 71 _error_("ISSM was not compiled with balanced capabilities. Exiting"); 72 #endif 73 break; 67 74 case HydrologySolutionEnum: 68 75 #ifdef _HAVE_HYDROLOGY_ -
TabularUnified issm/trunk-jpl/src/c/analyses/analyses.h ¶
r15839 r16007 30 30 void masstransport_core(FemModel* femmodel); 31 31 void balancethickness_core(FemModel* femmodel); 32 void balancevelocity_core(FemModel* femmodel); 32 33 void slopecompute_core(FemModel* femmodel); 33 34 void steadystate_core(FemModel* femmodel); -
TabularUnified issm/trunk-jpl/src/c/classes/Elements/Tria.cpp ¶
r15986 r16007 244 244 return CreateKMatrixBalancethickness(); 245 245 break; 246 case BalancevelocityAnalysisEnum: 247 return CreateKMatrixBalancevelocity(); 248 break; 246 249 #endif 247 250 #ifdef _HAVE_CONTROL_ … … 385 388 case BalancethicknessAnalysisEnum: 386 389 return CreatePVectorBalancethickness(); 390 break; 391 case BalancevelocityAnalysisEnum: 392 return CreatePVectorBalancevelocity(); 387 393 break; 388 394 #endif … … 1599 1605 case BalancethicknessAnalysisEnum: 1600 1606 InputUpdateFromSolutionOneDof(solution,ThicknessEnum); 1607 break; 1608 case BalancevelocityAnalysisEnum: 1609 InputUpdateFromSolutionOneDof(solution,VelEnum); 1601 1610 break; 1602 1611 #endif … … 7067 7076 vyaverage_input=inputs->GetInput(VyAverageEnum); _assert_(vyaverage_input); 7068 7077 } 7069 h=sqrt(2 *this->GetArea());7078 h=sqrt(2.*this->GetArea()); 7070 7079 7071 7080 /*Start looping on the number of gaussian points:*/ … … 7199 7208 } 7200 7209 /*}}}*/ 7210 /*FUNCTION Tria::CreateKMatrixBalancevelocity{{{*/ 7211 ElementMatrix* Tria::CreateKMatrixBalancevelocity(void){ 7212 7213 /*Intermediaries */ 7214 IssmDouble xyz_list[NUMVERTICES][3]; 7215 IssmDouble dhdt_g,mb_g,ms_g,Jdettria; 7216 IssmDouble h,gamma,thickness; 7217 IssmDouble hnx,hny,dhnx[2],dhny[2]; 7218 int i,j; 7219 IssmDouble D_scalar; 7220 7221 /*Fetch number of nodes and dof for this finite element*/ 7222 int numnodes = this->NumberofNodes(); 7223 7224 /*Initialize Element matrix and vectors*/ 7225 ElementMatrix* Ke = new ElementMatrix(nodes,numnodes,this->parameters,NoneApproximationEnum); 7226 IssmDouble* basis = xNew<IssmDouble>(numnodes); 7227 IssmDouble* dbasis = xNew<IssmDouble>(2*numnodes); 7228 IssmDouble* HNx = xNew<IssmDouble>(numnodes); 7229 IssmDouble* HNy = xNew<IssmDouble>(numnodes); 7230 IssmDouble* H = xNew<IssmDouble>(numnodes); 7231 IssmDouble* Nx = xNew<IssmDouble>(numnodes); 7232 IssmDouble* Ny = xNew<IssmDouble>(numnodes); 7233 7234 /*Retrieve all Inputs and parameters: */ 7235 GetVerticesCoordinates(&xyz_list[0][0],vertices,NUMVERTICES); 7236 Input* H_input=inputs->GetInput(ThicknessEnum); _assert_(H_input); 7237 7238 /*Get vector N for all nodes*/ 7239 GetInputListOnNodes(Nx,SurfaceSlopeXEnum); 7240 GetInputListOnNodes(Ny,SurfaceSlopeYEnum); 7241 for(int i=0;i<numnodes;i++){ 7242 IssmDouble norm=sqrt(Nx[i]*Nx[i]+Ny[i]*Ny[i]); 7243 Nx[i] = Nx[i]/norm; 7244 Ny[i] = Ny[i]/norm; 7245 } 7246 7247 /*Build HNx and HNy*/ 7248 GetInputListOnNodes(H, ThicknessEnum); 7249 for(int i=0;i<numnodes;i++){ 7250 HNx[i]=H[i]*Nx[i]; 7251 HNy[i]=H[i]*Ny[i]; 7252 } 7253 7254 h=sqrt(2.*this->GetArea()); 7255 7256 /*Start looping on the number of gaussian points:*/ 7257 GaussTria* gauss=new GaussTria(2); 7258 for(int ig=gauss->begin();ig<gauss->end();ig++){ 7259 7260 gauss->GaussPoint(ig); 7261 7262 H_input->GetInputValue(&thickness,gauss); 7263 TriaRef::GetInputDerivativeValue(&dhnx[0],HNx,&xyz_list[0][0],gauss); 7264 TriaRef::GetInputDerivativeValue(&dhny[0],HNy,&xyz_list[0][0],gauss); 7265 TriaRef::GetInputValue(&hnx,HNx,gauss); 7266 TriaRef::GetInputValue(&hny,HNy,gauss); 7267 7268 gamma=h/(2.*thickness); 7269 7270 GetJacobianDeterminant(&Jdettria, &xyz_list[0][0],gauss); 7271 GetNodalFunctions(basis,gauss); 7272 GetNodalFunctionsDerivatives(dbasis,&xyz_list[0][0],gauss); 7273 7274 for(int i=0;i<numnodes;i++){ 7275 for(int j=0;j<numnodes;j++){ 7276 Ke->values[i*numnodes+j] = gauss->weight*Jdettria*( 7277 basis[i]*basis[j]*(dhnx[0]+dhny[1]) 7278 + basis[i]*(dbasis[0*numnodes+j]*hnx + dbasis[1*numnodes+j]*hny) 7279 + gamma*(basis[j]*(dhnx[0]+dhny[1]) + dbasis[0*numnodes+j]*hnx + dbasis[1*numnodes+j]*hny)* 7280 (basis[i]*(dhnx[0]+dhny[1]) + dbasis[0*numnodes+i]*hnx + dbasis[1*numnodes+i]*hny) 7281 ); 7282 } 7283 } 7284 } 7285 7286 /*Clean up and return*/ 7287 xDelete<IssmDouble>(basis); 7288 xDelete<IssmDouble>(dbasis); 7289 xDelete<IssmDouble>(H); 7290 xDelete<IssmDouble>(Nx); 7291 xDelete<IssmDouble>(Ny); 7292 xDelete<IssmDouble>(HNx); 7293 xDelete<IssmDouble>(HNy); 7294 delete gauss; 7295 return Ke; 7296 } 7297 /*}}}*/ 7201 7298 /*FUNCTION Tria::CreatePVectorBalancethickness{{{*/ 7202 7299 ElementVector* Tria::CreatePVectorBalancethickness(void){ … … 7293 7390 /*Clean up and return*/ 7294 7391 xDelete<IssmDouble>(basis); 7392 delete gauss; 7393 return pe; 7394 } 7395 /*}}}*/ 7396 /*FUNCTION Tria::CreatePVectorBalancevelocity{{{*/ 7397 ElementVector* Tria::CreatePVectorBalancevelocity(void){ 7398 7399 /*Intermediaries */ 7400 IssmDouble xyz_list[NUMVERTICES][3]; 7401 IssmDouble dhdt_g,mb_g,ms_g,Jdettria; 7402 IssmDouble h,gamma,thickness; 7403 IssmDouble hnx,hny,dhnx[2],dhny[2]; 7404 7405 /*Fetch number of nodes and dof for this finite element*/ 7406 int numnodes = this->NumberofNodes(); 7407 7408 /*Initialize Element vector and other vectors*/ 7409 ElementVector* pe = new ElementVector(nodes,numnodes,this->parameters); 7410 IssmDouble* basis = xNew<IssmDouble>(numnodes); 7411 IssmDouble* dbasis = xNew<IssmDouble>(numnodes*2); 7412 IssmDouble* HNx = xNew<IssmDouble>(numnodes); 7413 IssmDouble* HNy = xNew<IssmDouble>(numnodes); 7414 IssmDouble* H = xNew<IssmDouble>(numnodes); 7415 IssmDouble* Nx = xNew<IssmDouble>(numnodes); 7416 IssmDouble* Ny = xNew<IssmDouble>(numnodes); 7417 7418 /*Retrieve all inputs and parameters*/ 7419 GetVerticesCoordinates(&xyz_list[0][0],vertices,NUMVERTICES); 7420 Input* ms_input=inputs->GetInput(SurfaceforcingsMassBalanceEnum); _assert_(ms_input); 7421 Input* mb_input=inputs->GetInput(BasalforcingsMeltingRateEnum); _assert_(mb_input); 7422 Input* dhdt_input=inputs->GetInput(BalancethicknessThickeningRateEnum); _assert_(dhdt_input); 7423 Input* H_input=inputs->GetInput(ThicknessEnum); _assert_(H_input); 7424 7425 /*Get vector N for all nodes*/ 7426 GetInputListOnNodes(Nx,SurfaceSlopeXEnum); 7427 GetInputListOnNodes(Ny,SurfaceSlopeYEnum); 7428 for(int i=0;i<numnodes;i++){ 7429 IssmDouble norm=sqrt(Nx[i]*Nx[i]+Ny[i]*Ny[i]); 7430 Nx[i] = Nx[i]/norm; 7431 Ny[i] = Ny[i]/norm; 7432 } 7433 7434 /*Build HNx and HNy*/ 7435 GetInputListOnNodes(H, ThicknessEnum); 7436 for(int i=0;i<numnodes;i++){ 7437 HNx[i]=H[i]*Nx[i]; 7438 HNy[i]=H[i]*Ny[i]; 7439 } 7440 7441 h=sqrt(2.*this->GetArea()); 7442 7443 /* Start looping on the number of gaussian points: */ 7444 GaussTria* gauss=new GaussTria(2); 7445 for(int ig=gauss->begin();ig<gauss->end();ig++){ 7446 7447 gauss->GaussPoint(ig); 7448 7449 ms_input->GetInputValue(&ms_g,gauss); 7450 mb_input->GetInputValue(&mb_g,gauss); 7451 dhdt_input->GetInputValue(&dhdt_g,gauss); 7452 H_input->GetInputValue(&thickness,gauss); 7453 7454 GetJacobianDeterminant(&Jdettria, &xyz_list[0][0],gauss); 7455 GetNodalFunctions(basis,gauss); 7456 GetNodalFunctionsDerivatives(dbasis,&xyz_list[0][0],gauss); 7457 7458 TriaRef::GetInputDerivativeValue(&dhnx[0],HNx,&xyz_list[0][0],gauss); 7459 TriaRef::GetInputDerivativeValue(&dhny[0],HNy,&xyz_list[0][0],gauss); 7460 TriaRef::GetInputValue(&hnx,HNx,gauss); 7461 TriaRef::GetInputValue(&hny,HNy,gauss); 7462 7463 gamma=h/(2.*thickness); 7464 7465 for(int i=0;i<numnodes;i++){ 7466 pe->values[i]+=Jdettria*gauss->weight*(ms_g-mb_g-dhdt_g)*( 7467 basis[i] + gamma*(basis[i]*(dhnx[0]+dhny[0])+hnx*dbasis[0] + hny*dbasis[1])); 7468 } 7469 } 7470 7471 /*Clean up and return*/ 7472 xDelete<IssmDouble>(basis); 7473 xDelete<IssmDouble>(dbasis); 7474 xDelete<IssmDouble>(H); 7475 xDelete<IssmDouble>(Nx); 7476 xDelete<IssmDouble>(Ny); 7477 xDelete<IssmDouble>(HNx); 7478 xDelete<IssmDouble>(HNy); 7295 7479 delete gauss; 7296 7480 return pe; -
TabularUnified issm/trunk-jpl/src/c/classes/Elements/Tria.h ¶
r15982 r16007 183 183 ElementMatrix* CreateKMatrixBalancethickness_DG(void); 184 184 ElementMatrix* CreateKMatrixBalancethickness_CG(void); 185 ElementMatrix* CreateKMatrixBalancevelocity(void); 185 186 ElementMatrix* CreateKMatrixMelting(void); 186 187 ElementMatrix* CreateKMatrixMasstransport(void); … … 194 195 ElementVector* CreatePVectorBalancethickness_DG(void); 195 196 ElementVector* CreatePVectorBalancethickness_CG(void); 197 ElementVector* CreatePVectorBalancevelocity(void); 196 198 ElementVector* CreatePVectorMasstransport(void); 197 199 ElementVector* CreatePVectorMasstransport_CG(void); -
TabularUnified issm/trunk-jpl/src/c/modules/ModelProcessorx/CreateDataSets.cpp ¶
r15877 r16007 114 114 UpdateElementsBalancethickness(elements,iomodel,analysis_counter,analysis_type); 115 115 break; 116 case BalancevelocityAnalysisEnum: 117 CreateNodesBalancevelocity(pnodes, iomodel); 118 CreateConstraintsBalancevelocity(pconstraints,iomodel); 119 CreateLoadsBalancevelocity(ploads,iomodel); 120 UpdateElementsBalancevelocity(elements,iomodel,analysis_counter,analysis_type); 121 break; 116 122 #endif 117 123 -
TabularUnified issm/trunk-jpl/src/c/modules/ModelProcessorx/DistributeNumDofs.cpp ¶
r15877 r16007 115 115 numdofs=1; 116 116 break; 117 case BalancevelocityAnalysisEnum: 118 numdofs=1; 119 break; 117 120 default: 118 121 _error_("analysis type: " << analysis_type << " (" << EnumToStringx(analysis_type) << ") not implemented yet"); -
TabularUnified issm/trunk-jpl/src/c/modules/ModelProcessorx/ModelProcessorx.h ¶
r15877 r16007 119 119 void UpdateElementsBalancethickness(Elements* elements,IoModel* iomodel,int analysis_counter,int analysis_type); 120 120 121 /*balancedvelocity:*/ 122 void CreateNodesBalancevelocity(Nodes** pnodes,IoModel* iomodel); 123 void CreateConstraintsBalancevelocity(Constraints** pconstraints,IoModel* iomodel); 124 void CreateLoadsBalancevelocity(Loads** ploads, IoModel* iomodel); 125 void UpdateElementsBalancevelocity(Elements* elements,IoModel* iomodel,int analysis_counter,int analysis_type); 126 121 127 /*transient: */ 122 128 void UpdateElementsTransient(Elements* elements,Parameters* parameters,IoModel* iomodel,int analysis_counter,int analysis_type); -
TabularUnified issm/trunk-jpl/src/c/shared/Enum/EnumDefinitions.h ¶
r15986 r16007 273 273 BalancethicknessSoftAnalysisEnum, 274 274 BalancethicknessSoftSolutionEnum, 275 BalancevelocityAnalysisEnum, 276 BalancevelocitySolutionEnum, 275 277 BedSlopeAnalysisEnum, 276 278 BedSlopeSolutionEnum, -
TabularUnified issm/trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp ¶
r15986 r16007 279 279 case BalancethicknessSoftAnalysisEnum : return "BalancethicknessSoftAnalysis"; 280 280 case BalancethicknessSoftSolutionEnum : return "BalancethicknessSoftSolution"; 281 case BalancevelocityAnalysisEnum : return "BalancevelocityAnalysis"; 282 case BalancevelocitySolutionEnum : return "BalancevelocitySolution"; 281 283 case BedSlopeAnalysisEnum : return "BedSlopeAnalysis"; 282 284 case BedSlopeSolutionEnum : return "BedSlopeSolution"; -
TabularUnified issm/trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp ¶
r15986 r16007 285 285 else if (strcmp(name,"BalancethicknessSoftAnalysis")==0) return BalancethicknessSoftAnalysisEnum; 286 286 else if (strcmp(name,"BalancethicknessSoftSolution")==0) return BalancethicknessSoftSolutionEnum; 287 else if (strcmp(name,"BalancevelocityAnalysis")==0) return BalancevelocityAnalysisEnum; 288 else if (strcmp(name,"BalancevelocitySolution")==0) return BalancevelocitySolutionEnum; 287 289 else if (strcmp(name,"BedSlopeAnalysis")==0) return BedSlopeAnalysisEnum; 288 290 else if (strcmp(name,"BedSlopeSolution")==0) return BedSlopeSolutionEnum; … … 381 383 else if (strcmp(name,"NodeSId")==0) return NodeSIdEnum; 382 384 else if (strcmp(name,"VectorParam")==0) return VectorParamEnum; 383 else if (strcmp(name,"Riftfront")==0) return RiftfrontEnum;384 else if (strcmp(name,"RiftfrontType")==0) return RiftfrontTypeEnum;385 385 else stage=4; 386 386 } 387 387 if(stage==4){ 388 if (strcmp(name,"Segment")==0) return SegmentEnum; 388 if (strcmp(name,"Riftfront")==0) return RiftfrontEnum; 389 else if (strcmp(name,"RiftfrontType")==0) return RiftfrontTypeEnum; 390 else if (strcmp(name,"Segment")==0) return SegmentEnum; 389 391 else if (strcmp(name,"SegmentRiftfront")==0) return SegmentRiftfrontEnum; 390 392 else if (strcmp(name,"SpcDynamic")==0) return SpcDynamicEnum; … … 504 506 else if (strcmp(name,"P2")==0) return P2Enum; 505 507 else if (strcmp(name,"P2xP1")==0) return P2xP1Enum; 506 else if (strcmp(name,"P1xP2")==0) return P1xP2Enum;507 else if (strcmp(name,"P1P1")==0) return P1P1Enum;508 508 else stage=5; 509 509 } 510 510 if(stage==5){ 511 if (strcmp(name,"P1P1GLS")==0) return P1P1GLSEnum; 511 if (strcmp(name,"P1xP2")==0) return P1xP2Enum; 512 else if (strcmp(name,"P1P1")==0) return P1P1Enum; 513 else if (strcmp(name,"P1P1GLS")==0) return P1P1GLSEnum; 512 514 else if (strcmp(name,"MINI")==0) return MINIEnum; 513 515 else if (strcmp(name,"MINIcondensed")==0) return MINIcondensedEnum;
Note:
See TracChangeset
for help on using the changeset viewer.