Changeset 23674


Ignore:
Timestamp:
01/31/19 14:21:20 (6 years ago)
Author:
seroussi
Message:

NEW: extended distance computation to Penta elements

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

Legend:

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

    r23644 r23674  
    647647
    648648}/*}}}*/
     649void       Penta::CreateDistanceInputFromSegmentlist(IssmDouble* distances,int distanceenum){/*{{{*/
     650
     651        /*Get current field and vertex coordinates*/
     652        IssmDouble ls[NUMVERTICES],distance;
     653        GetInputListOnVertices(&ls[0],distanceenum);
     654
     655        /*Get distance from list of segments and reset ls*/
     656        for(int j=0;j<NUMVERTICES;j++){
     657                distance=distances[this->vertices[j]->Lid()];
     658                if(xIsNan<IssmDouble>(distance)) _error_("NaN found in vector");
     659                if(xIsInf<IssmDouble>(distance)) _error_("Inf found in vector");
     660
     661                /*FIXME: do we really need this?*/
     662                if(distanceenum==MaskIceLevelsetEnum) if(distance>10000) distance=10000;
     663                if(ls[j]>0){
     664                        ls[j] = distance;
     665                }
     666                else{
     667                        ls[j] = - distance;
     668                }
     669        }
     670
     671        /*Update Levelset*/
     672        this->inputs->AddInput(new PentaInput(distanceenum,&ls[0],P1Enum));
     673}
     674/*}}}*/
    649675void       Penta::ElementResponse(IssmDouble* presponse,int response_enum){/*{{{*/
    650676
  • issm/trunk-jpl/src/c/classes/Elements/Penta.h

    r23644 r23674  
    6060                void           ControlInputSetGradient(IssmDouble* gradient,int enum_type,int control_index);
    6161                void           ControlToVectors(Vector<IssmPDouble>* vector_control, Vector<IssmPDouble>* vector_gradient,int control_enum);
     62                void                            CreateDistanceInputFromSegmentlist(IssmDouble* distances,int distanceenum);
    6263                ElementMatrix* CreateBasalMassMatrix(void);
    6364                void           ElementResponse(IssmDouble* presponse,int response_enum);
Note: See TracChangeset for help on using the changeset viewer.