Changeset 24070


Ignore:
Timestamp:
07/09/19 05:22:14 (6 years ago)
Author:
Mathieu Morlighem
Message:

BUG: bad calculation of tx and ty

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

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/c/classes/Loads/Channel.cpp

    r24069 r24070  
    4848
    4949        /*Set channel cross section to 0*/
    50         this->S = 0.;
     50        this->S    = 0.;
     51        this->Sold = 0.;
    5152
    5253        /*Get edge info*/
     
    394395        IssmDouble tx = xyz_list_tria[index2][0] - xyz_list_tria[index1][0];
    395396        IssmDouble ty = xyz_list_tria[index2][1] - xyz_list_tria[index1][1];
    396         tx = tx/sqrt(tx*tx+ty*ty);
    397         ty = ty/sqrt(tx*tx+ty*ty);
     397        IssmDouble Lt = sqrt(tx*tx+ty*ty);
     398        tx = tx/Lt;
     399        ty = ty/Lt;
    398400
    399401        /* Start  looping on the number of gaussian points: */
     
    524526        IssmDouble tx = xyz_list_tria[index2][0] - xyz_list_tria[index1][0];
    525527        IssmDouble ty = xyz_list_tria[index2][1] - xyz_list_tria[index1][1];
    526         tx = tx/sqrt(tx*tx+ty*ty);
    527         ty = ty/sqrt(tx*tx+ty*ty);
     528        IssmDouble Lt = sqrt(tx*tx+ty*ty);
     529        tx = tx/Lt;
     530        ty = ty/Lt;
    528531
    529532        /* Start  looping on the number of gaussian points: */
     
    588591}
    589592/*}}}*/
     593void           Channel::SetChannelCrossSectionOld(void){/*{{{*/
     594
     595        this->Sold = this->S;
     596
     597} /*}}}*/
    590598void           Channel::UpdateChannelCrossSection(void){/*{{{*/
    591599
     
    630638        IssmDouble tx = xyz_list_tria[index2][0] - xyz_list_tria[index1][0];
    631639        IssmDouble ty = xyz_list_tria[index2][1] - xyz_list_tria[index1][1];
    632         tx = tx/sqrt(tx*tx+ty*ty);
    633         ty = ty/sqrt(tx*tx+ty*ty);
     640        IssmDouble Lt = sqrt(tx*tx+ty*ty);
     641        tx = tx/Lt;
     642        ty = ty/Lt;
    634643
    635644        /*Evaluate fields on center of edge*/
     
    681690
    682691        /*Solve ODE*/
    683         this->S = ODE1(alpha,beta,this->S,dt,2);
     692        this->S = ODE1(alpha,beta,this->Sold,dt,1);
    684693
    685694        /*Make sure Area > 0*/
  • issm/trunk-jpl/src/c/classes/Loads/Channel.h

    r24064 r24070  
    2020        private:
    2121                IssmDouble S;
     22                IssmDouble Sold;
    2223                bool       boundary;
    2324
     
    7677                /*}}}*/
    7778                /*Channel management:{{{*/
     79                void           SetChannelCrossSectionOld(void);
    7880                void           UpdateChannelCrossSection(void);
    7981                ElementVector* CreatePVectorHydrologyGlaDS(void);
Note: See TracChangeset for help on using the changeset viewer.