Changeset 21074


Ignore:
Timestamp:
08/04/16 09:33:28 (9 years ago)
Author:
Mathieu Morlighem
Message:

BUG: mass transport was not working properly for flowband models

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

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/c/analyses/DepthAverageAnalysis.cpp

    r20690 r21074  
    113113        /*Retrieve all inputs and parameters*/
    114114        element->GetVerticesCoordinates(&xyz_list);
    115         element->FindParam(&input_enum,InputToDepthaverageEnum);
     115        element->FindParam(&input_enum,InputToDepthaverageInEnum);
    116116        Input* input = element->GetInput(input_enum); _assert_(input);
    117117
     
    166166
    167167        int inputenum;
    168         element->FindParam(&inputenum,InputToDepthaverageEnum);
     168        element->FindParam(&inputenum,InputToDepthaverageOutEnum);
    169169        element->InputUpdateFromSolutionOneDof(solution,inputenum);
    170170}/*}}}*/
  • issm/trunk-jpl/src/c/analyses/MasstransportAnalysis.cpp

    r20690 r21074  
    275275        else{
    276276                if(dim==1){
    277                         vxaverage_input=element->GetInput(VxEnum); _assert_(vxaverage_input);
     277                        vxaverage_input=element->GetInput(VxAverageEnum); _assert_(vxaverage_input);
    278278                }
    279279                if(dim==2){
  • issm/trunk-jpl/src/c/cores/masstransport_core.cpp

    r19527 r21074  
    4949        else{
    5050                if(VerboseSolution()) _printf0_("   call computational core\n");
     51                femmodel->parameters->SetParam(VxEnum,InputToDepthaverageInEnum);
     52                femmodel->parameters->SetParam(VxAverageEnum,InputToDepthaverageOutEnum);
     53                depthaverage_core(femmodel);
     54                if(domaintype!=Domain2DverticalEnum){
     55                        femmodel->parameters->SetParam(VyEnum,InputToDepthaverageInEnum);
     56                        femmodel->parameters->SetParam(VyAverageEnum,InputToDepthaverageOutEnum);
     57                        depthaverage_core(femmodel);
     58                }
    5159                if(stabilization==4){
    5260                        solutionsequence_fct(femmodel);
  • issm/trunk-jpl/src/c/shared/Enum/EnumDefinitions.h

    r20999 r21074  
    604604        InputToExtrudeEnum,
    605605        InputToL2ProjectEnum,
    606         InputToDepthaverageEnum,
     606        InputToDepthaverageInEnum,
     607        InputToDepthaverageOutEnum,
    607608        InputToSmoothEnum,
    608609        SmoothThicknessMultiplierEnum,
  • issm/trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp

    r20999 r21074  
    594594                case InputToExtrudeEnum : return "InputToExtrude";
    595595                case InputToL2ProjectEnum : return "InputToL2Project";
    596                 case InputToDepthaverageEnum : return "InputToDepthaverage";
     596                case InputToDepthaverageInEnum : return "InputToDepthaverageIn";
     597                case InputToDepthaverageOutEnum : return "InputToDepthaverageOut";
    597598                case InputToSmoothEnum : return "InputToSmooth";
    598599                case SmoothThicknessMultiplierEnum : return "SmoothThicknessMultiplier";
  • issm/trunk-jpl/src/c/shared/Enum/README

    r14960 r21074  
    33- StringToEnumx.cpp
    44- EnumToStringx.cpp
    5 - src/m/enum/*
    65all these files are automatically synchronized with EnumDefinitions.h
    76
  • issm/trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp

    r20999 r21074  
    606606              else if (strcmp(name,"InputToExtrude")==0) return InputToExtrudeEnum;
    607607              else if (strcmp(name,"InputToL2Project")==0) return InputToL2ProjectEnum;
    608               else if (strcmp(name,"InputToDepthaverage")==0) return InputToDepthaverageEnum;
     608              else if (strcmp(name,"InputToDepthaverageIn")==0) return InputToDepthaverageInEnum;
     609              else if (strcmp(name,"InputToDepthaverageOut")==0) return InputToDepthaverageOutEnum;
    609610              else if (strcmp(name,"InputToSmooth")==0) return InputToSmoothEnum;
    610611              else if (strcmp(name,"SmoothThicknessMultiplier")==0) return SmoothThicknessMultiplierEnum;
     
    628629              else if (strcmp(name,"Masscon")==0) return MassconEnum;
    629630              else if (strcmp(name,"MassconName")==0) return MassconNameEnum;
    630               else if (strcmp(name,"MassconDefinitionenum")==0) return MassconDefinitionenumEnum;
    631631         else stage=6;
    632632   }
    633633   if(stage==6){
    634               if (strcmp(name,"MassconLevelset")==0) return MassconLevelsetEnum;
     634              if (strcmp(name,"MassconDefinitionenum")==0) return MassconDefinitionenumEnum;
     635              else if (strcmp(name,"MassconLevelset")==0) return MassconLevelsetEnum;
    635636              else if (strcmp(name,"Massconaxpby")==0) return MassconaxpbyEnum;
    636637              else if (strcmp(name,"MassconaxpbyName")==0) return MassconaxpbyNameEnum;
     
    751752              else if (strcmp(name,"DeviatoricStressxy")==0) return DeviatoricStressxyEnum;
    752753              else if (strcmp(name,"DeviatoricStressxz")==0) return DeviatoricStressxzEnum;
    753               else if (strcmp(name,"DeviatoricStressyy")==0) return DeviatoricStressyyEnum;
    754754         else stage=7;
    755755   }
    756756   if(stage==7){
    757               if (strcmp(name,"DeviatoricStressyz")==0) return DeviatoricStressyzEnum;
     757              if (strcmp(name,"DeviatoricStressyy")==0) return DeviatoricStressyyEnum;
     758              else if (strcmp(name,"DeviatoricStressyz")==0) return DeviatoricStressyzEnum;
    758759              else if (strcmp(name,"DeviatoricStresszz")==0) return DeviatoricStresszzEnum;
    759760              else if (strcmp(name,"DeviatoricStresseffective")==0) return DeviatoricStresseffectiveEnum;
     
    874875              else if (strcmp(name,"Outputdefinition68")==0) return Outputdefinition68Enum;
    875876              else if (strcmp(name,"Outputdefinition69")==0) return Outputdefinition69Enum;
    876               else if (strcmp(name,"Outputdefinition70")==0) return Outputdefinition70Enum;
    877877         else stage=8;
    878878   }
    879879   if(stage==8){
    880               if (strcmp(name,"Outputdefinition71")==0) return Outputdefinition71Enum;
     880              if (strcmp(name,"Outputdefinition70")==0) return Outputdefinition70Enum;
     881              else if (strcmp(name,"Outputdefinition71")==0) return Outputdefinition71Enum;
    881882              else if (strcmp(name,"Outputdefinition72")==0) return Outputdefinition72Enum;
    882883              else if (strcmp(name,"Outputdefinition73")==0) return Outputdefinition73Enum;
     
    997998              else if (strcmp(name,"RestartFileName")==0) return RestartFileNameEnum;
    998999              else if (strcmp(name,"ToolkitsOptionsAnalyses")==0) return ToolkitsOptionsAnalysesEnum;
    999               else if (strcmp(name,"ToolkitsOptionsStrings")==0) return ToolkitsOptionsStringsEnum;
    10001000         else stage=9;
    10011001   }
    10021002   if(stage==9){
    1003               if (strcmp(name,"QmuErrName")==0) return QmuErrNameEnum;
     1003              if (strcmp(name,"ToolkitsOptionsStrings")==0) return ToolkitsOptionsStringsEnum;
     1004              else if (strcmp(name,"QmuErrName")==0) return QmuErrNameEnum;
    10041005              else if (strcmp(name,"QmuInName")==0) return QmuInNameEnum;
    10051006              else if (strcmp(name,"QmuOutName")==0) return QmuOutNameEnum;
  • issm/trunk-jpl/src/c/shared/Enum/Synchronize.sh

    r19804 r21074  
    66
    77#Removed existing files
    8 rm $ISSM_DIR/src/m/enum/*.m
    9 rm $ISSM_DIR/src/m/enum/*.py
    10 rm $ISSM_DIR/src/m/enum/*.js
    118rm $ISSM_DIR/src/c/shared/Enum/EnumToStringx.cpp
    129rm $ISSM_DIR/src/c/shared/Enum/StringToEnumx.cpp
     
    181178#}}}
    182179
    183 #Deal with Python Enums
    184 #Build EnumDefinitions.py{{{
    185 cat <<END > $ISSM_DIR/src/m/enum/EnumDefinitions.py
    186 from StringToEnum import StringToEnum
    187 
    188 """
    189 
    190 WARNING: DO NOT MODIFY THIS FILE
    191 this file has been automatically generated by src/c/shared/Enum/Synchronize.sh
    192 Please read src/c/shared/Enum/README for more information
    193 
    194 """
    195 
    196 END
    197 #core
    198 cat temp |  awk '{print "def " $1"(): return StringToEnum(\"" substr($1,1,length($1)-4) "\")[0]"}' >> $ISSM_DIR/src/m/enum/EnumDefinitions.py
    199 #}}}
    200 
    201 #Deal with Javascript Enums
    202 #Build EnumDefinitions.js{{{
    203 cat <<END > $ISSM_DIR/src/m/enum/EnumDefinitions.js
    204 //WARNING: DO NOT MODIFY THIS FILE
    205 //this file has been automatically generated by src/c/shared/Enum/Synchronize.sh
    206 //Please read src/c/shared/Enum/README for more information
    207 END
    208 #core
    209 ENUM=0;
    210 for NAMEENUM in $(cat temp); do
    211         #Get name and enum of the line i
    212         NAME=$(echo $NAMEENUM | sed -e "s/Enum//g")
    213         echo "function ${NAME}Enum(){ return $ENUM;}" >> $ISSM_DIR/src/m/enum/EnumDefinitions.js
    214         #offset Enum by one (Enum begins with 0 and not 1!)
    215         let ENUM=$ENUM+1
    216 done
    217 #}}}
    218 
    219 #Deal with Matlab Enums`
    220 ENUM=0;
    221 
    222 for NAMEENUM in $(cat temp); do
    223 
    224         #Get name and enum of the line i
    225         NAME=$(echo $NAMEENUM | sed -e "s/Enum//g")
    226         #offset Enum by one (Enum begins with 0 and not 1!)
    227         let ENUM=$ENUM+1
    228 
    229         #print info {{{
    230         if [ $ENUM -lt 10 ]
    231         then
    232                 printf "\r                                                                      "
    233                 printf "\r  $ENUM/$NUMENUMS Adding "$NAME"..."
    234         else
    235                 if [ $ENUM -lt 100 ]
    236                 then
    237                         printf "\r                                                                      "
    238                         printf "\r $ENUM/$NUMENUMS Adding "$NAME"..."
    239                 else
    240                         printf "\r                                                                      "
    241                         printf "\r$ENUM/$NUMENUMS Adding "$NAME"..."
    242                 fi
    243         fi
    244         #}}}
    245         #Add case to matlabenum file{{{
    246         cat <<END > $ISSM_DIR"/src/m/enum/"$(echo $NAMEENUM".m")
    247 function macro=$(echo $NAMEENUM)()
    248 %$(echo $NAMEENUM | awk {'print toupper($1)'}) - Enum of $(echo $NAME)
    249 %
    250 %   WARNING: DO NOT MODIFY THIS FILE
    251 %            this file has been automatically generated by src/c/shared/Enum/Synchronize.sh
    252 %            Please read src/c/shared/Enum/README for more information
    253 %
    254 %   Usage:
    255 %      macro=$NAMEENUM()
    256 
    257 macro=StringToEnum('$NAME');
    258 END
    259 #}}}
    260 
    261 done
    262180#clean up{{{
    263181rm temp
Note: See TracChangeset for help on using the changeset viewer.