Changeset 16788


Ignore:
Timestamp:
11/15/13 15:04:16 (11 years ago)
Author:
bdef
Message:

BUG+CHG: fixing a conditional jmp in pengrid and changing the way in which we deal with the active nodes for L2ProjectionEPL

Location:
issm/trunk-jpl/src/c/classes
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/c/classes/Elements/Penta.cpp

    r16783 r16788  
    95199519void Penta::HydrologyEPLGetActive(Vector<IssmDouble>* active_vec){
    95209520
    9521         if (!IsOnBed())return;
    9522 
     9521        if (!IsOnBed()){
     9522                return;
     9523        }
    95239524        Tria* tria=(Tria*)SpawnTria(0); //lower face is 0, upper face is 1.
    95249525        tria->HydrologyEPLGetActive(active_vec);
  • issm/trunk-jpl/src/c/classes/Elements/Tria.cpp

    r16787 r16788  
    69896989               
    69906990                for(int i=0;i<numdof;i++){
    6991                         /*Keeping thickness to 1 if EPL is not active*/
    6992                         if(activeEpl[i]==0.0){
    6993                                 thickness[i]=init_thick;
    6994                         }
    6995                         else{
    6996 
     6991                        /*Keeping thickness to initial value if EPL is not active*/
     6992                        /* if(activeEpl[i]==0.0){ */
     6993                        /*      thickness[i]=init_thick; */
     6994                        /* } */
     6995                        /* else{ */
    69976996                                /*Compute first the effective pressure in the EPL*/
    69986997                                EPL_N=gravity*((rho_ice*ice_thickness[i])-(rho_water*(eplhead[i]-bed[i])));
     
    70037002                                /*And proceed to the real thing*/
    70047003                                thickness[i] = old_thickness[i]*(1+((rho_water*gravity*dt)/(rho_ice*latentheat))*epl_conductivity*pow(EPLgrad,2.0)-2.0*(A*dt/(pow(n,n)))*(pow(EPL_N,n)));
    7005                         }
     7004                                //}
    70067005                }
    70077006                this->inputs->AddInput(new TriaInput(HydrologydcEplThicknessEnum,thickness,P1Enum));
  • issm/trunk-jpl/src/c/classes/FemModel.cpp

    r16685 r16788  
    14231423void FemModel::UpdateConstraintsL2ProjectionEPLx(void){ /*{{{*/
    14241424
    1425         for(int i=0;i<elements->Size();i++){
     1425        Vector<IssmDouble>* active        = NULL;
     1426        IssmDouble*         serial_active = NULL;
     1427
     1428        /*update node activity. If one element is connected to mask=1, all nodes are active*/
     1429        active=new Vector<IssmDouble>(nodes->NumberOfNodes(HydrologyDCEfficientAnalysisEnum));
     1430        for (int i=0;i<elements->Size();i++){
    14261431                Element* element=dynamic_cast<Element*>(elements->GetObjectByOffset(i));
    1427                 element->UpdateConstraintsL2ProjectionEPL();
    1428         }
     1432                element->HydrologyEPLGetActive(active);
     1433        }
     1434
     1435        /*Assemble and serialize*/
     1436        active->Assemble();
     1437        serial_active=active->ToMPISerial();
     1438        delete active;
     1439
     1440        /*Update node activation accordingly*/
     1441        int counter =0;
     1442        for (int i=0;i<nodes->Size();i++){
     1443                Node* node=dynamic_cast<Node*>(nodes->GetObjectByOffset(i));
     1444                if(node->InAnalysis(L2ProjectionEPLAnalysisEnum)){
     1445                        if(serial_active[node->Sid()]==1.){
     1446                                node->Activate();
     1447                                counter++;
     1448                        }
     1449                        else{
     1450                                node->Deactivate();
     1451                        }
     1452                }
     1453        }
     1454        xDelete<IssmDouble>(serial_active);
     1455        int sum_counter;
     1456        ISSM_MPI_Reduce(&counter,&sum_counter,1,ISSM_MPI_INT,ISSM_MPI_SUM,0,IssmComm::GetComm() );
     1457        ISSM_MPI_Bcast(&sum_counter,1,ISSM_MPI_INT,0,IssmComm::GetComm());               
     1458        counter=sum_counter;
     1459        if(VerboseSolution()) _printf0_("   Number of active nodes L2 Projection: "<< counter <<"\n");
     1460
     1461        /*Update dof indexings*/
     1462        this->UpdateConstraintsx();
     1463
     1464        /* for(int i=0;i<elements->Size();i++){ */
     1465        /*      Element* element=dynamic_cast<Element*>(elements->GetObjectByOffset(i)); */
     1466        /*      element->UpdateConstraintsL2ProjectionEPL(); */
     1467        /* } */
    14291468
    14301469}
  • issm/trunk-jpl/src/c/classes/Loads/Pengrid.cpp

    r16783 r16788  
    648648                return;
    649649        }
     650        if(!element->IsOnBed()){
     651                unstable=0;
     652                active=0;
     653                *punstable=unstable;
     654                return;
     655        }
    650656
    651657        /*Get sediment water head h*/
     
    654660        parameters->FindParam(&penalty_lock,HydrologydcPenaltyLockEnum);
    655661
    656         if (h>h_max)
     662        if (h>h_max){
    657663         new_active=1;
    658         else
     664        }
     665        else{
    659666         new_active=0;
     667        }
    660668
    661669        if(this->active==new_active){
Note: See TracChangeset for help on using the changeset viewer.