source: issm/oecreview/Archive/20545-21336/ISSM-20650-20651.diff@ 21337

Last change on this file since 21337 was 21337, checked in by Mathieu Morlighem, 8 years ago

CHG: added Archive/20545-21336

File size: 1.8 KB
  • ../trunk-jpl/src/c/classes/Materials/Matbafl.cpp

     
    384384        Input* es_input = element->inputs->GetInput(MaterialsRheologyEsbarEnum); _assert_(es_input);
    385385        Input* ko_input = element->inputs->GetInput(MaterialsRheologyKobarEnum); _assert_(ko_input);
    386386        ec_input->GetInputValue(&Ec,gauss);
     387        es_input->GetInputValue(&Es,gauss);
     388        ko_input->GetInputValue(&ko,gauss);
     389
     390        /*Compute viscosity*/
     391        *pviscosity=GetViscosityGeneral(ko,Ec,Es,vx,vy,vz,&dvx[0],&dvy[0],&dvz[0]);
     392}/*}}}*/
     393void  Matbafl::ViscositySSADerivativeEpsSquare(IssmDouble* pmu_prime,IssmDouble* epsilon){/*{{{*/
     394        _error_("not implemented yet");
     395}/*}}}*/
     396void  Matbafl::ResetHooks(){/*{{{*/
     397
     398        this->element=NULL;
     399
     400        /*Get Element type*/
     401        this->helement->reset();
     402
     403}
     404/*}}}*/
     405IssmDouble Matbafl::GetViscosityGeneral(IssmDouble ko,IssmDouble Ec, IssmDouble Es,IssmDouble vx,IssmDouble vy,IssmDouble vz,IssmDouble* dvx,IssmDouble* dvy,IssmDouble* dvz){/*{{{*/
     406
     407        /*Intermediaries*/
     408        IssmDouble viscosity;
     409        IssmDouble vorticity[3],vorticity_norm;
     410        IssmDouble nrsp[3],nrsp_norm;
     411        IssmDouble eps[3][3],epso;
     412        IssmDouble epsprime[3],epsprime_norm;
     413        IssmDouble E,lambdas;
     414
     415        /*Create vorticity vector*/
     416        _assert_(dvx && dvy && dvz);
     417        vorticity[0] =  dvz[1] - dvy[2];
     418        vorticity[1] =  dvx[2] - dvz[0];
     419        vorticity[2] =  dvy[0] - dvx[1];
     420
     421        /*Normalize*/
     422        vorticity_norm = sqrt(vorticity[0]*vorticity[0] + vorticity[1]*vorticity[1] + vorticity[2]*vorticity[2]);
     423        if(vorticity_norm==0){
     424                vorticity[0] = 0.;
     425                vorticity[1] = 0.;
     426                vorticity[2] = 1.;
     427        }
    387428        else{
    388429                vorticity[0] =vorticity[0]/vorticity_norm;
    389430                vorticity[1] =vorticity[1]/vorticity_norm;
Note: See TracBrowser for help on using the repository browser.