Changeset 17310


Ignore:
Timestamp:
02/20/14 08:12:01 (11 years ago)
Author:
Mathieu Morlighem
Message:

CHG: working on SSA 1d

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

Legend:

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

    r17309 r17310  
    138138/*}}}*/
    139139
     140void  Seg::GetIcefrontCoordinates(IssmDouble** pxyz_front,IssmDouble* xyz_list,int levelsetenum){/*{{{*/
     141       
     142        /* Intermediaries */
     143        int nrfrontnodes,index;
     144        IssmDouble  levelset[NUMVERTICES];
     145
     146        /*Recover parameters and values*/
     147        GetInputListOnVertices(&levelset[0],levelsetenum);
     148        /* Get nodes where there is no ice */
     149        nrfrontnodes=0;
     150        for(int i=0;i<NUMVERTICES;i++){
     151                if(levelset[i]>=0.){
     152                        index=i;
     153                        nrfrontnodes++;
     154                }
     155        }
     156
     157        _assert_(nrfrontnodes==1);
     158
     159        IssmDouble* xyz_front = xNew<IssmDouble>(3);
     160
     161        /* Return nodes */
     162        for(int dir=0;dir<3;dir++){
     163                xyz_front[dir]=xyz_list[3*index+dir];
     164        }
     165
     166        *pxyz_front=xyz_front;
     167}/*}}}*/
    140168/*FUNCTION Seg::GetNumberOfNodes;{{{*/
    141169int Seg::GetNumberOfNodes(void){
     
    209237}
    210238/*}}}*/
     239/*FUNCTION Seg::NewGauss(IssmDouble* xyz_list, IssmDouble* xyz_list_front,int order){{{*/
     240Gauss* Seg::NewGauss(IssmDouble* xyz_list, IssmDouble* xyz_list_front,int order){
     241
     242        /*Output*/
     243        Gauss* gauss = NULL;
     244
     245        if(xyz_list_front[0] == xyz_list[0]){
     246                gauss = new GaussSeg(+1.);
     247        }
     248        else if(xyz_list_front[0] == xyz_list[3*1+0]){
     249                gauss = new GaussSeg(-1.);
     250        }
     251        else{
     252                _error_("front is not located on element edge");
     253        }
     254
     255        return gauss;
     256}
     257/*}}}*/
    211258/*FUNCTION Seg::NewElementVector{{{*/
    212259ElementVector* Seg::NewElementVector(int approximation_enum){
     
    235282}
    236283/*}}}*/
     284/*FUNCTION Seg::NormalSection{{{*/
     285void Seg::NormalSection(IssmDouble* normal,IssmDouble* xyz_list_front){
     286
     287        IssmDouble* xyz_list = xNew<IssmDouble>(NUMVERTICES*3);
     288        ::GetVerticesCoordinates(xyz_list,this->vertices,NUMVERTICES);
     289
     290        if(xyz_list_front[0]>xyz_list[0])
     291         normal[0]= + 1.;
     292        else
     293         normal[0]= - 1.;
     294
     295        xDelete<IssmDouble>(xyz_list);
     296}
     297/*}}}*/
  • issm/trunk-jpl/src/c/classes/Elements/Seg.h

    r17309 r17310  
    109109                void        NodalFunctionsDerivativesVelocity(IssmDouble* dbasis,IssmDouble* xyz_list,Gauss* gauss){_error_("not implemented yet");};
    110110                bool        IsIceInElement();
    111                 void        NormalSection(IssmDouble* normal,IssmDouble* xyz_list){_error_("not implemented yet");};
     111                void        NormalSection(IssmDouble* normal,IssmDouble* xyz_list);
    112112                void        NormalTop(IssmDouble* normal,IssmDouble* xyz_list){_error_("not implemented yet");};
    113113                void        NormalBase(IssmDouble* normal,IssmDouble* xyz_list){_error_("not implemented yet");};
     
    136136                Gauss*      NewGauss(void);
    137137                Gauss*      NewGauss(int order);
    138       Gauss*      NewGauss(IssmDouble* xyz_list, IssmDouble* xyz_list_front,int order){_error_("not implemented yet");};
     138      Gauss*      NewGauss(IssmDouble* xyz_list, IssmDouble* xyz_list_front,int order);
    139139      Gauss*      NewGauss(IssmDouble* xyz_list, IssmDouble* xyz_list_front,int order_horiz,int order_vert){_error_("not implemented yet");};
    140140      Gauss*      NewGauss(int point1,IssmDouble fraction1,IssmDouble fraction2,bool mainlyfloating,int order){_error_("not implemented yet");};
     
    151151                bool               IsIcefront(void);
    152152                void        ZeroLevelsetCoordinates(IssmDouble** pxyz_zero,IssmDouble* xyz_list,int levelsetenum){_error_("not implemented");};
    153                 void               GetIcefrontCoordinates(IssmDouble** pxyz_front,IssmDouble* xyz_list,int levelsetenum){_error_("not implemented");};
     153                void               GetIcefrontCoordinates(IssmDouble** pxyz_front,IssmDouble* xyz_list,int levelsetenum);
    154154                void        GetNormalFromLSF(IssmDouble *pnormal){_error_("not implemented yet");};
    155155
  • issm/trunk-jpl/src/c/classes/gauss/GaussSeg.cpp

    r17309 r17310  
    4646        xDelete<IssmPDouble>(pcoords1);
    4747        xDelete<IssmPDouble>(pweights);
     48
     49        /*Initialize static fields as undefinite*/
     50        weight=UNDEF;
     51        coord1=UNDEF;
     52}
     53/*}}}*/
     54/*FUNCTION GaussSeg::GaussSeg(IssmDouble position) {{{*/
     55GaussSeg::GaussSeg(IssmDouble position){
     56
     57        /*Get gauss points*/
     58        this->numgauss = 1;
     59        this->coords1=xNew<IssmDouble>(numgauss);
     60        this->weights=xNew<IssmDouble>(numgauss);
     61
     62        /*cast : */
     63        _assert_(position>=-1. && position<=+1.);
     64        this->coords1[0]=position;
     65        this->weights[0]=1.;
    4866
    4967        /*Initialize static fields as undefinite*/
  • issm/trunk-jpl/src/c/classes/gauss/GaussSeg.h

    r17309 r17310  
    2525                GaussSeg();
    2626                GaussSeg(int order);
     27                GaussSeg(IssmDouble position);
    2728                ~GaussSeg();
    2829
Note: See TracChangeset for help on using the changeset viewer.