Changeset 18363


Ignore:
Timestamp:
08/11/14 14:11:35 (11 years ago)
Author:
Mathieu Morlighem
Message:

CHG: do not update results, use ug to get local min and max instead of inputs

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

Legend:

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

    r18360 r18363  
    724724}
    725725/*}}}*/
    726 void       Element::GetInputLocalMinMaxOnNodes(IssmDouble* min,IssmDouble* max,int input_enum){/*{{{*/
    727 
    728         Input* input = GetInput(input_enum);
    729         if(!input){
    730                 _error_("Input "<<EnumToStringx(input_enum)<<" not found");
    731         }
    732 
     726void       Element::GetInputLocalMinMaxOnNodes(IssmDouble* min,IssmDouble* max,IssmDouble* ug){/*{{{*/
     727
     728
     729        /*Get number of nodes for this element*/
    733730        int numnodes = this->GetNumberOfNodes();
    734         IssmDouble input_min = input->Min();
    735         IssmDouble input_max = input->Max();
     731
     732        /*Some checks to avoid segmentation faults*/
     733        _assert_(ug);
     734        _assert_(numnodes>0);
     735        _assert_(nodes);
     736
     737        /*Get element minimum/maximum*/
     738        IssmDouble input_min = ug[nodes[0]->GetDof(0,GsetEnum)];
     739        IssmDouble input_max = input_min;
     740        for(int i=1;i<numnodes;i++){
     741                if(ug[nodes[i]->GetDof(0,GsetEnum)] < input_min) input_min = ug[nodes[i]->GetDof(0,GsetEnum)];
     742                if(ug[nodes[i]->GetDof(0,GsetEnum)] > input_max) input_max = ug[nodes[i]->GetDof(0,GsetEnum)];
     743        }
     744
     745
     746        /*Second loop to reassign min and max with local extrema*/
    736747        for(int i=0;i<numnodes;i++){
    737748                if(min[nodes[i]->GetDof(0,GsetEnum)]>input_min) min[nodes[i]->GetDof(0,GsetEnum)] = input_min;
  • issm/trunk-jpl/src/c/classes/Elements/Element.h

    r18348 r18363  
    8585                void       GetInputListOnVertices(IssmDouble* pvalue,int enumtype);
    8686                void       GetInputListOnVertices(IssmDouble* pvalue,int enumtype,IssmDouble defaultvalue);
    87                 void       GetInputLocalMinMaxOnNodes(IssmDouble* min,IssmDouble* max,int input_enum);
     87                void       GetInputLocalMinMaxOnNodes(IssmDouble* min,IssmDouble* max,IssmDouble* ug);
    8888                void       GetInputValue(bool* pvalue,int enum_type);
    8989                void       GetInputValue(int* pvalue,int enum_type);
  • issm/trunk-jpl/src/c/classes/FemModel.cpp

    r18348 r18363  
    11251125
    11261126}/*}}}*/
    1127 void FemModel::GetInputLocalMinMaxOnNodesx(IssmDouble** pmin,IssmDouble** pmax,int input_enum){/*{{{*/
     1127void FemModel::GetInputLocalMinMaxOnNodesx(IssmDouble** pmin,IssmDouble** pmax,IssmDouble* ug){/*{{{*/
    11281128
    11291129        /*Get vector sizes for current configuration*/
     
    11441144        for(int i=0;i<this->elements->Size();i++){
    11451145                Element* element=dynamic_cast<Element*>(this->elements->GetObjectByOffset(i));
    1146                 element->GetInputLocalMinMaxOnNodes(uLmin_local,uLmax_local,input_enum);
     1146                element->GetInputLocalMinMaxOnNodes(uLmin_local,uLmax_local,ug);
    11471147        }
    11481148
  • issm/trunk-jpl/src/c/classes/FemModel.h

    r18348 r18363  
    6161
    6262                /*Modules*/
    63                 void GetInputLocalMinMaxOnNodesx(IssmDouble** pmin,IssmDouble** pmax,int input_enum);
     63                void GetInputLocalMinMaxOnNodesx(IssmDouble** pmin,IssmDouble** pmax,IssmDouble* ug);
    6464                void MassFluxx(IssmDouble* presponse);
    6565                void MaxAbsVxx(IssmDouble* presponse);
  • issm/trunk-jpl/src/c/solutionsequences/solutionsequence_fct.cpp

    r18362 r18363  
    390390        VecToMPISerial(&ml_serial  ,Ml_petsc,IssmComm::GetComm());
    391391
    392         /*Push uL to elements*/
    393         InputUpdateFromSolutionx(femmodel,u_serial);
    394 
    395392        /*Anti diffusive fluxes*/
    396393        Vec         Fbar            = NULL;
     
    399396        IssmDouble *ulmin           = NULL;
    400397        IssmDouble *ulmax           = NULL;
    401         femmodel->GetInputLocalMinMaxOnNodesx(&ulmin,&ulmax,ThicknessEnum);
     398        femmodel->GetInputLocalMinMaxOnNodesx(&ulmin,&ulmax,u_serial);
    402399        CreateRis(&Ri_plus_serial,&Ri_minus_serial,Mc_petsc,D_petsc,ml_serial,u,u_serial,udot_serial,ulmin,ulmax,deltat);
    403400        CreateFbar(&Fbar,Ri_plus_serial,Ri_minus_serial,Mc_petsc,D_petsc,udot_serial,u_serial,u);
Note: See TracChangeset for help on using the changeset viewer.