Changeset 21213
- Timestamp:
- 09/20/16 09:30:18 (9 years ago)
- Location:
- issm/trunk-jpl/src/c
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/analyses/HydrologyDCEfficientAnalysis.cpp
r21203 r21213 105 105 void HydrologyDCEfficientAnalysis::CreateLoads(Loads* loads, IoModel* iomodel){/*{{{*/ 106 106 /*Nothing for now*/ 107 108 /*Fetch parameters: */ 109 int hydrology_model; 110 iomodel->FindConstant(&hydrology_model,"md.hydrology.model"); 111 if(hydrology_model!=HydrologydcEnum) return; 112 113 if(iomodel->domaintype==Domain3DEnum) iomodel->FetchData(1,"md.mesh.vertexonbase"); 114 115 //create penalties for nodes: no node can have water above the max 116 CreateSingleNodeToElementConnectivity(iomodel); 117 for(int i=0;i<iomodel->numberofvertices;i++){ 118 if (iomodel->domaintype!=Domain3DEnum){ 119 /*keep only this partition's nodes:*/ 120 if(iomodel->my_vertices[i]){ 121 loads->AddObject(new Moulin(iomodel->loadcounter+i+1,i,iomodel,HydrologyDCEfficientAnalysisEnum)); 122 } 123 } 124 else if(reCast<int>(iomodel->Data("md.mesh.vertexonbase")[i])){ 125 if(iomodel->my_vertices[i]){ 126 loads->AddObject(new Moulin(iomodel->loadcounter+i+1,i,iomodel,HydrologyDCEfficientAnalysisEnum)); 127 } 128 } 129 } 130 iomodel->DeleteData(1,"md.mesh.vertexonbase"); 107 131 }/*}}}*/ 108 132 -
issm/trunk-jpl/src/c/analyses/HydrologyDCInefficientAnalysis.cpp
r20690 r21213 140 140 if(iomodel->my_vertices[i]){ 141 141 loads->AddObject(new Pengrid(iomodel->loadcounter+i+1,i,iomodel,HydrologyDCInefficientAnalysisEnum)); 142 loads->AddObject(new Moulin(iomodel->loadcounter+i+1,i,iomodel,HydrologyDCInefficientAnalysisEnum)); 142 143 } 143 144 } … … 145 146 if(iomodel->my_vertices[i]){ 146 147 loads->AddObject(new Pengrid(iomodel->loadcounter+i+1,i,iomodel,HydrologyDCInefficientAnalysisEnum)); 148 loads->AddObject(new Moulin(iomodel->loadcounter+i+1,i,iomodel,HydrologyDCInefficientAnalysisEnum)); 147 149 } 148 150 } -
issm/trunk-jpl/src/c/classes/Loads/Moulin.cpp
r20827 r21213 180 180 181 181 case HydrologySommersAnalysisEnum: 182 pe = this->CreatePVectorMoulin(); 182 pe = this->CreatePVectorHydrologySommers(); 183 break; 184 case HydrologyDCInefficientAnalysisEnum: 185 pe = CreatePVectorHydrologyDCInefficient(); 186 break; 187 case HydrologyDCEfficientAnalysisEnum: 188 pe = CreatePVectorHydrologyDCEfficient(); 183 189 break; 184 190 default: … … 331 337 /*}}}*/ 332 338 333 ElementVector* Moulin::CreatePVector Moulin(void){/*{{{*/339 ElementVector* Moulin::CreatePVectorHydrologySommers(void){/*{{{*/ 334 340 335 341 /*If this node is not the master node (belongs to another partition of the … … 349 355 } 350 356 /*}}}*/ 357 ElementVector* Moulin::CreatePVectorHydrologyDCInefficient(void){/*{{{*/ 358 359 /*If this node is not the master node (belongs to another partition of the 360 * mesh), don't add the moulin input a second time*/ 361 if(node->IsClone()) return NULL; 362 bool isefficientlayer; 363 IssmDouble moulin_load,dt; 364 IssmDouble epl_active; 365 366 /*Initialize Element matrix*/ 367 ElementVector* pe=new ElementVector(&node,1,this->parameters); 368 369 this->element->GetInputValue(&moulin_load,node,HydrologydcBasalMoulinInputEnum); 370 parameters->FindParam(&dt,TimesteppingTimeStepEnum); 371 parameters->FindParam(&isefficientlayer,HydrologydcIsefficientlayerEnum); 372 // Test version input in EPL when active 373 if(isefficientlayer){ 374 this->element->GetInputValue(&epl_active,node,HydrologydcMaskEplactiveNodeEnum); 375 if(epl_active){ 376 pe->values[0]=moulin_load*0.0; 377 } 378 else{ 379 pe->values[0]=moulin_load*dt; 380 } 381 } 382 else{ 383 pe->values[0]=moulin_load*dt; 384 } 385 /*Clean up and return*/ 386 return pe; 387 } 388 /*}}}*/ 389 ElementVector* Moulin::CreatePVectorHydrologyDCEfficient(void){/*{{{*/ 390 391 /*If this node is not the master node (belongs to another partition of the 392 * mesh), don't add the moulin input a second time*/ 393 if(node->IsClone()) return NULL; 394 if(!this->node->IsActive()) return NULL; 395 IssmDouble moulin_load,dt; 396 ElementVector* pe=new ElementVector(&node,1,this->parameters); 397 398 this->element->GetInputValue(&moulin_load,node,HydrologydcBasalMoulinInputEnum); 399 parameters->FindParam(&dt,TimesteppingTimeStepEnum); 400 401 pe->values[0]=moulin_load*dt; 402 /*Clean up and return*/ 403 return pe; 404 } 405 /*}}}*/ -
issm/trunk-jpl/src/c/classes/Loads/Moulin.h
r20827 r21213 80 80 /*}}}*/ 81 81 82 ElementVector* CreatePVectorMoulin(void); 82 ElementVector* CreatePVectorHydrologySommers(void); 83 ElementVector* CreatePVectorHydrologyDCInefficient(void); 84 ElementVector* CreatePVectorHydrologyDCEfficient(void); 83 85 }; 84 86 -
issm/trunk-jpl/src/c/classes/Loads/Pengrid.cpp
r21203 r21213 193 193 /*}}}*/ 194 194 void Pengrid::CreatePVector(Vector<IssmDouble>* pf){/*{{{*/ 195 196 ElementVector* pe=NULL; 197 int analysis_type; 198 this->parameters->FindParam(&analysis_type,AnalysisTypeEnum); 199 200 switch(analysis_type){ 201 202 case HydrologyDCInefficientAnalysisEnum: 203 pe = CreatePVectorHydrologyDCInefficient(); 204 break; 205 case HydrologyDCEfficientAnalysisEnum: 206 pe = CreatePVectorHydrologyDCEfficient(); 207 break; 208 default: 209 /*No loads applied, do nothing: */ 210 return; 211 } 212 if(pe){ 213 pe->AddToGlobal(pf); 214 delete pe; 215 } 216 195 /*No loads applied, do nothing, originaly used for moulin input: */ 196 return; 197 217 198 } 218 199 /*}}}*/ … … 415 396 this->parameters->FindParam(&analysis_type,AnalysisTypeEnum); 416 397 417 if (analysis_type==StressbalanceAnalysisEnum){ 398 switch(analysis_type){ 399 case StressbalanceAnalysisEnum: 418 400 /*No penalty to check*/ 419 401 return; 420 } 421 else if (analysis_type==ThermalAnalysisEnum){ 402 case ThermalAnalysisEnum: 422 403 ConstraintActivateThermal(punstable); 423 }424 else if (analysis_type==MeltingAnalysisEnum){404 break; 405 case MeltingAnalysisEnum: 425 406 /*No penalty to check*/ 426 407 return; 427 } 428 else if (analysis_type==HydrologyDCInefficientAnalysisEnum){ 408 case HydrologyDCInefficientAnalysisEnum: 429 409 ConstraintActivateHydrologyDCInefficient(punstable); 430 return; 431 } 432 else{ 410 break; 411 default: 433 412 _error_("analysis: " << EnumToStringx(analysis_type) << " not supported yet"); 434 413 } 435 436 414 } 437 415 /*}}}*/ … … 559 537 } 560 538 /*}}}*/ 561 ElementVector* Pengrid::CreatePVectorHydrologyDCInefficient(void){/*{{{*/562 563 bool active_element,isefficientlayer;564 IssmDouble moulin_load,dt;565 IssmDouble epl_active;566 567 /*Initialize Element matrix*/568 ElementVector* pe=new ElementVector(&node,1,this->parameters);569 570 this->element->GetInputValue(&moulin_load,node,HydrologydcBasalMoulinInputEnum);571 parameters->FindParam(&dt,TimesteppingTimeStepEnum);572 parameters->FindParam(&isefficientlayer,HydrologydcIsefficientlayerEnum);573 574 575 // Test version input in EPL when active576 if(isefficientlayer){577 this->element->GetInputValue(&epl_active,node,HydrologydcMaskEplactiveNodeEnum);578 if(epl_active){579 pe->values[0]=moulin_load*0.0;580 }581 else{582 if(dt!=0.0) pe->values[0]=moulin_load*dt;583 }584 }585 else{586 if(dt!=0.0) pe->values[0]=moulin_load*dt;587 }588 589 //Initial treatment, allways input in sediment590 /* if(dt!=0.0) pe->values[0]=moulin_load*dt; */591 592 /*Clean up and return*/593 return pe;594 }595 /*}}}*/596 ElementVector* Pengrid::CreatePVectorHydrologyDCEfficient(void){/*{{{*/597 598 IssmDouble moulin_load,dt;599 600 /*Initialize Element matrix*/601 if(!this->active) return NULL;602 ElementVector* pe=new ElementVector(&node,1,this->parameters);603 604 this->element->GetInputValue(&moulin_load,node,HydrologydcBasalMoulinInputEnum);605 parameters->FindParam(&dt,TimesteppingTimeStepEnum);606 607 if(dt!=0.0) pe->values[0]=moulin_load*dt;608 609 /*Clean up and return*/610 return pe;611 }612 /*}}}*/613 539 ElementMatrix* Pengrid::PenaltyCreateKMatrixHydrologyDCInefficient(IssmDouble kmax){/*{{{*/ 614 540 IssmDouble penalty_factor; -
issm/trunk-jpl/src/c/classes/Loads/Pengrid.h
r21203 r21213 87 87 void ConstraintActivateHydrologyDCInefficient(int* punstable); 88 88 void ConstraintActivateThermal(int* punstable); 89 ElementVector* CreatePVectorHydrologyDCInefficient(void);90 ElementVector* CreatePVectorHydrologyDCEfficient(void);91 89 ElementMatrix* PenaltyCreateKMatrixHydrologyDCInefficient(IssmDouble kmax); 92 90 ElementMatrix* PenaltyCreateKMatrixMelting(IssmDouble kmax);
Note:
See TracChangeset
for help on using the changeset viewer.