Changeset 22956


Ignore:
Timestamp:
07/16/18 15:48:51 (7 years ago)
Author:
Eric.Larour
Message:

CHG: missing HydrologyIDSupdateDomainx. Reverting.

File:
1 edited

Legend:

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

    r22955 r22956  
    45964596}
    45974597/*}}}*/
    4598 void FemModel::UpdateConstraintsL2ProjectionEPLx(IssmDouble* pL2count){ /*{{{*/
     4598void FemModvoid FemModel::HydrologyIDSupdateDomainx(IssmDouble* pIDScount){ /*{{{*/
     4599
     4600        bool                isthermal;
     4601        Vector<IssmDouble>* mask                                = NULL;
     4602        Vector<IssmDouble>* active                              = NULL;
     4603        IssmDouble*         serial_mask = NULL;
     4604        IssmDouble*         serial_active       = NULL;
     4605
     4606        HydrologyDCInefficientAnalysis* inefanalysis =  new HydrologyDCInefficientAnalysis();
     4607        parameters->FindParam(&isthermal,TransientIsthermalEnum);
     4608
     4609        /*When solving a thermal model we update the thawed nodes*/
     4610        if(isthermal){
     4611                /*Step 1: update mask, the mask correspond to thawed nodes (that have a meltingrate)*/
     4612                mask=new Vector<IssmDouble>(this->nodes->NumberOfNodes(HydrologyDCInefficientAnalysisEnum));
     4613
     4614                for (int i=0;i<elements->Size();i++){
     4615                        Element* element=xDynamicCast<Element*>(elements->GetObjectByOffset(i));
     4616                        inefanalysis->HydrologyIDSGetMask(mask,element);
     4617                }
     4618                /*Assemble and serialize*/
     4619                mask->Assemble();
     4620                serial_mask=mask->ToMPISerial();
     4621                delete mask;
     4622        }
     4623        /*for other cases we just grab the mask from the initialisation value*/
     4624        else{
     4625                GetVectorFromInputsx(&serial_mask,this,HydrologydcMaskThawedNodeEnum,NodeSIdEnum);
     4626        }
     4627        /*Update Mask and elementize*/
     4628        InputUpdateFromVectorx(this,serial_mask,HydrologydcMaskThawedNodeEnum,NodeSIdEnum);
     4629        xDelete<IssmDouble>(serial_mask);
     4630        inefanalysis->ElementizeIdsMask(this);
     4631
     4632        /*get node mask coherent with element mask*/
     4633        active=new Vector<IssmDouble>(nodes->NumberOfNodes(HydrologyDCInefficientAnalysisEnum));
     4634        for (int i=0;i<elements->Size();i++){
     4635                Element* element=xDynamicCast<Element*>(elements->GetObjectByOffset(i));
     4636                inefanalysis->HydrologyIdsGetActive(active,element);
     4637        }
     4638
     4639        /*Assemble and serialize*/
     4640        active->Assemble();
     4641        serial_active=active->ToMPISerial();
     4642        delete active;
     4643
     4644        /*Update node activation accordingly*/
     4645        int counter =0;
     4646        for (int i=0;i<nodes->Size();i++){
     4647                Node* node=xDynamicCast<Node*>(nodes->GetObjectByOffset(i));
     4648                if(node->InAnalysis(HydrologyDCInefficientAnalysisEnum)){
     4649                        if(serial_active[node->Sid()]==1.){
     4650                                node->Activate();
     4651                                if(!node->IsClone()) counter++;
     4652                        }
     4653                        else{
     4654                                node->Deactivate();
     4655                        }
     4656                }
     4657        }
     4658
     4659        xDelete<IssmDouble>(serial_active);
     4660        delete inefanalysis;
     4661        int sum_counter;
     4662        ISSM_MPI_Reduce(&counter,&sum_counter,1,ISSM_MPI_INT,ISSM_MPI_SUM,0,IssmComm::GetComm() );
     4663        ISSM_MPI_Bcast(&sum_counter,1,ISSM_MPI_INT,0,IssmComm::GetComm());
     4664        counter=sum_counter;
     4665        *pIDScount = counter;
     4666        if(VerboseSolution()) _printf0_("   Number of active nodes in IDS layer: "<< counter <<"\n");
     4667
     4668        /*Update dof indexings*/
     4669        this->UpdateConstraintsx();
     4670
     4671}
     4672/*}}}*/
     4673el::UpdateConstraintsL2ProjectionEPLx(IssmDouble* pL2count){ /*{{{*/
    45994674
    46004675        Vector<IssmDouble>* active        = NULL;
Note: See TracChangeset for help on using the changeset viewer.