Changeset 4174


Ignore:
Timestamp:
06/23/10 14:49:50 (15 years ago)
Author:
Mathieu Morlighem
Message:

moved AXPY type switch into inputs and fixed compilation

Location:
issm/trunk/src
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified issm/trunk/src/c/objects/Elements/Tria.cpp

    r4172 r4174  
    549549        double rho_ice,rho_water;
    550550
    551         /*recover material parameters: */
    552         rho_ice=matpar->GetRhoIce();
    553         rho_water=matpar->GetRhoWater();
    554 
    555         ISSMERROR("not supported yet!");
     551        /*If shelf: hydrostatic equilibrium*/
     552        if (this->GetShelf()){
     553
     554                /*recover material parameters: */
     555                rho_ice=matpar->GetRhoIce();
     556                rho_water=matpar->GetRhoWater();
     557
     558        }
     559        /*If sheet: surface = bed + thickness*/
     560        else{
     561                ISSMERROR("not supported yet!");
     562        }
    556563}
    557564/*}}}*/
     
    54775484
    54785485        /*some checks: */
    5479         if(!xinput || !yinput)ISSMERROR("%s%s%s%s%s"," input ",EnumAsString(XEnum)," or input ",EnumAsString(YEnum)," could not be found!");
    5480         if(xinput->Enum()!=yinput->Enum())ISSMERROR("%s%s%s%s%s"," input ",EnumAsString(XEnum)," and input ",EnumAsString(YEnum)," are not of the same type!");
     5486        if(!xinput || !yinput) ISSMERROR("%s%s%s%s%s"," input ",EnumAsString(XEnum)," or input ",EnumAsString(YEnum)," could not be found!");
    54815487
    54825488        /*Scale: */
  • TabularUnified issm/trunk/src/c/objects/Inputs/BeamVertexInput.cpp

    r4057 r4174  
    2323}
    2424/*}}}*/
    25 /*FUNCTION BeamVertexInput::BeamVertexInput(double* values){{{1*/
     25/*FUNCTION BeamVertexInput::BeamVertexInput(int in_enum_type, double* values){{{1*/
    2626BeamVertexInput::BeamVertexInput(int in_enum_type,double* in_values){
    2727
     
    269269        xbeamvertexinput=(BeamVertexInput*)xinput;
    270270
    271         /*Carry out the AXPY operation:*/
    272         for(i=0;i<numgrids;i++)this->values[i]=this->values[i]+scalar*xbeamvertexinput->values[i];
     271        /*Carry out the AXPY operation depending on type:*/
     272        switch(xinput->Enum()){
     273
     274                case BeamVertexInputEnum:
     275                        for(i=0;i<numgrids;i++)this->values[i]=this->values[i]+scalar*xbeamvertexinput->values[i];
     276                        return;
     277
     278                default:
     279                        ISSMERROR("not implemented yet");
     280        }
    273281
    274282}
  • TabularUnified issm/trunk/src/c/objects/Inputs/BoolInput.cpp

    r4057 r4174  
    236236        xboolinput=(BoolInput*)xinput;
    237237
    238         /*Carry out the AXPY operation:*/
    239         this->value=this->value+scalar*xboolinput->value;
     238        /*Carry out the AXPY operation depending on type:*/
     239        switch(xinput->Enum()){
     240
     241                case BoolInputEnum:
     242                        this->value=(bool)(this->value+scalar*xboolinput->value);
     243                        return;
     244
     245                default:
     246                        ISSMERROR("not implemented yet");
     247        }
    240248
    241249}
  • TabularUnified issm/trunk/src/c/objects/Inputs/DoubleInput.cpp

    r4057 r4174  
    247247        xdoubleinput=(DoubleInput*)xinput;
    248248
    249         /*Carry out the AXPY operation:*/
    250         this->value=this->value+scalar*xdoubleinput->value;
     249        /*Carry out the AXPY operation depending on type:*/
     250        switch(xinput->Enum()){
     251
     252                case DoubleInputEnum:
     253                        this->value=this->value+scalar*xdoubleinput->value;
     254                        return;
     255
     256                default:
     257                        ISSMERROR("not implemented yet");
     258        }
    251259
    252260}
  • TabularUnified issm/trunk/src/c/objects/Inputs/IntInput.cpp

    r4057 r4174  
    236236        xintinput=(IntInput*)xinput;
    237237
    238         /*Carry out the AXPY operation:*/
    239         dvalue=(double)this->value+scalar*(double)xintinput->value;
    240         this->value=(int)dvalue;
     238        /*Carry out the AXPY operation depending on type:*/
     239        switch(xinput->Enum()){
     240
     241                case IntInputEnum:
     242                        dvalue=(double)this->value+scalar*(double)xintinput->value;
     243                        this->value=(int)dvalue;
     244                        return;
     245
     246                default:
     247                        ISSMERROR("not implemented yet");
     248        }
    241249
    242250}
  • TabularUnified issm/trunk/src/c/objects/Inputs/PentaVertexInput.cpp

    r4057 r4174  
    918918        xpentavertexinput=(PentaVertexInput*)xinput;
    919919
    920         /*Carry out the AXPY operation:*/
    921         for(i=0;i<numgrids;i++)this->values[i]=this->values[i]+scalar*xpentavertexinput->values[i];
     920        /*Carry out the AXPY operation depending on type:*/
     921        switch(xinput->Enum()){
     922
     923                case PentaVertexInputEnum:
     924                        for(i=0;i<numgrids;i++)this->values[i]=this->values[i]+scalar*xpentavertexinput->values[i];
     925                        return;
     926
     927                default:
     928                        ISSMERROR("not implemented yet");
     929        }
    922930
    923931}
  • TabularUnified issm/trunk/src/c/objects/Inputs/SingVertexInput.cpp

    r4057 r4174  
    237237        xsingvertexinput=(SingVertexInput*)xinput;
    238238
    239         /*Carry out the AXPY operation:*/
    240         this->value=this->value+scalar*xsingvertexinput->value;
     239        /*Carry out the AXPY operation depending on type:*/
     240        switch(xinput->Enum()){
     241
     242                case SingVertexInputEnum:
     243                        this->value=this->value+scalar*xsingvertexinput->value;
     244                        return;
     245
     246                default:
     247                        ISSMERROR("not implemented yet");
     248        }
    241249
    242250}
  • TabularUnified issm/trunk/src/c/objects/Inputs/TriaVertexInput.cpp

    r4057 r4174  
    492492        xtriavertexinput=(TriaVertexInput*)xinput;
    493493
    494         /*Carry out the AXPY operation:*/
    495         for(i=0;i<numgrids;i++)this->values[i]=this->values[i]+scalar*xtriavertexinput->values[i];
     494        /*Carry out the AXPY operation depending on type:*/
     495        switch(xinput->Enum()){
     496
     497                case TriaVertexInputEnum :
     498                        for(i=0;i<numgrids;i++)this->values[i]=this->values[i]+scalar*xtriavertexinput->values[i];
     499                        return;
     500
     501                default :
     502                        ISSMERROR("not implemented yet");
     503        }
    496504
    497505}
  • TabularUnified issm/trunk/src/mex/VerticesDof/VerticesDof.cpp

    r4173 r4174  
    1515
    1616        /* output datasets: */
    17         Vec* partition=NULL;
    18         Vec* tpartition=NULL;
     17        Vec partition=NULL;
     18        Vec tpartition=NULL;
    1919
    2020        /*Boot module: */
     
    3232
    3333        /*partition and tpartition should be incremented by 1: */
    34         VecShift(partition->vector,1.0); //matlab indexing starts at 1.
    35         VecShift(tpartition->vector,1.0);
     34        VecShift(partition,1.0); //matlab indexing starts at 1.
     35        VecShift(tpartition,1.0);
    3636
    3737        /*write output datasets: */
Note: See TracChangeset for help on using the changeset viewer.