Changeset 23528


Ignore:
Timestamp:
12/10/18 04:07:14 (6 years ago)
Author:
bdef
Message:

CHG:minor hydro cleanup and verbose

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

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/c/analyses/HydrologyDCEfficientAnalysis.cpp

    r23387 r23528  
    653653}/*}}}*/
    654654
    655 void  HydrologyDCEfficientAnalysis::HydrologyEPLGetMask(Vector<IssmDouble>* vec_mask, Vector<IssmDouble>* recurence, int* eplzigzag_counter, Element* element){
     655void  HydrologyDCEfficientAnalysis::HydrologyEPLGetMask(Vector<IssmDouble>* vec_mask, Vector<IssmDouble>* recurence, Element* element){
    656656
    657657        bool        active_element;
     
    709709                        }
    710710                }
    711                 if (old_active[i]==0.){
     711                else if (old_active[i]==0.){
    712712                        /*Activate if we have a residual from sediment*/
    713713                        if(residual[i]>0.){
  • issm/trunk-jpl/src/c/analyses/HydrologyDCEfficientAnalysis.h

    r21468 r23528  
    1 /*! \file HydrologyDCEfficientAnalysis.h 
     1/*! \file HydrologyDCEfficientAnalysis.h
    22 *  \brief: header file for generic external result object
    33 */
     
    2222                void InitZigZagCounter(FemModel* femmodel);
    2323                void ResetCounter(FemModel* femmodel);
    24                        
     24
    2525                /*Finite element Analysis*/
    2626                void           Core(FemModel* femmodel);
     
    4040                IssmDouble EplStoring(Element* element,Gauss* gauss, Input* epl_thick_input, Input* epl_head_input, Input* base_input);
    4141                IssmDouble EplTransmitivity(Element* element,Gauss* gauss, Input* epl_thick_input, Input* epl_head_input, Input* base_input);
    42                 void HydrologyEPLGetMask(Vector<IssmDouble>* vec_mask, Vector<IssmDouble>* recurence, int* eplzigzag_counter, Element* element);
     42                void HydrologyEPLGetMask(Vector<IssmDouble>* vec_mask, Vector<IssmDouble>* recurence, Element* element);
    4343                void HydrologyEPLGetActive(Vector<IssmDouble>* active_vec, Element* element);
    4444                void GetHydrologyDCInefficientHmax(IssmDouble* ph_max,Element* element, Node* innode);
  • issm/trunk-jpl/src/c/classes/FemModel.cpp

    r23522 r23528  
    215215
    216216        /*Checks in debugging mode*/
    217         _assert_(this->analysis_type_list); 
     217        _assert_(this->analysis_type_list);
    218218
    219219        /*Find analysis in list*/
     
    929929                if(profiler->Used(ESACORE)) _printf0_("   "<<setw(40)<<left<<"ESA core elapsed time:"<<setw(7)<<setprecision(6)<<profiler->TotalTime(ESACORE) << " sec\n");
    930930                if(profiler->Used(SLRCORE)) _printf0_("   "<<setw(40)<<left<<"SLR core elapsed time:"<<setw(7)<<setprecision(6)<<profiler->TotalTime(SLRCORE) << " sec\n");
    931                 if(profiler->Used(MPISERIAL)) _printf0_("   "<<setw(40)<<left<<"MPISERIAL elapsed time:"<<setw(7)<<setprecision(6)<<profiler->TotalTime(MPISERIAL) << " sec\n");               
    932                
     931                if(profiler->Used(MPISERIAL)) _printf0_("   "<<setw(40)<<left<<"MPISERIAL elapsed time:"<<setw(7)<<setprecision(6)<<profiler->TotalTime(MPISERIAL) << " sec\n");
     932
    933933                /*Add to results: */
    934934                results->AddObject(new GenericExternalResult<IssmDouble>(results->Size()+1, ProfilingSolutionTimeEnum,  solution_time));
     
    11881188
    11891189                /*Update signed distance*/
    1190                 _assert_(vertex->lid<vertices->Size()); 
     1190                _assert_(vertex->lid<vertices->Size());
    11911191                distances[vertex->lid] = sqrt(dmin);
    11921192        }
     
    25392539
    25402540        int index=AnalysisIndex(config_type);
    2541         _assert_(this->analysis_type_list[index]==config_type); 
     2541        _assert_(this->analysis_type_list[index]==config_type);
    25422542
    25432543        /*start module: */
     
    27192719        /*Finally: interpolate all inputs and insert them into the new elements.*/
    27202720        this->InterpolateInputs(new_vertices,new_elements);
    2721        
     2721
    27222722        /*Delete old structure and set new pointers*/
    27232723        delete this->vertices;          this->vertices          = new_vertices;
     
    33833383/*}}}*/
    33843384void FemModel::GetMesh(int** elementslist, IssmDouble** x, IssmDouble** y, int* numberofvertices, int* numberofelements){/*{{{*/
    3385        
    3386         int amrtype;   
     3385
     3386        int amrtype;
    33873387        this->parameters->FindParam(&amrtype,AmrTypeEnum);
    3388    
     3388
    33893389        switch(amrtype){
    33903390
     
    34013401}/*}}}*/
    34023402void FemModel::SetMesh(int** elementslist, IssmDouble** x, IssmDouble** y, int* numberofvertices, int* numberofelements){/*{{{*/
    3403        
    3404         int amrtype;   
     3403
     3404        int amrtype;
    34053405        this->parameters->FindParam(&amrtype,AmrTypeEnum);
    3406    
     3406
    34073407        switch(amrtype){
    34083408
     
    35663566                }
    35673567        }
    3568        
     3568
    35693569        /*Cleanup*/
    35703570        xDelete<IssmDouble>(spc);
     
    46444644        for (int i=0;i<elements->Size();i++){
    46454645                Element* element=xDynamicCast<Element*>(elements->GetObjectByOffset(i));
    4646                 effanalysis->HydrologyEPLGetMask(mask,recurence,eplzigzag_counter,element);
     4646                effanalysis->HydrologyEPLGetMask(mask,recurence,element);
    46474647        }
    46484648        /*check for changes and increment zigzag counter, change the mask if necessary*/
     
    46524652                Node* node=xDynamicCast<Node*>(nodes->GetObjectByOffset(i));
    46534653                if(serial_rec[node->Sid()]==1.)eplzigzag_counter[node->Lid()] ++;
    4654                 if(eplzigzag_counter[node->Lid()]>eplflip_lock & eplflip_lock!=0){
     4654                if(eplzigzag_counter[node->Lid()]>eplflip_lock && eplflip_lock!=0){
    46554655                        mask->SetValue(node->Sid(),old_active[node->Sid()],INS_VAL);
    46564656                }
     
    51465146   Vector<IssmDouble>* vminvertexdistance = new Vector<IssmDouble>(numberofvertices);
    51475147        IssmDouble* pminvertexdistance                  = NULL;
    5148         IssmDouble* levelset_points                             = NULL; 
     5148        IssmDouble* levelset_points                             = NULL;
    51495149        IssmDouble x,y;
    51505150        IssmDouble threshold,resolution;
     
    51745174      sid= vertex->Sid();
    51755175                minvertexdistance=INFINITY;
    5176      
     5176
    51775177                /*Find the minimum vertex distance*/
    51785178                for(int j=0;j<numberofpoints;j++){
     
    51815181        }
    51825182                /*Now, insert in the vector*/
    5183                 vminvertexdistance->SetValue(sid,minvertexdistance,INS_VAL);   
     5183                vminvertexdistance->SetValue(sid,minvertexdistance,INS_VAL);
    51845184   }
    51855185        /*Assemble*/
     
    52835283                                else hmaxvertices[vid]=min(max(maxlength[i]/2.,resolution),hmaxvertices[vid]);//Try first dividing the element
    52845284                        }
    5285                 } 
     5285                }
    52865286                else {
    52875287                        /*Try unrefine the element*/
     
    52955295                                        }
    52965296                                }
    5297                         } 
     5297                        }
    52985298                }
    52995299        }
     
    53065306/*}}}*/
    53075307void FemModel::GetVerticeDistanceToZeroLevelSet(IssmDouble** pverticedistance,int levelset_type){/*{{{*/
    5308        
     5308
    53095309        //itapopo esse metodo pode ser deletado
    53105310
     
    53255325   IssmDouble* x                                        = NULL;
    53265326   IssmDouble* y                                        = NULL;
    5327         int* elementslist                               = NULL; 
     5327        int* elementslist                               = NULL;
    53285328        int numberofpoints;
    53295329        IssmDouble distance;
     
    53825382                this->amr->ExecuteRefinement(gl_distance,if_distance,deviatoricerror,thicknesserror,
    53835383                                                                                                &newdatalist,&newxylist,&newelementslist);
    5384                 if(newdatalist[0]<=0 || newdatalist[1]<=0) _error_("Error in the ReMeshNeopz.");       
     5384                if(newdatalist[0]<=0 || newdatalist[1]<=0) _error_("Error in the ReMeshNeopz.");
    53855385        }
    53865386
     
    54595459        this->parameters->FindParam(&this->amr->deviatoricerror_groupthreshold,AmrDeviatoricErrorGroupThresholdEnum);
    54605460        this->parameters->FindParam(&this->amr->deviatoricerror_maximum,AmrDeviatoricErrorMaximumEnum);
    5461        
     5461
    54625462        /*Initialize NeoPZ data structure*/
    54635463        this->amr->SetMesh(&elements,&x,&y,&numberofvertices,&numberofelements);
  • issm/trunk-jpl/src/c/cores/hydrology_core.cpp

    r23370 r23528  
    5050                /*intermediary: */
    5151                bool       isefficientlayer;
    52                 int        step,hydroslices;
     52                int        hydrostep,hydroslices;
    5353                IssmDouble time,init_time,hydrotime,yts;
    5454                IssmDouble dt,hydrodt;
     
    5656                femmodel->parameters->FindParam(&isefficientlayer,HydrologydcIsefficientlayerEnum);
    5757                femmodel->parameters->FindParam(&dt,TimesteppingTimeStepEnum);
    58                 femmodel->parameters->FindParam(&step,StepEnum);
    5958                femmodel->parameters->FindParam(&time,TimeEnum);
    6059                femmodel->parameters->FindParam(&hydroslices,HydrologyStepsPerStepEnum);
     
    6867                        hydrotime=init_time;
    6968                        hydrodt=dt/hydroslices; //computing hydro dt from dt and a divider
     69                        hydrostep=0;
    7070                        femmodel->parameters->AddObject(new DoubleParam(HydrologydtEnum,hydrodt));
    7171                        if(hydroslices>1){
     
    7777                                        femmodel->InitTransientOutputx(&stackedinput[0],4);
    7878                                        while(hydrotime<time-(yts*DBL_EPSILON)){ //loop on hydro dts
     79                                                hydrostep+=1;
    7980                                                hydrotime+=hydrodt;
     81                                                if(VerboseSolution()) _printf0_("hydro iteration " << hydrostep << "/" << hydroslices << "  time [yr]: " << setprecision(4) << hydrotime/yts << " (time step: " << hydrodt/yts << ")\n");
     82
    8083                                                /*save preceding timestep*/
    8184                                                InputDuplicatex(femmodel,SedimentHeadHydrostepEnum,SedimentHeadOldEnum);
Note: See TracChangeset for help on using the changeset viewer.