Changeset 25609


Ignore:
Timestamp:
09/29/20 10:35:39 (5 years ago)
Author:
Mathieu Morlighem
Message:

CHG: preparing ground to new MLHO model

Location:
issm/trunk-jpl/src
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/c/shared/Enum/Enum.vim

    r25557 r25609  
    146146syn keyword cConstant FlowequationIsHOEnum
    147147syn keyword cConstant FlowequationIsL1L2Enum
     148syn keyword cConstant FlowequationIsMLHOEnum
    148149syn keyword cConstant FlowequationIsSIAEnum
    149150syn keyword cConstant FlowequationIsSSAEnum
     
    11331134syn keyword cConstant JEnum
    11341135syn keyword cConstant L1L2ApproximationEnum
     1136syn keyword cConstant MLHOApproximationEnum
    11351137syn keyword cConstant L2ProjectionBaseAnalysisEnum
    11361138syn keyword cConstant L2ProjectionEPLAnalysisEnum
  • issm/trunk-jpl/src/c/shared/Enum/EnumDefinitions.h

    r25522 r25609  
    140140        FlowequationIsHOEnum,
    141141        FlowequationIsL1L2Enum,
     142        FlowequationIsMLHOEnum,
    142143        FlowequationIsSIAEnum,
    143144        FlowequationIsSSAEnum,
     
    11321133        JEnum,
    11331134        L1L2ApproximationEnum,
     1135        MLHOApproximationEnum,
    11341136        L2ProjectionBaseAnalysisEnum,
    11351137        L2ProjectionEPLAnalysisEnum,
  • issm/trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp

    r25522 r25609  
    148148                case FlowequationIsHOEnum : return "FlowequationIsHO";
    149149                case FlowequationIsL1L2Enum : return "FlowequationIsL1L2";
     150                case FlowequationIsMLHOEnum : return "FlowequationIsMLHO";
    150151                case FlowequationIsSIAEnum : return "FlowequationIsSIA";
    151152                case FlowequationIsSSAEnum : return "FlowequationIsSSA";
     
    11351136                case JEnum : return "J";
    11361137                case L1L2ApproximationEnum : return "L1L2Approximation";
     1138                case MLHOApproximationEnum : return "MLHOApproximation";
    11371139                case L2ProjectionBaseAnalysisEnum : return "L2ProjectionBaseAnalysis";
    11381140                case L2ProjectionEPLAnalysisEnum : return "L2ProjectionEPLAnalysis";
  • issm/trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp

    r25522 r25609  
    151151              else if (strcmp(name,"FlowequationIsHO")==0) return FlowequationIsHOEnum;
    152152              else if (strcmp(name,"FlowequationIsL1L2")==0) return FlowequationIsL1L2Enum;
     153              else if (strcmp(name,"FlowequationIsMLHO")==0) return FlowequationIsMLHOEnum;
    153154              else if (strcmp(name,"FlowequationIsSIA")==0) return FlowequationIsSIAEnum;
    154155              else if (strcmp(name,"FlowequationIsSSA")==0) return FlowequationIsSSAEnum;
     
    259260              else if (strcmp(name,"MasstransportMinThickness")==0) return MasstransportMinThicknessEnum;
    260261              else if (strcmp(name,"MasstransportNumRequestedOutputs")==0) return MasstransportNumRequestedOutputsEnum;
    261               else if (strcmp(name,"MasstransportPenaltyFactor")==0) return MasstransportPenaltyFactorEnum;
    262262         else stage=3;
    263263   }
    264264   if(stage==3){
    265               if (strcmp(name,"MasstransportRequestedOutputs")==0) return MasstransportRequestedOutputsEnum;
     265              if (strcmp(name,"MasstransportPenaltyFactor")==0) return MasstransportPenaltyFactorEnum;
     266              else if (strcmp(name,"MasstransportRequestedOutputs")==0) return MasstransportRequestedOutputsEnum;
    266267              else if (strcmp(name,"MasstransportStabilization")==0) return MasstransportStabilizationEnum;
    267268              else if (strcmp(name,"MaterialsBeta")==0) return MaterialsBetaEnum;
     
    382383              else if (strcmp(name,"SmbIsd18opd")==0) return SmbIsd18opdEnum;
    383384              else if (strcmp(name,"SmbIsdelta18o")==0) return SmbIsdelta18oEnum;
    384               else if (strcmp(name,"SmbIsdensification")==0) return SmbIsdensificationEnum;
    385385         else stage=4;
    386386   }
    387387   if(stage==4){
    388               if (strcmp(name,"SmbIsfirnwarming")==0) return SmbIsfirnwarmingEnum;
     388              if (strcmp(name,"SmbIsdensification")==0) return SmbIsdensificationEnum;
     389              else if (strcmp(name,"SmbIsfirnwarming")==0) return SmbIsfirnwarmingEnum;
    389390              else if (strcmp(name,"SmbIsgraingrowth")==0) return SmbIsgraingrowthEnum;
    390391              else if (strcmp(name,"SmbIsmelt")==0) return SmbIsmeltEnum;
     
    505506              else if (strcmp(name,"BasalforcingsPicoBasinId")==0) return BasalforcingsPicoBasinIdEnum;
    506507              else if (strcmp(name,"BasalforcingsPicoBoxId")==0) return BasalforcingsPicoBoxIdEnum;
    507               else if (strcmp(name,"BasalforcingsPicoOverturningCoeff")==0) return BasalforcingsPicoOverturningCoeffEnum;
    508508         else stage=5;
    509509   }
    510510   if(stage==5){
    511               if (strcmp(name,"BasalforcingsPicoSubShelfOceanOverturning")==0) return BasalforcingsPicoSubShelfOceanOverturningEnum;
     511              if (strcmp(name,"BasalforcingsPicoOverturningCoeff")==0) return BasalforcingsPicoOverturningCoeffEnum;
     512              else if (strcmp(name,"BasalforcingsPicoSubShelfOceanOverturning")==0) return BasalforcingsPicoSubShelfOceanOverturningEnum;
    512513              else if (strcmp(name,"BasalforcingsPicoSubShelfOceanSalinity")==0) return BasalforcingsPicoSubShelfOceanSalinityEnum;
    513514              else if (strcmp(name,"BasalforcingsPicoSubShelfOceanTemp")==0) return BasalforcingsPicoSubShelfOceanTempEnum;
     
    628629              else if (strcmp(name,"HydrologydcEplThicknessTransient")==0) return HydrologydcEplThicknessTransientEnum;
    629630              else if (strcmp(name,"HydrologydcMaskEplactiveElt")==0) return HydrologydcMaskEplactiveEltEnum;
    630               else if (strcmp(name,"HydrologydcMaskEplactiveNode")==0) return HydrologydcMaskEplactiveNodeEnum;
    631631         else stage=6;
    632632   }
    633633   if(stage==6){
    634               if (strcmp(name,"HydrologydcMaskThawedElt")==0) return HydrologydcMaskThawedEltEnum;
     634              if (strcmp(name,"HydrologydcMaskEplactiveNode")==0) return HydrologydcMaskEplactiveNodeEnum;
     635              else if (strcmp(name,"HydrologydcMaskThawedElt")==0) return HydrologydcMaskThawedEltEnum;
    635636              else if (strcmp(name,"HydrologydcMaskThawedNode")==0) return HydrologydcMaskThawedNodeEnum;
    636637              else if (strcmp(name,"HydrologydcSedimentTransmitivity")==0) return HydrologydcSedimentTransmitivityEnum;
     
    751752              else if (strcmp(name,"SmbDlwrf")==0) return SmbDlwrfEnum;
    752753              else if (strcmp(name,"SmbDswrf")==0) return SmbDswrfEnum;
    753               else if (strcmp(name,"SmbDzAdd")==0) return SmbDzAddEnum;
    754754         else stage=7;
    755755   }
    756756   if(stage==7){
    757               if (strcmp(name,"SmbDz")==0) return SmbDzEnum;
     757              if (strcmp(name,"SmbDzAdd")==0) return SmbDzAddEnum;
     758              else if (strcmp(name,"SmbDz")==0) return SmbDzEnum;
    758759              else if (strcmp(name,"SmbDzMin")==0) return SmbDzMinEnum;
    759760              else if (strcmp(name,"SmbDzTop")==0) return SmbDzTopEnum;
     
    874875              else if (strcmp(name,"Vx")==0) return VxEnum;
    875876              else if (strcmp(name,"VxMesh")==0) return VxMeshEnum;
    876               else if (strcmp(name,"VxObs")==0) return VxObsEnum;
    877877         else stage=8;
    878878   }
    879879   if(stage==8){
    880               if (strcmp(name,"VyAverage")==0) return VyAverageEnum;
     880              if (strcmp(name,"VxObs")==0) return VxObsEnum;
     881              else if (strcmp(name,"VyAverage")==0) return VyAverageEnum;
    881882              else if (strcmp(name,"Vy")==0) return VyEnum;
    882883              else if (strcmp(name,"VyMesh")==0) return VyMeshEnum;
     
    997998              else if (strcmp(name,"Absolute")==0) return AbsoluteEnum;
    998999              else if (strcmp(name,"AdaptiveTimestepping")==0) return AdaptiveTimesteppingEnum;
    999               else if (strcmp(name,"AdjointBalancethickness2Analysis")==0) return AdjointBalancethickness2AnalysisEnum;
    10001000         else stage=9;
    10011001   }
    10021002   if(stage==9){
    1003               if (strcmp(name,"AdjointBalancethicknessAnalysis")==0) return AdjointBalancethicknessAnalysisEnum;
     1003              if (strcmp(name,"AdjointBalancethickness2Analysis")==0) return AdjointBalancethickness2AnalysisEnum;
     1004              else if (strcmp(name,"AdjointBalancethicknessAnalysis")==0) return AdjointBalancethicknessAnalysisEnum;
    10041005              else if (strcmp(name,"AdjointHorizAnalysis")==0) return AdjointHorizAnalysisEnum;
    10051006              else if (strcmp(name,"AggressiveMigration")==0) return AggressiveMigrationEnum;
     
    11201121              else if (strcmp(name,"GroundingOnly")==0) return GroundingOnlyEnum;
    11211122              else if (strcmp(name,"GroundinglineMassFlux")==0) return GroundinglineMassFluxEnum;
    1122               else if (strcmp(name,"Gset")==0) return GsetEnum;
    11231123         else stage=10;
    11241124   }
    11251125   if(stage==10){
    1126               if (strcmp(name,"Gsl")==0) return GslEnum;
     1126              if (strcmp(name,"Gset")==0) return GsetEnum;
     1127              else if (strcmp(name,"Gsl")==0) return GslEnum;
    11271128              else if (strcmp(name,"HOApproximation")==0) return HOApproximationEnum;
    11281129              else if (strcmp(name,"HOFSApproximation")==0) return HOFSApproximationEnum;
     
    11621163              else if (strcmp(name,"J")==0) return JEnum;
    11631164              else if (strcmp(name,"L1L2Approximation")==0) return L1L2ApproximationEnum;
     1165              else if (strcmp(name,"MLHOApproximation")==0) return MLHOApproximationEnum;
    11641166              else if (strcmp(name,"L2ProjectionBaseAnalysis")==0) return L2ProjectionBaseAnalysisEnum;
    11651167              else if (strcmp(name,"L2ProjectionEPLAnalysis")==0) return L2ProjectionEPLAnalysisEnum;
     
    12421244              else if (strcmp(name,"P0DG")==0) return P0DGEnum;
    12431245              else if (strcmp(name,"P1DG")==0) return P1DGEnum;
    1244               else if (strcmp(name,"P1P1")==0) return P1P1Enum;
    1245               else if (strcmp(name,"P1P1GLS")==0) return P1P1GLSEnum;
    12461246         else stage=11;
    12471247   }
    12481248   if(stage==11){
    1249               if (strcmp(name,"P1bubble")==0) return P1bubbleEnum;
     1249              if (strcmp(name,"P1P1")==0) return P1P1Enum;
     1250              else if (strcmp(name,"P1P1GLS")==0) return P1P1GLSEnum;
     1251              else if (strcmp(name,"P1bubble")==0) return P1bubbleEnum;
    12501252              else if (strcmp(name,"P1bubblecondensed")==0) return P1bubblecondensedEnum;
    12511253              else if (strcmp(name,"P1xP2")==0) return P1xP2Enum;
     
    13651367              else if (strcmp(name,"CalvingdevCoeff")==0) return CalvingdevCoeffEnum;
    13661368              else if (strcmp(name,"DeviatoricStress")==0) return DeviatoricStressEnum;
    1367               else if (strcmp(name,"EtaAbsGradient")==0) return EtaAbsGradientEnum;
    1368               else if (strcmp(name,"MeshZ")==0) return MeshZEnum;
    13691369         else stage=12;
    13701370   }
    13711371   if(stage==12){
    1372               if (strcmp(name,"NearestInterp")==0) return NearestInterpEnum;
     1372              if (strcmp(name,"EtaAbsGradient")==0) return EtaAbsGradientEnum;
     1373              else if (strcmp(name,"MeshZ")==0) return MeshZEnum;
     1374              else if (strcmp(name,"NearestInterp")==0) return NearestInterpEnum;
    13731375              else if (strcmp(name,"OutputdefinitionList")==0) return OutputdefinitionListEnum;
    13741376              else if (strcmp(name,"SealevelObs")==0) return SealevelObsEnum;
  • issm/trunk-jpl/src/c/shared/io/Marshalling/IoCodeConversions.cpp

    r25562 r25609  
    311311                case 2: return SSAApproximationEnum;
    312312                case 3: return L1L2ApproximationEnum;
    313                 case 4: return HOApproximationEnum;
    314                 case 5: return FSApproximationEnum;
    315                 case 6: return SSAHOApproximationEnum;
    316                 case 7: return HOFSApproximationEnum;
    317                 case 8: return SSAFSApproximationEnum;
     313                case 4: return MLHOApproximationEnum;
     314                case 5: return HOApproximationEnum;
     315                case 6: return FSApproximationEnum;
     316                case 7: return SSAHOApproximationEnum;
     317                case 8: return HOFSApproximationEnum;
     318                case 9: return SSAFSApproximationEnum;
    318319                default: _error_("Marshalled vertex equation code \""<<enum_in<<"\" not supported yet.");
    319320        }
     
    325326                case 2: return SSAApproximationEnum;
    326327                case 3: return L1L2ApproximationEnum;
    327                 case 4: return HOApproximationEnum;
    328                 case 5: return FSApproximationEnum;
    329                 case 6: return SSAHOApproximationEnum;
    330                 case 7: return SSAFSApproximationEnum;
    331                 case 8: return HOFSApproximationEnum;
     328                case 4: return MLHOApproximationEnum;
     329                case 5: return HOApproximationEnum;
     330                case 6: return FSApproximationEnum;
     331                case 7: return SSAHOApproximationEnum;
     332                case 8: return SSAFSApproximationEnum;
     333                case 9: return HOFSApproximationEnum;
    332334                default: _error_("Marshalled element equation code \""<<enum_in<<"\" not supported yet.");
    333335        }
  • issm/trunk-jpl/src/m/classes/flowequation.js

    r24866 r25609  
    2222                fielddisplay(this,'isSSA','is the Shelfy-Stream Approximation (SSA) used ?');
    2323                fielddisplay(this,'isL1L2','is the L1L2 approximation used ?');
     24                fielddisplay(this,'isMLHO','is the MLHO approximation used ?');
    2425                fielddisplay(this,'isHO','is the Higher-Order (HO) approximation used ?');
    2526                fielddisplay(this,'isFS','are the Full-FS (FS) equations used ?');
     
    5657                        checkfield(md,'fieldname','flowequation.isSSA','numel',[1],'values',[0, 1]);
    5758                        checkfield(md,'fieldname','flowequation.isL1L2','numel',[1],'values',[0, 1]);
     59                        checkfield(md,'fieldname','flowequation.isMLHO','numel',[1],'values',[0, 1]);
    5860                        checkfield(md,'fieldname','flowequation.isHO','numel',[1],'values',[0, 1]);
    5961                        checkfield(md,'fieldname','flowequation.isFS','numel',[1],'values',[0, 1]);
     
    8284                        }
    8385                        else if (md.mesh.domaintype() =='3D'){
    84                                 checkfield(md,'fieldname','flowequation.vertex_equation','size',[md.mesh.numberofvertices, 1],'values',[0,1,2,3,4,5,6,7,8]);
    85                                 checkfield(md,'fieldname','flowequation.element_equation','size',[md.mesh.numberofelements, 1],'values',[0,1,2,3,4,5,6,7,8]);
     86                                checkfield(md,'fieldname','flowequation.vertex_equation','size',[md.mesh.numberofvertices, 1],'values',[0,1,2,3,4,5,6,7,8,9]);
     87                                checkfield(md,'fieldname','flowequation.element_equation','size',[md.mesh.numberofelements, 1],'values',[0,1,2,3,4,5,6,7,8,9]);
    8688                        }
    8789                        else throw Error('Case not supported yet');
    8890                       
    89                         if (!(this.isSIA | this.isSSA | this.isL1L2 | this.isHO | this.isFS)){
     91                        if (!(this.isSIA | this.isSSA | this.isL1L2 | this.isMLHO | this.isHO | this.isFS)){
    9092                                md = checkmessage(md,['no element types set for this model']);
    9193                        }
     
    102104                        WriteData(fid,prefix,'object',this,'fieldname','isSSA','format','Boolean');
    103105                        WriteData(fid,prefix,'object',this,'fieldname','isL1L2','format','Boolean');
     106                        WriteData(fid,prefix,'object',this,'fieldname','isMLHO','format','Boolean');
    104107                        WriteData(fid,prefix,'object',this,'fieldname','isHO','format','Boolean');
    105108                        WriteData(fid,prefix,'object',this,'fieldname','isFS','format','Boolean');
     
    129132        this.isSSA                          = 0;
    130133        this.isL1L2                         = 0;
     134        this.isMLHO                         = 0;
    131135        this.isHO                           = 0;
    132136        this.isFS                           = 0;
  • issm/trunk-jpl/src/m/classes/flowequation.m

    r25519 r25609  
    99                isSSA                          = 0;
    1010                isL1L2                         = 0;
     11                isMLHO                         = 0;
    1112                isHO                           = 0;
    1213                isFS                           = 0;
     
    9899                        md = checkfield(md,'fieldname','flowequation.isSSA','numel',[1],'values',[0 1]);
    99100                        md = checkfield(md,'fieldname','flowequation.isL1L2','numel',[1],'values',[0 1]);
     101                        md = checkfield(md,'fieldname','flowequation.isMLHO','numel',[1],'values',[0 1]);
    100102                        md = checkfield(md,'fieldname','flowequation.isHO','numel',[1],'values',[0 1]);
    101103                        md = checkfield(md,'fieldname','flowequation.isFS','numel',[1],'values',[0 1]);
     
    123125                                md = checkfield(md,'fieldname','flowequation.element_equation','size',[md.mesh.numberofelements 1],'values',[2,4,5]);
    124126                        elseif strcmp(domaintype(md.mesh),'3D'),
    125                                 md = checkfield(md,'fieldname','flowequation.vertex_equation','size',[md.mesh.numberofvertices 1],'values',[0:8]);
    126                                 md = checkfield(md,'fieldname','flowequation.element_equation','size',[md.mesh.numberofelements 1],'values',[0:8]);
     127                                md = checkfield(md,'fieldname','flowequation.vertex_equation','size',[md.mesh.numberofvertices 1],'values',[0:9]);
     128                                md = checkfield(md,'fieldname','flowequation.element_equation','size',[md.mesh.numberofelements 1],'values',[0:9]);
    127129                        else
    128130                                error('Case not supported yet');
    129131                        end
    130                         if ~(self.isSIA || self.isSSA || self.isL1L2 || self.isHO || self.isFS),
     132                        if ~(self.isSIA || self.isSSA || self.isL1L2 || self.isMLHO || self.isHO || self.isFS),
    131133                                md = checkmessage(md,['no element types set for this model']);
    132134                        end
     
    146148                        fielddisplay(self,'isSSA','is the Shelfy-Stream Approximation (SSA) used?');
    147149                        fielddisplay(self,'isL1L2','is the L1L2 approximation used?');
     150                        fielddisplay(self,'isMLHO','is the Mono-Layer Higher-Order approximation used?');
    148151                        fielddisplay(self,'isHO','is the Higher-Order (HO) approximation used?');
    149152                        fielddisplay(self,'isFS','are the Full-FS (FS) equations used?');
     
    164167                        WriteData(fid,prefix,'object',self,'fieldname','isSSA','format','Boolean');
    165168                        WriteData(fid,prefix,'object',self,'fieldname','isL1L2','format','Boolean');
     169                        WriteData(fid,prefix,'object',self,'fieldname','isMLHO','format','Boolean');
    166170                        WriteData(fid,prefix,'object',self,'fieldname','isHO','format','Boolean');
    167171                        WriteData(fid,prefix,'object',self,'fieldname','isFS','format','Boolean');
     
    188192                        writejsdouble(fid,[modelname '.flowequation.isSSA'],self.isSSA);
    189193                        writejsdouble(fid,[modelname '.flowequation.isL1L2'],self.isL1L2);
     194                        writejsdouble(fid,[modelname '.flowequation.isMLHO'],self.isMLHO);
    190195                        writejsdouble(fid,[modelname '.flowequation.isHO'],self.isHO);
    191196                        writejsdouble(fid,[modelname '.flowequation.isFS'],self.isFS);
  • issm/trunk-jpl/src/m/classes/flowequation.py

    r25521 r25609  
    1919        self.isSSA = 0
    2020        self.isL1L2 = 0
     21        self.isMLHO = 0
    2122        self.isHO = 0
    2223        self.isFS = 0
     
    4748        s += "{}\n".format(fielddisplay(self, 'isSSA', "is the Shelfy-Stream Approximation (SSA) used?"))
    4849        s += "{}\n".format(fielddisplay(self, 'isL1L2', "are L1L2 equations used?"))
     50        s += "{}\n".format(fielddisplay(self, 'isMLHO', "are Mono-layer Higher-Order equations used?"))
    4951        s += "{}\n".format(fielddisplay(self, 'isHO', "is the Higher-Order (HO) approximation used?"))
    5052        s += "{}\n".format(fielddisplay(self, 'isFS', "are the Full-FS (FS) equations used?"))
     
    9496        md = checkfield(md, 'fieldname', 'flowequation.isSSA', 'numel', [1], 'values', [0, 1])
    9597        md = checkfield(md, 'fieldname', 'flowequation.isL1L2', 'numel', [1], 'values', [0, 1])
     98        md = checkfield(md, 'fieldname', 'flowequation.isMLHO', 'numel', [1], 'values', [0, 1])
    9699        md = checkfield(md, 'fieldname', 'flowequation.isHO', 'numel', [1], 'values', [0, 1])
    97100        md = checkfield(md, 'fieldname', 'flowequation.isFS', 'numel', [1], 'values', [0, 1])
     
    116119            md = checkfield(md, 'fieldname', 'flowequation.element_equation', 'size', [md.mesh.numberofelements], 'values', [2, 4, 5])
    117120        elif m.strcmp(md.mesh.domaintype(), '3D'):
    118             md = checkfield(md, 'fieldname', 'flowequation.vertex_equation', 'size', [md.mesh.numberofvertices], 'values', np.arange(0, 8 + 1))
    119             md = checkfield(md, 'fieldname', 'flowequation.element_equation', 'size', [md.mesh.numberofelements], 'values', np.arange(0, 8 + 1))
     121            md = checkfield(md, 'fieldname', 'flowequation.vertex_equation', 'size', [md.mesh.numberofvertices], 'values', np.arange(0, 9 + 1))
     122            md = checkfield(md, 'fieldname', 'flowequation.element_equation', 'size', [md.mesh.numberofelements], 'values', np.arange(0, 9 + 1))
    120123        else:
    121124            raise RuntimeError('mesh type not supported yet')
    122         if not (self.isSIA or self.isSSA or self.isL1L2 or self.isHO or self.isFS):
     125        if not (self.isSIA or self.isSSA or self.isL1L2 or self.isMLHO or self.isHO or self.isFS):
    123126            md.checkmessage("no element types set for this model")
    124127
     
    135138        WriteData(fid, prefix, 'object', self, 'fieldname', 'isSSA', 'format', 'Boolean')
    136139        WriteData(fid, prefix, 'object', self, 'fieldname', 'isL1L2', 'format', 'Boolean')
     140        WriteData(fid, prefix, 'object', self, 'fieldname', 'isMLHO', 'format', 'Boolean')
    137141        WriteData(fid, prefix, 'object', self, 'fieldname', 'isHO', 'format', 'Boolean')
    138142        WriteData(fid, prefix, 'object', self, 'fieldname', 'isFS', 'format', 'Boolean')
  • issm/trunk-jpl/src/m/parameterization/setflowequation.js

    r19768 r25609  
    33//
    44//   This routine works like plotmodel: it works with an even number of inputs
    5 //   'SIA','SSA','L1L2','HO','FS' and 'fill' are the possible options
     5//   'SIA','SSA','L1L2','MLHO','HO','FS' and 'fill' are the possible options
    66//   that must be followed by the corresponding exp file or flags list
    77//   It can either be a domain file (argus type, .exp extension), or an array of element flags.
     
    1111//   a string 'all' will be considered as the entire domain
    1212//   You can specify the type of coupling, 'penalties' or 'tiling', to use with the input 'coupling'
    13 //   NB: L1L2 cannot currently be coupled to any other ice flow model
     13//   NB: L1L2 and MLHO cannot currently be coupled to any other ice flow model
    1414//
    1515//   Usage:
     
    3838        HOflag   = FlagElements(md,options.getfieldvalue('HO',''));
    3939        L1L2flag = FlagElements(md,options.getfieldvalue('L1L2',''));
     40        MLHOflag = FlagElements(md,options.getfieldvalue('MLHO',''));
    4041        FSflag   = FlagElements(md,options.getfieldvalue('FS',''));
    4142        filltype = options.getfieldvalue('fill','none');
     
    5455
    5556        //check that each element has at least one flag
    56         for(var i=0;i<md.mesh.numberofelements;i++)if((SIAflag[i] + SSAflag[i] + HOflag[i] + L1L2flag[i] + FSflag[i])==0)
     57        for(var i=0;i<md.mesh.numberofelements;i++)if((SIAflag[i] + SSAflag[i] + HOflag[i] + L1L2flag[i] + MLHOflag[i] + FSflag[i])==0)
    5758        throw Error("elements type not assigned, supported models are 'SIA','SSA','HO' and 'FS'");
    5859
    5960        //check that each element has only one flag
    60         if (ArrayAnyAboveStrict(ArrayXPY(SIAflag,SSAflag,HOflag,L1L2flag),1)){
     61        if (ArrayAnyAboveStrict(ArrayXPY(SIAflag,SSAflag,HOflag,L1L2flag,MLHOflag),1)){
    6162                console.log('setflowequation warning message: some elements have several types, higher order type is used for them')
    6263
     
    7071        //check that L1L2 is not coupled to any other model for now
    7172        if (ArrayAnyEqual(L1L2flag,1) & ArrayAnyEqual(ArrayOr(SIAflag,SSAflag,HOflag,FSflag),1)) throw Error('L1L2 cannot be coupled to any other model');
     73        if (ArrayAnyEqual(MLHOflag,1) & ArrayAnyEqual(ArrayOr(SIAflag,SSAflag,HOflag,FSflag),1)) throw Error('MLHO cannot be coupled to any other model');
    7274
    7375        //Check that no HO or FS for 2d mesh
     
    9799        pos=ArrayFind(L1L2flag,1);
    98100        for(var i=0;i<pos.length;i++) for(var j=0;j<md.mesh.elements[0].length;j++) nodeonL1L2[md.mesh.elements[pos[i]][j]-1]=1;
     101
     102        nodeonMLHO=NewArrayFill(md.mesh.numberofvertices,0);
     103        pos=ArrayFind(MLHOflag,1);
     104        for(var i=0;i<pos.length;i++) for(var j=0;j<md.mesh.elements[0].length;j++) nodeonMLHO[md.mesh.elements[pos[i]][j]-1]=1;
    99105
    100106        nodeonFS=NewArrayFill(md.mesh.numberofvertices,0);
     
    256262        pos=ArrayFind(SSAflag,1);for(var i=0;i<pos.length;i++)md.flowequation.element_equation[pos[i]]=2;
    257263        pos=ArrayFind(L1L2flag,1);for(var i=0;i<pos.length;i++)md.flowequation.element_equation[pos[i]]=3;
    258         pos=ArrayFind(HOflag,1);for(var i=0;i<pos.length;i++)md.flowequation.element_equation[pos[i]]=4;
    259         pos=ArrayFind(FSflag,1);for(var i=0;i<pos.length;i++)md.flowequation.element_equation[pos[i]]=5;
    260         pos=ArrayFind(SSAHOflag,1);for(var i=0;i<pos.length;i++)md.flowequation.element_equation[pos[i]]=6;
    261         pos=ArrayFind(SSAFSflag,1);for(var i=0;i<pos.length;i++)md.flowequation.element_equation[pos[i]]=7;
    262         pos=ArrayFind(HOFSflag,1);for(var i=0;i<pos.length;i++)md.flowequation.element_equation[pos[i]]=8;
     264        pos=ArrayFind(MLHOflag,1);for(var i=0;i<pos.length;i++)md.flowequation.element_equation[pos[i]]=4;
     265        pos=ArrayFind(HOflag,1);for(var i=0;i<pos.length;i++)md.flowequation.element_equation[pos[i]]=5;
     266        pos=ArrayFind(FSflag,1);for(var i=0;i<pos.length;i++)md.flowequation.element_equation[pos[i]]=6;
     267        pos=ArrayFind(SSAHOflag,1);for(var i=0;i<pos.length;i++)md.flowequation.element_equation[pos[i]]=7;
     268        pos=ArrayFind(SSAFSflag,1);for(var i=0;i<pos.length;i++)md.flowequation.element_equation[pos[i]]=8;
     269        pos=ArrayFind(HOFSflag,1);for(var i=0;i<pos.length;i++)md.flowequation.element_equation[pos[i]]=9;
    263270
    264271
     
    274281        pos=ArrayFind(nodeonSSA,1);for(var i=0;i<pos.length;i++)md.flowequation.vertex_equation[pos[i]]=2;
    275282        pos=ArrayFind(nodeonL1L2,1);for(var i=0;i<pos.length;i++)md.flowequation.vertex_equation[pos[i]]=3;
    276         pos=ArrayFind(nodeonHO,1);for(var i=0;i<pos.length;i++)md.flowequation.vertex_equation[pos[i]]=4;
    277         pos=ArrayFind(nodeonFS,1);for(var i=0;i<pos.length;i++)md.flowequation.vertex_equation[pos[i]]=5;
     283        pos=ArrayFind(nodeonMLHO,1);for(var i=0;i<pos.length;i++)md.flowequation.vertex_equation[pos[i]]=4;
     284        pos=ArrayFind(nodeonHO,1);for(var i=0;i<pos.length;i++)md.flowequation.vertex_equation[pos[i]]=5;
     285        pos=ArrayFind(nodeonFS,1);for(var i=0;i<pos.length;i++)md.flowequation.vertex_equation[pos[i]]=6;
    278286        //DO SIA LAST! Otherwise spcs might not be set up correctly (SIA should have priority)
    279287        pos=ArrayFind(nodeonSIA,1);for(var i=0;i<pos.length;i++)md.flowequation.vertex_equation[pos[i]]=1;
     
    285293        }
    286294
    287         pos=ArrayFind(nodeonSSAHO,1);for(var i=0;i<pos.length;i++)md.flowequation.vertex_equation[pos[i]]=6;
    288         pos=ArrayFind(nodeonHOFS,1);for(var i=0;i<pos.length;i++)md.flowequation.vertex_equation[pos[i]]=7;
    289         pos=ArrayFind(nodeonSSAFS,1);for(var i=0;i<pos.length;i++)md.flowequation.vertex_equation[pos[i]]=8;
     295        pos=ArrayFind(nodeonSSAHO,1);for(var i=0;i<pos.length;i++)md.flowequation.vertex_equation[pos[i]]=7;
     296        pos=ArrayFind(nodeonHOFS,1);for(var i=0;i<pos.length;i++)md.flowequation.vertex_equation[pos[i]]=8;
     297        pos=ArrayFind(nodeonSSAFS,2);for(var i=0;i<pos.length;i++)md.flowequation.vertex_equation[pos[i]]=9;
    290298
    291299        //figure out solution types
     
    293301        md.flowequation.isSSA  = ArrayAnyEqual(md.flowequation.element_equation,2);
    294302        md.flowequation.isL1L2 = ArrayAnyEqual(md.flowequation.element_equation,3);
    295         md.flowequation.isHO   = ArrayAnyEqual(md.flowequation.element_equation,4);
    296         md.flowequation.isFS   = ArrayAnyEqual(md.flowequation.element_equation,5);
     303        md.flowequation.isMLHO = ArrayAnyEqual(md.flowequation.element_equation,4);
     304        md.flowequation.isHO   = ArrayAnyEqual(md.flowequation.element_equation,5);
     305        md.flowequation.isFS   = ArrayAnyEqual(md.flowequation.element_equation,6);
    297306        return
    298307
  • issm/trunk-jpl/src/m/parameterization/setflowequation.m

    r24058 r25609  
    33%
    44%   This routine works like plotmodel: it works with an even number of inputs
    5 %   'SIA','SSA','L1L2','HO','FS' and 'fill' are the possible options
     5%   'SIA','SSA','L1L2','MLHO','HO','FS' and 'fill' are the possible options
    66%   that must be followed by the corresponding exp file or flags list
    77%   It can either be a domain file (argus type, .exp extension), or an array of element flags.
     
    1111%   a string 'all' will be considered as the entire domain
    1212%   You can specify the type of coupling, 'penalties' or 'tiling', to use with the input 'coupling'
    13 %   NB: L1L2 cannot currently be coupled to any other ice flow model
     13%   NB: L1L2 and MLHO cannot currently be coupled to any other ice flow model
    1414%
    1515%   Usage:
     
    3939HOflag   = FlagElements(md,getfieldvalue(options,'HO',''));
    4040L1L2flag = FlagElements(md,getfieldvalue(options,'L1L2',''));
     41MLHOflag = FlagElements(md,getfieldvalue(options,'MLHO',''));
    4142FSflag   = FlagElements(md,getfieldvalue(options,'FS',''));
    4243filltype = getfieldvalue(options,'fill','none');
     
    5354
    5455%check that each element has at least one flag
    55 if any(SIAflag+SSAflag+HOflag+L1L2flag+FSflag==0),
     56if any(SIAflag+SSAflag+HOflag+L1L2flag+MLHOflag+FSflag==0),
    5657        error('elements type not assigned, supported models are ''SIA'',''SSA'',''HO'' and ''FS''')
    5758end
    5859
    5960%check that each element has only one flag
    60 if any(SIAflag+SSAflag+HOflag+L1L2flag+FSflag>1),
     61if any(SIAflag+SSAflag+HOflag+L1L2flag+MLHOflag+FSflag>1),
    6162        disp('setflowequation warning message: some elements have several types, higher order type is used for them')
    6263        SIAflag(find(SIAflag & SSAflag))=0;
     
    6970        error('L1L2 cannot be coupled to any other model');
    7071end
     72if any(MLHOflag) & any(SIAflag | SSAflag | HOflag | FSflag)
     73        error('MLHO cannot be coupled to any other model');
     74end
    7175
    7276%Check that no HO or FS for 2d mesh
     
    8387
    8488%Initialize node fields
    85 nodeonSIA=zeros(md.mesh.numberofvertices,1);
    86 nodeonSIA(md.mesh.elements(find(SIAflag),:))=1;
    87 nodeonSSA=zeros(md.mesh.numberofvertices,1);
    88 nodeonSSA(md.mesh.elements(find(SSAflag),:))=1;
    89 nodeonHO=zeros(md.mesh.numberofvertices,1);
    90 nodeonHO(md.mesh.elements(find(HOflag),:))=1;
    91 nodeonL1L2=zeros(md.mesh.numberofvertices,1);
    92 nodeonL1L2(md.mesh.elements(find(L1L2flag),:))=1;
     89nodeonSIA=zeros(md.mesh.numberofvertices,1);  nodeonSIA(md.mesh.elements(find(SIAflag),:))=1;
     90nodeonSSA=zeros(md.mesh.numberofvertices,1);  nodeonSSA(md.mesh.elements(find(SSAflag),:))=1;
     91nodeonHO=zeros(md.mesh.numberofvertices,1);   nodeonHO(md.mesh.elements(find(HOflag),:))=1;
     92nodeonL1L2=zeros(md.mesh.numberofvertices,1); nodeonL1L2(md.mesh.elements(find(L1L2flag),:))=1;
     93nodeonMLHO=zeros(md.mesh.numberofvertices,1); nodeonMLHO(md.mesh.elements(find(MLHOflag),:))=1;
    9394nodeonFS=zeros(md.mesh.numberofvertices,1);
    9495noneflag=zeros(md.mesh.numberofelements,1);
     
    247248md.flowequation.element_equation(find(SSAflag))=2;
    248249md.flowequation.element_equation(find(L1L2flag))=3;
    249 md.flowequation.element_equation(find(HOflag))=4;
    250 md.flowequation.element_equation(find(FSflag))=5;
    251 md.flowequation.element_equation(find(SSAHOflag))=6;
    252 md.flowequation.element_equation(find(SSAFSflag))=7;
    253 md.flowequation.element_equation(find(HOFSflag))=8;
     250md.flowequation.element_equation(find(MLHOflag))=4;
     251md.flowequation.element_equation(find(HOflag))=5;
     252md.flowequation.element_equation(find(FSflag))=6;
     253md.flowequation.element_equation(find(SSAHOflag))=7;
     254md.flowequation.element_equation(find(SSAFSflag))=8;
     255md.flowequation.element_equation(find(HOFSflag))=9;
    254256
    255257%border
     
    260262%Create vertices_type
    261263md.flowequation.vertex_equation=zeros(md.mesh.numberofvertices,1);
    262 pos=find(nodeonSSA);
    263 md.flowequation.vertex_equation(pos)=2;
    264 pos=find(nodeonL1L2);
    265 md.flowequation.vertex_equation(pos)=3;
    266 pos=find(nodeonHO);
    267 md.flowequation.vertex_equation(pos)=4;
    268 pos=find(nodeonFS);
    269 md.flowequation.vertex_equation(pos)=5;
     264pos=find(nodeonSSA);  md.flowequation.vertex_equation(pos)=2;
     265pos=find(nodeonL1L2); md.flowequation.vertex_equation(pos)=3;
     266pos=find(nodeonMLHO); md.flowequation.vertex_equation(pos)=4;
     267pos=find(nodeonHO);   md.flowequation.vertex_equation(pos)=5;
     268pos=find(nodeonFS);   md.flowequation.vertex_equation(pos)=6;
    270269%DO SIA LAST! Otherwise spcs might not be set up correctly (SIA should have priority)
    271270pos=find(nodeonSIA);
     
    278277end
    279278pos=find(nodeonSSAHO);
    280 md.flowequation.vertex_equation(pos)=6;
     279md.flowequation.vertex_equation(pos)=7;
    281280pos=find(nodeonHOFS);
    282 md.flowequation.vertex_equation(pos)=7;
     281md.flowequation.vertex_equation(pos)=8;
    283282pos=find(nodeonSSAFS);
    284 md.flowequation.vertex_equation(pos)=8;
     283md.flowequation.vertex_equation(pos)=9;
    285284
    286285%figure out solution types
     
    288287md.flowequation.isSSA  = double(any(md.flowequation.element_equation == 2));
    289288md.flowequation.isL1L2 = double(any(md.flowequation.element_equation == 3));
    290 md.flowequation.isHO   = double(any(md.flowequation.element_equation == 4));
    291 md.flowequation.isFS   = double(any(md.flowequation.element_equation == 5));
     289md.flowequation.isMLHO = double(any(md.flowequation.element_equation == 4));
     290md.flowequation.isHO   = double(any(md.flowequation.element_equation == 5));
     291md.flowequation.isFS   = double(any(md.flowequation.element_equation == 6));
    292292
    293293return
  • issm/trunk-jpl/src/m/parameterization/setflowequation.py

    r24293 r25609  
    1010
    1111       This routine works like plotmodel: it works with an even number of inputs
    12        'SIA', 'SSA', 'HO', 'L1L2', 'FS' and 'fill' are the possible options
     12       'SIA', 'SSA', 'HO', 'L1L2', 'MLHO', 'FS' and 'fill' are the possible options
    1313       that must be followed by the corresponding exp file or flags list
    1414       It can either be a domain file (argus type, .exp extension), or an array of element flags.
     
    4444    HOflag = FlagElements(md, options.getfieldvalue('HO', ''))
    4545    L1L2flag = FlagElements(md, options.getfieldvalue('L1L2', ''))
     46    MLHOflag = FlagElements(md, options.getfieldvalue('MLHO', ''))
    4647    FSflag = FlagElements(md, options.getfieldvalue('FS', ''))
    4748    filltype = options.getfieldvalue('fill', 'none')
     
    5556        HOflag = ~SIAflag & ~SSAflag & ~FSflag
    5657    #check that each element has at least one flag
    57     if not any(SIAflag + SSAflag + L1L2flag + HOflag + FSflag):
     58    if not any(SIAflag + SSAflag + L1L2flag + MLHOflag + HOflag + FSflag):
    5859        raise TypeError("elements type not assigned, supported models are 'SIA', 'SSA', 'HO' and 'FS'")
    5960
    6061    #check that each element has only one flag
    61     if any(SIAflag + SSAflag + L1L2flag + HOflag + FSflag > 1):
     62    if any(SIAflag + SSAflag + L1L2flag + MLHOflag + HOflag + FSflag > 1):
    6263        print("setflowequation warning message: some elements have several types, higher order type is used for them")
    6364        SIAflag[np.where(np.logical_and(SIAflag, SSAflag))] = False
     
    6566        SSAflag[np.where(np.logical_and(SSAflag, HOflag))] = False
    6667
    67         #check that L1L2 is not coupled to any other model for now
     68        #check that L1L2 and MLHO is not coupled to any other model for now
    6869        if any(L1L2flag) and any(SIAflag + SSAflag + HOflag + FSflag):
    6970            raise TypeError('L1L2 cannot be coupled to any other model')
     71        if any(MLHOflag) and any(SIAflag + SSAflag + HOflag + FSflag):
     72            raise TypeError('MLHO cannot be coupled to any other model')
    7073
    7174        #Check that no HO or FS for 2d mesh
     
    8588    nodeonL1L2 = np.zeros(md.mesh.numberofvertices, bool)
    8689    nodeonL1L2[md.mesh.elements[np.where(L1L2flag), :] - 1] = True
     90    nodeonMLHO = np.zeros(md.mesh.numberofvertices, bool)
     91    nodeonMLHO[md.mesh.elements[np.where(MLHOflag), :] - 1] = True
    8792    nodeonHO = np.zeros(md.mesh.numberofvertices, bool)
    8893    nodeonHO[md.mesh.elements[np.where(HOflag), :] - 1] = True
     
    235240    md.flowequation.element_equation[np.where(SSAflag)] = 2
    236241    md.flowequation.element_equation[np.where(L1L2flag)] = 3
    237     md.flowequation.element_equation[np.where(HOflag)] = 4
    238     md.flowequation.element_equation[np.where(FSflag)] = 5
    239     md.flowequation.element_equation[np.where(SSAHOflag)] = 6
    240     md.flowequation.element_equation[np.where(SSAFSflag)] = 7
    241     md.flowequation.element_equation[np.where(HOFSflag)] = 8
     242    md.flowequation.element_equation[np.where(MLHOflag)] = 4
     243    md.flowequation.element_equation[np.where(HOflag)] = 5
     244    md.flowequation.element_equation[np.where(FSflag)] = 6
     245    md.flowequation.element_equation[np.where(SSAHOflag)] = 7
     246    md.flowequation.element_equation[np.where(SSAFSflag)] = 8
     247    md.flowequation.element_equation[np.where(HOFSflag)] = 9
    242248
    243249    #border
     
    252258    pos = np.where(nodeonL1L2)
    253259    md.flowequation.vertex_equation[pos] = 3
     260    pos = np.where(nodeonMLHO)
     261    md.flowequation.vertex_equation[pos] = 4
    254262    pos = np.where(nodeonHO)
    255     md.flowequation.vertex_equation[pos] = 4
     263    md.flowequation.vertex_equation[pos] = 5
    256264    pos = np.where(nodeonFS)
    257     md.flowequation.vertex_equation[pos] = 5
     265    md.flowequation.vertex_equation[pos] = 6
    258266    #DO SIA LAST! Otherwise spcs might not be set up correctly (SIA should have priority)
    259267    pos = np.where(nodeonSIA)
     
    264272            md.flowequation.vertex_equation[pos] = 0
    265273    pos = np.where(nodeonSSAHO)
    266     md.flowequation.vertex_equation[pos] = 6
     274    md.flowequation.vertex_equation[pos] = 7
    267275    pos = np.where(nodeonHOFS)
    268     md.flowequation.vertex_equation[pos] = 7
     276    md.flowequation.vertex_equation[pos] = 8
    269277    pos = np.where(nodeonSSAFS)
    270     md.flowequation.vertex_equation[pos] = 8
     278    md.flowequation.vertex_equation[pos] = 9
    271279
    272280    #figure out solution types
    273281    md.flowequation.isSIA = any(md.flowequation.element_equation == 1)
    274282    md.flowequation.isSSA = any(md.flowequation.element_equation == 2)
    275     md.flowequation.isL1L2 = any(md.flowequation.element_equation == 3)
    276     md.flowequation.isHO = any(md.flowequation.element_equation == 4)
    277     md.flowequation.isFS = any(md.flowequation.element_equation == 5)
     283    md.flowequation.isL1L2= any(md.flowequation.element_equation == 3)
     284    md.flowequation.isMLHO= any(md.flowequation.element_equation == 4)
     285    md.flowequation.isHO = any(md.flowequation.element_equation == 5)
     286    md.flowequation.isFS = any(md.flowequation.element_equation == 6)
    278287
    279288    return md
  • issm/trunk-jpl/src/m/plot/plot_elementstype.m

    r19533 r25609  
    1616%plot
    1717subplot(width,width,i);
     18p = [];
    1819
    1920if is2d
    20         pos=find(data==0);
    21         A=elements(pos,1); B=elements(pos,2); C=elements(pos,3);
    22         p1=patch( 'Faces', [A B C], 'Vertices', [x y z],'CData',0,'FaceColor','flat','EdgeColor',edgecolor);
    23         pos=find(data==1);
    24         A=elements(pos,1); B=elements(pos,2); C=elements(pos,3);
    25         p2=patch( 'Faces', [A B C], 'Vertices', [x y z],'CData',2,'FaceColor','flat','EdgeColor',edgecolor);
    26         pos=find(data==2);
    27         A=elements(pos,1); B=elements(pos,2); C=elements(pos,3);
    28         p3=patch( 'Faces', [A B C], 'Vertices', [x y z],'CData',3,'FaceColor','flat','EdgeColor',edgecolor);
    29         pos=find(data==3);
    30         A=elements(pos,1); B=elements(pos,2); C=elements(pos,3);
    31         p4=patch( 'Faces', [A B C], 'Vertices', [x y z],'CData',4,'FaceColor','flat','EdgeColor',edgecolor);
    32         pos=find(data==4);
    33         A=elements(pos,1); B=elements(pos,2); C=elements(pos,3);
    34         p5=patch( 'Faces', [A B C], 'Vertices', [x y z],'CData',5,'FaceColor','flat','EdgeColor',edgecolor);
    35         pos=find(data==5);
    36         A=elements(pos,1); B=elements(pos,2); C=elements(pos,3);
    37         p6=patch( 'Faces', [A B C], 'Vertices', [x y z],'CData',6,'FaceColor','flat','EdgeColor',edgecolor);
    38         pos=find(data==6);
    39         A=elements(pos,1); B=elements(pos,2); C=elements(pos,3);
    40         p7=patch( 'Faces', [A B C], 'Vertices', [x y z],'CData',7,'FaceColor','flat','EdgeColor',edgecolor);
    41         pos=find(data==7);
    42         A=elements(pos,1); B=elements(pos,2); C=elements(pos,3);
    43         p8=patch( 'Faces', [A B C], 'Vertices', [x y z],'CData',8,'FaceColor','flat','EdgeColor',edgecolor);
    44         pos=find(data==8);
    45         A=elements(pos,1); B=elements(pos,2); C=elements(pos,3);
    46         p9=patch( 'Faces', [A B C], 'Vertices', [x y z],'CData',9,'FaceColor','flat','EdgeColor',edgecolor);
     21        for i=0:9
     22                pos=find(data==i);
     23                A=elements(pos,1); B=elements(pos,2); C=elements(pos,3);
     24                pnew=patch( 'Faces', [A B C], 'Vertices', [x y z],'CData',i,'FaceColor','flat','EdgeColor',edgecolor);
     25                p = [p;pnew];
     26        end
    4727else
    48         pos=find(data==0);
    49         A=elements(pos,1); B=elements(pos,2); C=elements(pos,3); D=elements(pos,4); E=elements(pos,5); F=elements(pos,6);
    50         p1=patch( 'Faces', [A B C],'Vertices', [x y z],'CData', 0,'FaceColor','flat','EdgeColor',edgecolor);
    51         patch( 'Faces', [D E F],  'Vertices', [x y z],'CData', 0,'FaceColor','flat','EdgeColor',edgecolor);
    52         patch( 'Faces', [A B E D],'Vertices', [x y z],'CData', 0,'FaceColor','flat','EdgeColor',edgecolor);
    53         patch( 'Faces', [B E F C],'Vertices', [x y z],'CData', 0,'FaceColor','flat','EdgeColor',edgecolor);
    54         patch( 'Faces', [C A D F],'Vertices', [x y z],'CData', 0,'FaceColor','flat','EdgeColor',edgecolor);
    55         pos=find(data==1);
    56         A=elements(pos,1); B=elements(pos,2); C=elements(pos,3); D=elements(pos,4); E=elements(pos,5); F=elements(pos,6);
    57         p2=patch( 'Faces', [A B C],'Vertices', [x y z],'CData', 1,'FaceColor','flat','EdgeColor',edgecolor);
    58         patch( 'Faces', [D E F],  'Vertices', [x y z],'CData', 1,'FaceColor','flat','EdgeColor',edgecolor);
    59         patch( 'Faces', [A B E D],'Vertices', [x y z],'CData', 1,'FaceColor','flat','EdgeColor',edgecolor);
    60         patch( 'Faces', [B E F C],'Vertices', [x y z],'CData', 1,'FaceColor','flat','EdgeColor',edgecolor);
    61         patch( 'Faces', [C A D F],'Vertices', [x y z],'CData', 1,'FaceColor','flat','EdgeColor',edgecolor);
    62         pos=find(data==2);
    63         A=elements(pos,1); B=elements(pos,2); C=elements(pos,3); D=elements(pos,4); E=elements(pos,5); F=elements(pos,6);
    64         p3=patch( 'Faces', [A B C],'Vertices', [x y z],'CData', 2,'FaceColor','flat','EdgeColor',edgecolor);
    65         patch( 'Faces', [D E F],  'Vertices', [x y z],'CData', 2,'FaceColor','flat','EdgeColor',edgecolor);
    66         patch( 'Faces', [A B E D],'Vertices', [x y z],'CData', 2,'FaceColor','flat','EdgeColor',edgecolor);
    67         patch( 'Faces', [B E F C],'Vertices', [x y z],'CData', 2,'FaceColor','flat','EdgeColor',edgecolor);
    68         patch( 'Faces', [C A D F],'Vertices', [x y z],'CData', 2,'FaceColor','flat','EdgeColor',edgecolor);
    69         pos=find(data==3);
    70         A=elements(pos,1); B=elements(pos,2); C=elements(pos,3); D=elements(pos,4); E=elements(pos,5); F=elements(pos,6);
    71         p4=patch( 'Faces', [A B C],'Vertices', [x y z],'CData', 3,'FaceColor','flat','EdgeColor',edgecolor);
    72         patch( 'Faces', [D E F],  'Vertices', [x y z],'CData', 3,'FaceColor','flat','EdgeColor',edgecolor);
    73         patch( 'Faces', [A B E D],'Vertices', [x y z],'CData', 3,'FaceColor','flat','EdgeColor',edgecolor);
    74         patch( 'Faces', [B E F C],'Vertices', [x y z],'CData', 3,'FaceColor','flat','EdgeColor',edgecolor);
    75         patch( 'Faces', [C A D F],'Vertices', [x y z],'CData', 3,'FaceColor','flat','EdgeColor',edgecolor);
    76         pos=find(data==3);
    77         A=elements(pos,1); B=elements(pos,2); C=elements(pos,3); D=elements(pos,4); E=elements(pos,5); F=elements(pos,6);
    78         p5=patch( 'Faces', [A B C],'Vertices', [x y z],'CData', 3,'FaceColor','flat','EdgeColor',edgecolor);
    79         patch( 'Faces', [D E F],  'Vertices', [x y z],'CData', 3,'FaceColor','flat','EdgeColor',edgecolor);
    80         patch( 'Faces', [A B E D],'Vertices', [x y z],'CData', 3,'FaceColor','flat','EdgeColor',edgecolor);
    81         patch( 'Faces', [B E F C],'Vertices', [x y z],'CData', 3,'FaceColor','flat','EdgeColor',edgecolor);
    82         patch( 'Faces', [C A D F],'Vertices', [x y z],'CData', 3,'FaceColor','flat','EdgeColor',edgecolor);
    83         pos=find(data==4);
    84         A=elements(pos,1); B=elements(pos,2); C=elements(pos,3); D=elements(pos,4); E=elements(pos,5); F=elements(pos,6);
    85         p6=patch( 'Faces', [A B C],'Vertices', [x y z],'CData', 4,'FaceColor','flat','EdgeColor',edgecolor);
    86         patch( 'Faces', [D E F],  'Vertices', [x y z],'CData', 4,'FaceColor','flat','EdgeColor',edgecolor);
    87         patch( 'Faces', [A B E D],'Vertices', [x y z],'CData', 4,'FaceColor','flat','EdgeColor',edgecolor);
    88         patch( 'Faces', [B E F C],'Vertices', [x y z],'CData', 4,'FaceColor','flat','EdgeColor',edgecolor);
    89         patch( 'Faces', [C A D F],'Vertices', [x y z],'CData', 4,'FaceColor','flat','EdgeColor',edgecolor);
    90         pos=find(data==5);
    91         A=elements(pos,1); B=elements(pos,2); C=elements(pos,3); D=elements(pos,4); E=elements(pos,5); F=elements(pos,6);
    92         p7=patch( 'Faces', [A B C],'Vertices', [x y z],'CData', 5,'FaceColor','flat','EdgeColor',edgecolor);
    93         patch( 'Faces', [D E F],  'Vertices', [x y z],'CData', 5,'FaceColor','flat','EdgeColor',edgecolor);
    94         patch( 'Faces', [A B E D],'Vertices', [x y z],'CData', 5,'FaceColor','flat','EdgeColor',edgecolor);
    95         patch( 'Faces', [B E F C],'Vertices', [x y z],'CData', 5,'FaceColor','flat','EdgeColor',edgecolor);
    96         patch( 'Faces', [C A D F],'Vertices', [x y z],'CData', 5,'FaceColor','flat','EdgeColor',edgecolor);
    97         %HOFS elements
    98         pos=find(data==7);
    99         A=elements(pos,1); B=elements(pos,2); C=elements(pos,3); D=elements(pos,4); E=elements(pos,5); F=elements(pos,6);
    100         p8=patch( 'Faces', [A B C],'Vertices', [x y z],'CData', 7,'FaceColor','flat','EdgeColor',edgecolor);
    101         patch( 'Faces', [D E F],  'Vertices', [x y z],'CData', 7,'FaceColor','flat','EdgeColor',edgecolor);
    102         patch( 'Faces', [A B E D],'Vertices', [x y z],'CData', 7,'FaceColor','flat','EdgeColor',edgecolor);
    103         patch( 'Faces', [B E F C],'Vertices', [x y z],'CData', 7,'FaceColor','flat','EdgeColor',edgecolor);
    104         patch( 'Faces', [C A D F],'Vertices', [x y z],'CData', 7,'FaceColor','flat','EdgeColor',edgecolor);
    105         pos=find(data==6);
    106         A=elements(pos,1); B=elements(pos,2); C=elements(pos,3); D=elements(pos,4); E=elements(pos,5); F=elements(pos,6);
    107         p9=patch( 'Faces', [A B C],'Vertices', [x y z],'CData', 6,'FaceColor','flat','EdgeColor',edgecolor);
    108         patch( 'Faces', [D E F],  'Vertices', [x y z],'CData', 6,'FaceColor','flat','EdgeColor',edgecolor);
    109         patch( 'Faces', [A B E D],'Vertices', [x y z],'CData', 6,'FaceColor','flat','EdgeColor',edgecolor);
    110         patch( 'Faces', [B E F C],'Vertices', [x y z],'CData', 6,'FaceColor','flat','EdgeColor',edgecolor);
    111         patch( 'Faces', [C A D F],'Vertices', [x y z],'CData', 6,'FaceColor','flat','EdgeColor',edgecolor);
     28        for i=0:9
     29                pos=find(data==i);
     30                A=elements(pos,1); B=elements(pos,2); C=elements(pos,3); D=elements(pos,4); E=elements(pos,5); F=elements(pos,6);
     31                pnew = patch( 'Faces', [A B C],  'Vertices', [x y z],'CData', i,'FaceColor','flat','EdgeColor',edgecolor);
     32                p = [p;pnew];
     33                patch( 'Faces', [D E F],  'Vertices', [x y z],'CData', i,'FaceColor','flat','EdgeColor',edgecolor);
     34                patch( 'Faces', [A B E D],'Vertices', [x y z],'CData', i,'FaceColor','flat','EdgeColor',edgecolor);
     35                patch( 'Faces', [B E F C],'Vertices', [x y z],'CData', i,'FaceColor','flat','EdgeColor',edgecolor);
     36                patch( 'Faces', [C A D F],'Vertices', [x y z],'CData', i,'FaceColor','flat','EdgeColor',edgecolor);
     37        end
    11238end
    113 legend([p1 p2 p3 p4 p5 p6 p7 p8 p9],...
    114                 'None','SIA','SSA','L1L2','HO',...
     39legend(p,'None','SIA','SSA','L1L2','MLHO','HO',...
    11540                'SSAHO','FS','SSAFS','HOFS');
    11641
Note: See TracChangeset for help on using the changeset viewer.