Changeset 15252
- Timestamp:
- 06/13/13 09:45:43 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/classes/Elements/Tria.cpp
r15249 r15252 6407 6407 6408 6408 /*Intermediaries*/ 6409 const int numdof 6410 int *doflist 6409 const int numdof = NDOF1 *NUMVERTICES; 6410 int *doflist = NULL; 6411 6411 bool converged; 6412 6412 bool isefficientlayer; 6413 IssmDouble activeEpl[numdof],activate[numdof]={0.0};6414 6413 IssmDouble values[numdof]; 6415 6414 IssmDouble residual[numdof]; … … 6433 6432 6434 6433 /*Get inputs*/ 6435 if(isefficientlayer){6436 GetInputListOnVertices(&activeEpl[0],HydrologydcMaskEplactiveEnum);6437 }6438 6434 if(converged){ 6439 6435 this->parameters->FindParam(&dt,TimesteppingTimeStepEnum); 6440 6436 this->parameters->FindParam(&kmax,HydrologySedimentKmaxEnum); 6441 6437 this->parameters->FindParam(&penalty_factor,HydrologydcPenaltyFactorEnum); 6442 6443 6438 6444 6439 kappa=kmax*pow(10.,penalty_factor); … … 6448 6443 if(values[i]>h_max){ 6449 6444 residual[i]=kappa*(values[i]-h_max); 6450 if(isefficientlayer) activate[i]=1.0;6451 6445 } 6452 6446 else{ 6453 if(isefficientlayer){6454 if(activeEpl[i]==1.0)activate[i]=1.0;6455 }6456 6447 residual[i]=0.0; 6457 6448 } 6458 6449 } 6459 6450 } 6460 else{6461 for(int i=0;i<NUMVERTICES;i++){6462 if(isefficientlayer){6463 if(activeEpl[i]==1.0)activate[i]=1.0;6464 }6465 }6466 }6467 6451 6468 6452 /*Add input to the element: */ 6469 if(isefficientlayer) this->inputs->AddInput(new TriaP1Input(HydrologydcMaskEplactiveEnum,&activate[0]));6470 6453 this->inputs->AddInput(new TriaP1Input(SedimentHeadEnum,values)); 6471 6454 this->inputs->AddInput(new TriaP1Input(SedimentHeadResidualEnum,residual)); … … 6473 6456 /*Free ressources:*/ 6474 6457 xDelete<int>(doflist); 6475 6476 6458 } 6477 6459 /*}}}*/ … … 6584 6566 6585 6567 /*Constants*/ 6586 const int numnodes =NUMVERTICES;6587 int flag;6568 const int numnodes = NUMVERTICES; 6569 IssmDouble flag = 0.; 6588 6570 IssmDouble active[numnodes]; 6589 6571 6590 6572 GetInputListOnVertices(&active[0],HydrologydcMaskEplactiveEnum); 6591 6573 6592 6574 for(int i=0;i<numnodes;i++) flag+=active[i]; 6593 6575 6594 6576 if(flag>0.){ 6595 for(int i=0;i<numnodes;i++) nodes[i]->Activate(); 6596 } 6597 6598 else if(!this->AnyActive()){ 6599 for(int i=0;i<numnodes;i++) nodes[i]->Deactivate(); 6600 6577 for(int i=0;i<numnodes;i++){ 6578 active_vec->SetValue(nodes[i]->Sid(),1.,INS_VAL); 6579 } 6601 6580 } 6602 6581 else{ … … 6617 6596 IssmDouble sedhead[numdof]; 6618 6597 IssmDouble eplhead[numdof]; 6619 6598 IssmDouble residual[numdof]; 6620 6599 6621 6600 GetInputListOnVertices(&old_active[0],HydrologydcMaskEplactiveEnum); 6622 6601 GetInputListOnVertices(&sedhead[0],SedimentHeadEnum); 6623 6602 GetInputListOnVertices(&eplhead[0],EplHeadEnum); 6624 6603 GetInputListOnVertices(&residual[0],SedimentHeadResidualEnum); 6604 6605 /*Get minimum sediment head*/ 6625 6606 sedheadmin=sedhead[0]; 6626 for(i=1;i<numdof;i++){ 6627 if(sedhead[i]<=sedheadmin)sedheadmin=sedhead[i]; 6628 } 6607 for(i=1;i<numdof;i++) if(sedhead[i]<=sedheadmin)sedheadmin=sedhead[i]; 6629 6608 6630 6609 for(i=0;i<numdof;i++){ 6610 6611 /*Activate EPL if residual is >0 */ 6612 if(residual[i]>0.){ 6613 vec_mask->SetValue(nodes[i]->Sid(),1.,INS_VAL); 6614 } 6615 6631 6616 /*If mask was alread one, keep one*/ 6632 if(old_active[i]>0.){6617 else if(old_active[i]>0.){ 6633 6618 vec_mask->SetValue(nodes[i]->Sid(),1.,INS_VAL); 6634 6619 } 6635 6636 this->GetHydrologyDCInefficientHmax(&h_max,nodes[i]); 6620 6637 6621 /*Increase the size of the efficient system if needed*/ 6638 6622 /*Increase is needed if the epl head reach the maximum value (sediment value for now)*/ 6623 this->GetHydrologyDCInefficientHmax(&h_max,nodes[i]); 6639 6624 if(eplhead[i]>=h_max){ 6640 vec_mask->SetValue(nodes[i]->Sid(),1.,INS_VAL);6641 for(j=0;j<numdof;j++){6642 6643 /*Increase of the domain is on the downstream node in term of sediment head*/6644 if(sedhead[j] == sedheadmin){6645 vec_mask->SetValue(nodes[j]->Sid(),1.,INS_VAL);6646 break;6647 }6648 }6625 //vec_mask->SetValue(nodes[i]->Sid(),1.,INS_VAL); 6626 //for(j=0;j<numdof;j++){ 6627 6628 // /*Increase of the domain is on the downstream node in term of sediment head*/ 6629 // if(sedhead[j] == sedheadmin){ 6630 // vec_mask->SetValue(nodes[j]->Sid(),1.,INS_VAL); 6631 // break; 6632 // } 6633 //} 6649 6634 } 6650 6635 }
Note:
See TracChangeset
for help on using the changeset viewer.