Changeset 19154


Ignore:
Timestamp:
02/25/15 09:27:11 (10 years ago)
Author:
Mathieu Morlighem
Message:

CHG: added simplistic reset levelset function and calving law

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

Legend:

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

    r19094 r19154  
    13671367IssmDouble Element::PureIceEnthalpy(IssmDouble pressure){/*{{{*/
    13681368        return this->matpar->PureIceEnthalpy(pressure);
     1369}/*}}}*/
     1370void       Element::ResetIceLevelset(void){/*{{{*/
     1371
     1372        /*Get Ice Levelset on vertices*/
     1373        int         numvertices = this->GetNumberOfVertices();
     1374        IssmDouble *values      = xNew<IssmDouble>(numvertices);
     1375        this->GetInputListOnVertices(values,MaskIceLevelsetEnum);
     1376
     1377        /*Project on {-1,+1}*/
     1378        for(int i=0;i<numvertices;i++){
     1379                if(values[i]>0) values[i]=+1.;
     1380                else            values[i]=-1.;
     1381        }
     1382        this->AddInput(MaskIceLevelsetEnum,values,P1Enum);
     1383
     1384        /*Cleanup and return*/
     1385        xDelete<IssmDouble>(values);
     1386
    13691387}/*}}}*/
    13701388void       Element::ResultInterpolation(int* pinterpolation,int* pnodesperelement,int output_enum){/*{{{*/
  • issm/trunk-jpl/src/c/classes/Elements/Element.h

    r19094 r19154  
    123123                ElementVector*     NewElementVector(int approximation_enum=NoneApproximationEnum);
    124124                IssmDouble         PureIceEnthalpy(IssmDouble pressure);
     125                void               ResetIceLevelset(void);
    125126                void               ResultInterpolation(int* pinterpolation,int*nodesperelement,int output_enum);
    126127                void               ResultToPatch(IssmDouble* values,int nodesperelement,int output_enum);
  • issm/trunk-jpl/src/c/classes/Elements/Tria.cpp

    r19137 r19154  
    336336        IssmDouble  calvingrate[NUMVERTICES];
    337337        IssmDouble  lambda1,lambda2,ex,ey,vx,vy,vel;
     338        IssmDouble  sigma_vm,sigma_max;
    338339
    339340        /* Get node coordinates and dof list: */
     
    341342
    342343        /*Retrieve all inputs and parameters we will need*/
    343         Input* vx_input=inputs->GetInput(VxEnum);        _assert_(vx_input);
    344         Input* vy_input=inputs->GetInput(VyEnum);        _assert_(vy_input);
     344        Input* vx_input = inputs->GetInput(VxEnum); _assert_(vx_input);
     345        Input* vy_input = inputs->GetInput(VyEnum); _assert_(vy_input);
     346        IssmDouble  B   = this->GetMaterialParameter(MaterialsRheologyBbarEnum);
     347        IssmDouble  n   = this->GetMaterialParameter(MaterialsRheologyNEnum);
    345348
    346349        /* Start looping on the number of vertices: */
     
    366369                lambda2 = max(lambda2,0.);
    367370
     371                /*Calculate sigma_vm*/
     372                sigma_vm  = sqrt(3./2.) * B * pow(lambda1*lambda1 + lambda2*lambda2,1./(2.*n));
     373                sigma_max = 350.e+3;
     374
    368375                /*Assign values*/
    369                 calvingratex[iv]=vx*pow(lambda1 + lambda2,1./3.)*3.e+2;
    370                 calvingratey[iv]=vy*pow(lambda1 + lambda2,1./3.)*3.e+2;
     376                calvingratex[iv]=vx*sigma_vm/sigma_max;
     377                calvingratey[iv]=vy*sigma_vm/sigma_max;
    371378                calvingrate[iv]=sqrt(calvingratex[iv]*calvingratex[iv] + calvingratey[iv]*calvingratey[iv]);
    372379        }
Note: See TracChangeset for help on using the changeset viewer.