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

NEW: extended distance computation to Penta elements

File:
1 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
Note: See TracChangeset for help on using the changeset viewer.