Changeset 15283


Ignore:
Timestamp:
06/19/13 08:48:57 (12 years ago)
Author:
bdef
Message:

CHG: fixing memory Leak and minor code modifications

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

Legend:

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

    r15276 r15283  
    60506050
    60516051        /*Check that all nodes are active, else return empty matrix*/
    6052         if(!this->AllActive()) return NULL;
     6052        if(!this->AllActive()){
     6053                delete gauss;
     6054                return NULL;
     6055        }
     6056
    60536057        /*Initialize Element matrix*/
    60546058        ElementMatrix* Ke=new ElementMatrix(nodes,NUMVERTICES,this->parameters,NoneApproximationEnum);
     
    62216225
    62226226        /*Check that all nodes are active, else return empty matrix*/
    6223         if(!this->AllActive()) return NULL;
    6224 
     6227        if(!this->AllActive()){
     6228                delete gauss;
     6229                return NULL;
     6230        }
    62256231        /*Initialize Element vector*/
    62266232        ElementVector* pe=new ElementVector(nodes,NUMVERTICES,this->parameters);
     
    62606266                }
    62616267        }
    6262 
     6268        delete gauss;
     6269       
    62636270        /*      Add residual if necessary*/
    6264         delete gauss;
    62656271        gauss=new GaussTria();
    62666272        for(int iv=0;iv<NUMVERTICES;iv++){
     
    64906496                /*Assign output pointer*/
    64916497                *ph_max=h_max;
    6492 
    64936498}
    64946499/*}}}*/
     
    65206525                case 0:
    65216526                        /*Just kipping the transfer to zero*/
     6527                        wh_trans=0.0;
    65226528                        break;
    65236529                case 1:
     
    65336539                       
    65346540                        for(int i=0;i<numdof;i++){
    6535                                 if(activeEpl[i]==0.0)continue;
     6541                                if(activeEpl[i]==0.0){
     6542                                        wh_trans=0.0;
     6543                                        continue;
     6544                                }
    65366545                               
    65376546                                eplstoring[i]=matpar->GetEplStoring();         
     
    65566565                }
    65576566        }
     6567        /*Free ressources:*/
     6568        xDelete<int>(doflist);
    65586569}
    65596570/*}}}*/
     
    66046615       
    66056616        for(i=0;i<numdof;i++){
    6606 
    66076617                /*Activate EPL if residual is >0 */
    66086618                if(residual[i]>0.){
     
    66156625                }
    66166626
    6617                 /*Increase the size of the efficient system if needed*/
    6618                 /*Increase is needed if the epl head reach the maximum value (sediment value for now)*/
     6627                /*Increase of the efficient system is needed if the epl head reach the maximum value (sediment max value for now)*/
    66196628                this->GetHydrologyDCInefficientHmax(&h_max,nodes[i]);
    6620                 if(eplhead[i]>=h_max){
    6621                         vec_mask->SetValue(nodes[i]->Sid(),1.,INS_VAL);
     6629                if(eplhead[i]>=h_max && this->AnyActive()){                     
    66226630                        for(j=0;j<numdof;j++){
    6623                                
     6631                                if(old_active[j]>0.){
     6632                                        vec_mask->SetValue(nodes[i]->Sid(),1.,INS_VAL);
     6633                                }
    66246634                                /*Increase of the domain is on the downstream node in term of sediment head*/
    66256635                                if(sedhead[j] == sedheadmin){
  • issm/trunk-jpl/src/c/classes/FemModel.cpp

    r15253 r15283  
    15831583void FemModel::HydrologyEPLupdateDomainx(void){ /*{{{*/
    15841584
    1585         Vector<IssmDouble> *mask          = NULL;
    1586         IssmDouble         *serial_mask   = NULL;
    1587         Vector<IssmDouble> *active        = NULL;
    1588         IssmDouble         *serial_active = NULL;
     1585        Vector<IssmDouble>* mask          = NULL;
     1586        IssmDouble*         serial_mask   = NULL;
     1587        Vector<IssmDouble>* active        = NULL;
     1588        IssmDouble*         serial_active = NULL;
    15891589
    15901590        /*Step 1: update maks, the mask might be extended by residual and/or using downstream sediment head*/
     
    16611661        InputUpdateFromVectorx(elements,nodes,vertices,loads,materials,parameters,transferg,WaterTransferEnum,NodesEnum);
    16621662
    1663 }
    1664 /*}}}*/
     1663        delete transferg;
     1664}
     1665/*}}}*/
Note: See TracChangeset for help on using the changeset viewer.