Changeset 12560


Ignore:
Timestamp:
06/26/12 11:59:35 (13 years ago)
Author:
utke
Message:

according to M. Morlighem all Results should be passive and the idea is to pass in active values to the constructors and in the constructor reCast and drop the derivatives under the assumption that cost functions etc. are computed before the results are formed so that the adjoint has the dependency it needs. The current problem is that the Results also call unit conversions which is an active method and therefore should not be applied to passive data. A solution for the latter is needed.

Location:
issm/trunk-jpl/src/c/objects/ElementResults
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/c/objects/ElementResults/BoolElementResult.h

    r12463 r12560  
    2121                bool   value;
    2222                int    step;
    23                 IssmDouble time;
     23                IssmPDouble time;
    2424
    2525        public:
     
    4040                /*ElementResult virtual functions definitions: {{{*/
    4141                ElementResult* SpawnTriaElementResult(int* indices);
    42                 IssmDouble  GetTime(void){return time;};
     42                IssmPDouble  GetTime(void){return time;};
    4343                int     GetStep(void){return step;};
    4444                void    ProcessUnits(Parameters* parameters);
  • issm/trunk-jpl/src/c/objects/ElementResults/DoubleElementResult.cpp

    r12511 r12560  
    2828
    2929        enum_type=in_enum_type;
    30         value=in_value;
     30        value=reCast<IssmPDouble>(in_value);
    3131        step=in_step;
    32         time=in_time;
     32        time=reCast<IssmPDouble>(in_time);
    3333}
    3434/*}}}*/
  • issm/trunk-jpl/src/c/objects/ElementResults/DoubleElementResult.h

    r12494 r12560  
    11/*! \file DoubleElementResult.h
    2  *  \brief: header file for IssmDouble result object
    3  *  A IssmDouble result object is just derived from a DoubleInput object, with additional time and step information.
     2 *  \brief: header file for IssmPDouble result object
     3 *  A IssmPDouble result object is just derived from a DoubleInput object, with additional time and step information.
    44 */
    55
     
    1919        private:
    2020                int    enum_type;
    21                 IssmDouble value;
     21                IssmPDouble value;
    2222                int    step;
    23                 IssmDouble time;
     23                IssmPDouble time;
    2424
    2525        public:
     
    4040                /*ElementResult virtual functions definitions: {{{*/
    4141                ElementResult* SpawnTriaElementResult(int* indices);
    42                 IssmDouble  GetTime(void){return time;};
     42                IssmPDouble  GetTime(void){return time;};
    4343                int     GetStep(void){return step;};
    4444                void    ProcessUnits(Parameters* parameters);
  • issm/trunk-jpl/src/c/objects/ElementResults/ElementResult.h

    r12463 r12560  
    1919               
    2020                virtual         ElementResult* SpawnTriaElementResult(int* indices)=0;
    21                 virtual IssmDouble  GetTime(void)=0;
     21                virtual IssmPDouble  GetTime(void)=0;
    2222                virtual int     GetStep(void)=0;
    2323                virtual void    ProcessUnits(Parameters* parameters)=0;
  • issm/trunk-jpl/src/c/objects/ElementResults/PentaP1ElementResult.cpp

    r12511 r12560  
    3030
    3131        enum_type=in_enum_type;
    32         for(i=0;i<6;i++)values[i]=in_values[i];
     32        for(i=0;i<6;i++)values[i]=reCast<IssmPDouble>(in_values[i]);
    3333        step=in_step;
    34         time=in_time;
     34        time=reCast<IssmPDouble>(in_time);
    3535}
    3636/*}}}*/
     
    9595        /*output*/
    9696        TriaP1ElementResult* outresult=NULL;
    97         IssmDouble newvalues[3];
     97        IssmPDouble newvalues[3];
    9898
    9999        /*Loop over the new indices*/
     
    140140void PentaP1ElementResult::GetVectorFromResults(Vector* vector,int* doflist,int* connectivitylist,int numdofs){
    141141
    142         IssmDouble data[6];
     142        IssmPDouble data[6];
    143143
    144144        if(numdofs!=6)_error2_("Result " << EnumToStringx(this->enum_type) << " is a PentaP1ElementResult and cannot write vector of " << numdofs << " dofs");
    145         for(int i=0;i<6;i++) data[i]=this->values[i]/(IssmDouble)connectivitylist[i];
     145        for(int i=0;i<6;i++) data[i]=this->values[i]/(IssmPDouble)connectivitylist[i];
    146146        vector->SetValues(numdofs,doflist,&data[0],ADD_VAL);
    147147
  • issm/trunk-jpl/src/c/objects/ElementResults/PentaP1ElementResult.h

    r12463 r12560  
    1818        private:
    1919                int    enum_type;
    20                 IssmDouble values[6];
     20                IssmPDouble values[6];
    2121                int    step;
    22                 IssmDouble time;
     22                IssmPDouble time;
    2323
    2424        public:
     
    3939                /*ElementResult virtual functions definitions: {{{*/
    4040                ElementResult* SpawnTriaElementResult(int* indices);
    41                 IssmDouble  GetTime(void){return time;};
     41                IssmPDouble  GetTime(void){return time;};
    4242                int     GetStep(void){return step;};
    4343                void    ProcessUnits(Parameters* parameters);
  • issm/trunk-jpl/src/c/objects/ElementResults/TriaP1ElementResult.cpp

    r12511 r12560  
    2828
    2929        enum_type=in_enum_type;
    30         values[0]=in_values[0];
    31         values[1]=in_values[1];
    32         values[2]=in_values[2];
     30        values[0]=reCast<IssmPDouble>(in_values[0]);
     31        values[1]=reCast<IssmPDouble>(in_values[1]);
     32        values[2]=reCast<IssmPDouble>(in_values[2]);
    3333        step=in_step;
    34         time=in_time;
     34        time=reCast<IssmPDouble>(in_time);
    3535}
    3636/*}}}*/
     
    128128void TriaP1ElementResult::GetVectorFromResults(Vector* vector,int* doflist,int* connectivitylist,int numdofs){
    129129
    130         IssmDouble data[3];
     130        IssmPDouble data[3];
    131131
    132132        if(numdofs!=3)_error2_("Result " << EnumToStringx(this->enum_type) << " is a TriaP1ElementResult and cannot write vector of " << numdofs << " dofs");
    133         for(int i=0;i<3;i++) data[i]=this->values[i]/(IssmDouble)connectivitylist[i];
     133        for(int i=0;i<3;i++) data[i]=this->values[i]/(IssmPDouble)connectivitylist[i];
    134134        vector->SetValues(numdofs,doflist,&data[0],ADD_VAL);
    135135
  • issm/trunk-jpl/src/c/objects/ElementResults/TriaP1ElementResult.h

    r12463 r12560  
    1717        private:
    1818                int    enum_type;
    19                 IssmDouble values[3];
     19                IssmPDouble values[3];
    2020                int    step;
    21                 IssmDouble time;
     21                IssmPDouble time;
    2222
    2323        public:
     
    3838                /*ElementResult virtual functions definitions: {{{*/
    3939                ElementResult* SpawnTriaElementResult(int* indices);
    40                 IssmDouble  GetTime(void){return time;};
     40                IssmPDouble  GetTime(void){return time;};
    4141                int     GetStep(void){return step;};
    4242                void    ProcessUnits(Parameters* parameters);
Note: See TracChangeset for help on using the changeset viewer.