Changeset 25609
- Timestamp:
- 09/29/20 10:35:39 (5 years ago)
- Location:
- issm/trunk-jpl/src
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/shared/Enum/Enum.vim
r25557 r25609 146 146 syn keyword cConstant FlowequationIsHOEnum 147 147 syn keyword cConstant FlowequationIsL1L2Enum 148 syn keyword cConstant FlowequationIsMLHOEnum 148 149 syn keyword cConstant FlowequationIsSIAEnum 149 150 syn keyword cConstant FlowequationIsSSAEnum … … 1133 1134 syn keyword cConstant JEnum 1134 1135 syn keyword cConstant L1L2ApproximationEnum 1136 syn keyword cConstant MLHOApproximationEnum 1135 1137 syn keyword cConstant L2ProjectionBaseAnalysisEnum 1136 1138 syn keyword cConstant L2ProjectionEPLAnalysisEnum -
issm/trunk-jpl/src/c/shared/Enum/EnumDefinitions.h
r25522 r25609 140 140 FlowequationIsHOEnum, 141 141 FlowequationIsL1L2Enum, 142 FlowequationIsMLHOEnum, 142 143 FlowequationIsSIAEnum, 143 144 FlowequationIsSSAEnum, … … 1132 1133 JEnum, 1133 1134 L1L2ApproximationEnum, 1135 MLHOApproximationEnum, 1134 1136 L2ProjectionBaseAnalysisEnum, 1135 1137 L2ProjectionEPLAnalysisEnum, -
issm/trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp
r25522 r25609 148 148 case FlowequationIsHOEnum : return "FlowequationIsHO"; 149 149 case FlowequationIsL1L2Enum : return "FlowequationIsL1L2"; 150 case FlowequationIsMLHOEnum : return "FlowequationIsMLHO"; 150 151 case FlowequationIsSIAEnum : return "FlowequationIsSIA"; 151 152 case FlowequationIsSSAEnum : return "FlowequationIsSSA"; … … 1135 1136 case JEnum : return "J"; 1136 1137 case L1L2ApproximationEnum : return "L1L2Approximation"; 1138 case MLHOApproximationEnum : return "MLHOApproximation"; 1137 1139 case L2ProjectionBaseAnalysisEnum : return "L2ProjectionBaseAnalysis"; 1138 1140 case L2ProjectionEPLAnalysisEnum : return "L2ProjectionEPLAnalysis"; -
issm/trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp
r25522 r25609 151 151 else if (strcmp(name,"FlowequationIsHO")==0) return FlowequationIsHOEnum; 152 152 else if (strcmp(name,"FlowequationIsL1L2")==0) return FlowequationIsL1L2Enum; 153 else if (strcmp(name,"FlowequationIsMLHO")==0) return FlowequationIsMLHOEnum; 153 154 else if (strcmp(name,"FlowequationIsSIA")==0) return FlowequationIsSIAEnum; 154 155 else if (strcmp(name,"FlowequationIsSSA")==0) return FlowequationIsSSAEnum; … … 259 260 else if (strcmp(name,"MasstransportMinThickness")==0) return MasstransportMinThicknessEnum; 260 261 else if (strcmp(name,"MasstransportNumRequestedOutputs")==0) return MasstransportNumRequestedOutputsEnum; 261 else if (strcmp(name,"MasstransportPenaltyFactor")==0) return MasstransportPenaltyFactorEnum;262 262 else stage=3; 263 263 } 264 264 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; 266 267 else if (strcmp(name,"MasstransportStabilization")==0) return MasstransportStabilizationEnum; 267 268 else if (strcmp(name,"MaterialsBeta")==0) return MaterialsBetaEnum; … … 382 383 else if (strcmp(name,"SmbIsd18opd")==0) return SmbIsd18opdEnum; 383 384 else if (strcmp(name,"SmbIsdelta18o")==0) return SmbIsdelta18oEnum; 384 else if (strcmp(name,"SmbIsdensification")==0) return SmbIsdensificationEnum;385 385 else stage=4; 386 386 } 387 387 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; 389 390 else if (strcmp(name,"SmbIsgraingrowth")==0) return SmbIsgraingrowthEnum; 390 391 else if (strcmp(name,"SmbIsmelt")==0) return SmbIsmeltEnum; … … 505 506 else if (strcmp(name,"BasalforcingsPicoBasinId")==0) return BasalforcingsPicoBasinIdEnum; 506 507 else if (strcmp(name,"BasalforcingsPicoBoxId")==0) return BasalforcingsPicoBoxIdEnum; 507 else if (strcmp(name,"BasalforcingsPicoOverturningCoeff")==0) return BasalforcingsPicoOverturningCoeffEnum;508 508 else stage=5; 509 509 } 510 510 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; 512 513 else if (strcmp(name,"BasalforcingsPicoSubShelfOceanSalinity")==0) return BasalforcingsPicoSubShelfOceanSalinityEnum; 513 514 else if (strcmp(name,"BasalforcingsPicoSubShelfOceanTemp")==0) return BasalforcingsPicoSubShelfOceanTempEnum; … … 628 629 else if (strcmp(name,"HydrologydcEplThicknessTransient")==0) return HydrologydcEplThicknessTransientEnum; 629 630 else if (strcmp(name,"HydrologydcMaskEplactiveElt")==0) return HydrologydcMaskEplactiveEltEnum; 630 else if (strcmp(name,"HydrologydcMaskEplactiveNode")==0) return HydrologydcMaskEplactiveNodeEnum;631 631 else stage=6; 632 632 } 633 633 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; 635 636 else if (strcmp(name,"HydrologydcMaskThawedNode")==0) return HydrologydcMaskThawedNodeEnum; 636 637 else if (strcmp(name,"HydrologydcSedimentTransmitivity")==0) return HydrologydcSedimentTransmitivityEnum; … … 751 752 else if (strcmp(name,"SmbDlwrf")==0) return SmbDlwrfEnum; 752 753 else if (strcmp(name,"SmbDswrf")==0) return SmbDswrfEnum; 753 else if (strcmp(name,"SmbDzAdd")==0) return SmbDzAddEnum;754 754 else stage=7; 755 755 } 756 756 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; 758 759 else if (strcmp(name,"SmbDzMin")==0) return SmbDzMinEnum; 759 760 else if (strcmp(name,"SmbDzTop")==0) return SmbDzTopEnum; … … 874 875 else if (strcmp(name,"Vx")==0) return VxEnum; 875 876 else if (strcmp(name,"VxMesh")==0) return VxMeshEnum; 876 else if (strcmp(name,"VxObs")==0) return VxObsEnum;877 877 else stage=8; 878 878 } 879 879 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; 881 882 else if (strcmp(name,"Vy")==0) return VyEnum; 882 883 else if (strcmp(name,"VyMesh")==0) return VyMeshEnum; … … 997 998 else if (strcmp(name,"Absolute")==0) return AbsoluteEnum; 998 999 else if (strcmp(name,"AdaptiveTimestepping")==0) return AdaptiveTimesteppingEnum; 999 else if (strcmp(name,"AdjointBalancethickness2Analysis")==0) return AdjointBalancethickness2AnalysisEnum;1000 1000 else stage=9; 1001 1001 } 1002 1002 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; 1004 1005 else if (strcmp(name,"AdjointHorizAnalysis")==0) return AdjointHorizAnalysisEnum; 1005 1006 else if (strcmp(name,"AggressiveMigration")==0) return AggressiveMigrationEnum; … … 1120 1121 else if (strcmp(name,"GroundingOnly")==0) return GroundingOnlyEnum; 1121 1122 else if (strcmp(name,"GroundinglineMassFlux")==0) return GroundinglineMassFluxEnum; 1122 else if (strcmp(name,"Gset")==0) return GsetEnum;1123 1123 else stage=10; 1124 1124 } 1125 1125 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; 1127 1128 else if (strcmp(name,"HOApproximation")==0) return HOApproximationEnum; 1128 1129 else if (strcmp(name,"HOFSApproximation")==0) return HOFSApproximationEnum; … … 1162 1163 else if (strcmp(name,"J")==0) return JEnum; 1163 1164 else if (strcmp(name,"L1L2Approximation")==0) return L1L2ApproximationEnum; 1165 else if (strcmp(name,"MLHOApproximation")==0) return MLHOApproximationEnum; 1164 1166 else if (strcmp(name,"L2ProjectionBaseAnalysis")==0) return L2ProjectionBaseAnalysisEnum; 1165 1167 else if (strcmp(name,"L2ProjectionEPLAnalysis")==0) return L2ProjectionEPLAnalysisEnum; … … 1242 1244 else if (strcmp(name,"P0DG")==0) return P0DGEnum; 1243 1245 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;1246 1246 else stage=11; 1247 1247 } 1248 1248 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; 1250 1252 else if (strcmp(name,"P1bubblecondensed")==0) return P1bubblecondensedEnum; 1251 1253 else if (strcmp(name,"P1xP2")==0) return P1xP2Enum; … … 1365 1367 else if (strcmp(name,"CalvingdevCoeff")==0) return CalvingdevCoeffEnum; 1366 1368 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;1369 1369 else stage=12; 1370 1370 } 1371 1371 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; 1373 1375 else if (strcmp(name,"OutputdefinitionList")==0) return OutputdefinitionListEnum; 1374 1376 else if (strcmp(name,"SealevelObs")==0) return SealevelObsEnum; -
issm/trunk-jpl/src/c/shared/io/Marshalling/IoCodeConversions.cpp
r25562 r25609 311 311 case 2: return SSAApproximationEnum; 312 312 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; 318 319 default: _error_("Marshalled vertex equation code \""<<enum_in<<"\" not supported yet."); 319 320 } … … 325 326 case 2: return SSAApproximationEnum; 326 327 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; 332 334 default: _error_("Marshalled element equation code \""<<enum_in<<"\" not supported yet."); 333 335 } -
issm/trunk-jpl/src/m/classes/flowequation.js
r24866 r25609 22 22 fielddisplay(this,'isSSA','is the Shelfy-Stream Approximation (SSA) used ?'); 23 23 fielddisplay(this,'isL1L2','is the L1L2 approximation used ?'); 24 fielddisplay(this,'isMLHO','is the MLHO approximation used ?'); 24 25 fielddisplay(this,'isHO','is the Higher-Order (HO) approximation used ?'); 25 26 fielddisplay(this,'isFS','are the Full-FS (FS) equations used ?'); … … 56 57 checkfield(md,'fieldname','flowequation.isSSA','numel',[1],'values',[0, 1]); 57 58 checkfield(md,'fieldname','flowequation.isL1L2','numel',[1],'values',[0, 1]); 59 checkfield(md,'fieldname','flowequation.isMLHO','numel',[1],'values',[0, 1]); 58 60 checkfield(md,'fieldname','flowequation.isHO','numel',[1],'values',[0, 1]); 59 61 checkfield(md,'fieldname','flowequation.isFS','numel',[1],'values',[0, 1]); … … 82 84 } 83 85 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]); 86 88 } 87 89 else throw Error('Case not supported yet'); 88 90 89 if (!(this.isSIA | this.isSSA | this.isL1L2 | this.is HO | this.isFS)){91 if (!(this.isSIA | this.isSSA | this.isL1L2 | this.isMLHO | this.isHO | this.isFS)){ 90 92 md = checkmessage(md,['no element types set for this model']); 91 93 } … … 102 104 WriteData(fid,prefix,'object',this,'fieldname','isSSA','format','Boolean'); 103 105 WriteData(fid,prefix,'object',this,'fieldname','isL1L2','format','Boolean'); 106 WriteData(fid,prefix,'object',this,'fieldname','isMLHO','format','Boolean'); 104 107 WriteData(fid,prefix,'object',this,'fieldname','isHO','format','Boolean'); 105 108 WriteData(fid,prefix,'object',this,'fieldname','isFS','format','Boolean'); … … 129 132 this.isSSA = 0; 130 133 this.isL1L2 = 0; 134 this.isMLHO = 0; 131 135 this.isHO = 0; 132 136 this.isFS = 0; -
issm/trunk-jpl/src/m/classes/flowequation.m
r25519 r25609 9 9 isSSA = 0; 10 10 isL1L2 = 0; 11 isMLHO = 0; 11 12 isHO = 0; 12 13 isFS = 0; … … 98 99 md = checkfield(md,'fieldname','flowequation.isSSA','numel',[1],'values',[0 1]); 99 100 md = checkfield(md,'fieldname','flowequation.isL1L2','numel',[1],'values',[0 1]); 101 md = checkfield(md,'fieldname','flowequation.isMLHO','numel',[1],'values',[0 1]); 100 102 md = checkfield(md,'fieldname','flowequation.isHO','numel',[1],'values',[0 1]); 101 103 md = checkfield(md,'fieldname','flowequation.isFS','numel',[1],'values',[0 1]); … … 123 125 md = checkfield(md,'fieldname','flowequation.element_equation','size',[md.mesh.numberofelements 1],'values',[2,4,5]); 124 126 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]); 127 129 else 128 130 error('Case not supported yet'); 129 131 end 130 if ~(self.isSIA || self.isSSA || self.isL1L2 || self.is HO || self.isFS),132 if ~(self.isSIA || self.isSSA || self.isL1L2 || self.isMLHO || self.isHO || self.isFS), 131 133 md = checkmessage(md,['no element types set for this model']); 132 134 end … … 146 148 fielddisplay(self,'isSSA','is the Shelfy-Stream Approximation (SSA) used?'); 147 149 fielddisplay(self,'isL1L2','is the L1L2 approximation used?'); 150 fielddisplay(self,'isMLHO','is the Mono-Layer Higher-Order approximation used?'); 148 151 fielddisplay(self,'isHO','is the Higher-Order (HO) approximation used?'); 149 152 fielddisplay(self,'isFS','are the Full-FS (FS) equations used?'); … … 164 167 WriteData(fid,prefix,'object',self,'fieldname','isSSA','format','Boolean'); 165 168 WriteData(fid,prefix,'object',self,'fieldname','isL1L2','format','Boolean'); 169 WriteData(fid,prefix,'object',self,'fieldname','isMLHO','format','Boolean'); 166 170 WriteData(fid,prefix,'object',self,'fieldname','isHO','format','Boolean'); 167 171 WriteData(fid,prefix,'object',self,'fieldname','isFS','format','Boolean'); … … 188 192 writejsdouble(fid,[modelname '.flowequation.isSSA'],self.isSSA); 189 193 writejsdouble(fid,[modelname '.flowequation.isL1L2'],self.isL1L2); 194 writejsdouble(fid,[modelname '.flowequation.isMLHO'],self.isMLHO); 190 195 writejsdouble(fid,[modelname '.flowequation.isHO'],self.isHO); 191 196 writejsdouble(fid,[modelname '.flowequation.isFS'],self.isFS); -
issm/trunk-jpl/src/m/classes/flowequation.py
r25521 r25609 19 19 self.isSSA = 0 20 20 self.isL1L2 = 0 21 self.isMLHO = 0 21 22 self.isHO = 0 22 23 self.isFS = 0 … … 47 48 s += "{}\n".format(fielddisplay(self, 'isSSA', "is the Shelfy-Stream Approximation (SSA) used?")) 48 49 s += "{}\n".format(fielddisplay(self, 'isL1L2', "are L1L2 equations used?")) 50 s += "{}\n".format(fielddisplay(self, 'isMLHO', "are Mono-layer Higher-Order equations used?")) 49 51 s += "{}\n".format(fielddisplay(self, 'isHO', "is the Higher-Order (HO) approximation used?")) 50 52 s += "{}\n".format(fielddisplay(self, 'isFS', "are the Full-FS (FS) equations used?")) … … 94 96 md = checkfield(md, 'fieldname', 'flowequation.isSSA', 'numel', [1], 'values', [0, 1]) 95 97 md = checkfield(md, 'fieldname', 'flowequation.isL1L2', 'numel', [1], 'values', [0, 1]) 98 md = checkfield(md, 'fieldname', 'flowequation.isMLHO', 'numel', [1], 'values', [0, 1]) 96 99 md = checkfield(md, 'fieldname', 'flowequation.isHO', 'numel', [1], 'values', [0, 1]) 97 100 md = checkfield(md, 'fieldname', 'flowequation.isFS', 'numel', [1], 'values', [0, 1]) … … 116 119 md = checkfield(md, 'fieldname', 'flowequation.element_equation', 'size', [md.mesh.numberofelements], 'values', [2, 4, 5]) 117 120 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)) 120 123 else: 121 124 raise RuntimeError('mesh type not supported yet') 122 if not (self.isSIA or self.isSSA or self.isL1L2 or self.is HO or self.isFS):125 if not (self.isSIA or self.isSSA or self.isL1L2 or self.isMLHO or self.isHO or self.isFS): 123 126 md.checkmessage("no element types set for this model") 124 127 … … 135 138 WriteData(fid, prefix, 'object', self, 'fieldname', 'isSSA', 'format', 'Boolean') 136 139 WriteData(fid, prefix, 'object', self, 'fieldname', 'isL1L2', 'format', 'Boolean') 140 WriteData(fid, prefix, 'object', self, 'fieldname', 'isMLHO', 'format', 'Boolean') 137 141 WriteData(fid, prefix, 'object', self, 'fieldname', 'isHO', 'format', 'Boolean') 138 142 WriteData(fid, prefix, 'object', self, 'fieldname', 'isFS', 'format', 'Boolean') -
issm/trunk-jpl/src/m/parameterization/setflowequation.js
r19768 r25609 3 3 // 4 4 // This routine works like plotmodel: it works with an even number of inputs 5 // 'SIA','SSA','L1L2',' HO','FS' and 'fill' are the possible options5 // 'SIA','SSA','L1L2','MLHO','HO','FS' and 'fill' are the possible options 6 6 // that must be followed by the corresponding exp file or flags list 7 7 // It can either be a domain file (argus type, .exp extension), or an array of element flags. … … 11 11 // a string 'all' will be considered as the entire domain 12 12 // 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 model13 // NB: L1L2 and MLHO cannot currently be coupled to any other ice flow model 14 14 // 15 15 // Usage: … … 38 38 HOflag = FlagElements(md,options.getfieldvalue('HO','')); 39 39 L1L2flag = FlagElements(md,options.getfieldvalue('L1L2','')); 40 MLHOflag = FlagElements(md,options.getfieldvalue('MLHO','')); 40 41 FSflag = FlagElements(md,options.getfieldvalue('FS','')); 41 42 filltype = options.getfieldvalue('fill','none'); … … 54 55 55 56 //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) 57 58 throw Error("elements type not assigned, supported models are 'SIA','SSA','HO' and 'FS'"); 58 59 59 60 //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)){ 61 62 console.log('setflowequation warning message: some elements have several types, higher order type is used for them') 62 63 … … 70 71 //check that L1L2 is not coupled to any other model for now 71 72 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'); 72 74 73 75 //Check that no HO or FS for 2d mesh … … 97 99 pos=ArrayFind(L1L2flag,1); 98 100 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; 99 105 100 106 nodeonFS=NewArrayFill(md.mesh.numberofvertices,0); … … 256 262 pos=ArrayFind(SSAflag,1);for(var i=0;i<pos.length;i++)md.flowequation.element_equation[pos[i]]=2; 257 263 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; 263 270 264 271 … … 274 281 pos=ArrayFind(nodeonSSA,1);for(var i=0;i<pos.length;i++)md.flowequation.vertex_equation[pos[i]]=2; 275 282 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; 278 286 //DO SIA LAST! Otherwise spcs might not be set up correctly (SIA should have priority) 279 287 pos=ArrayFind(nodeonSIA,1);for(var i=0;i<pos.length;i++)md.flowequation.vertex_equation[pos[i]]=1; … … 285 293 } 286 294 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; 290 298 291 299 //figure out solution types … … 293 301 md.flowequation.isSSA = ArrayAnyEqual(md.flowequation.element_equation,2); 294 302 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); 297 306 return 298 307 -
issm/trunk-jpl/src/m/parameterization/setflowequation.m
r24058 r25609 3 3 % 4 4 % This routine works like plotmodel: it works with an even number of inputs 5 % 'SIA','SSA','L1L2',' HO','FS' and 'fill' are the possible options5 % 'SIA','SSA','L1L2','MLHO','HO','FS' and 'fill' are the possible options 6 6 % that must be followed by the corresponding exp file or flags list 7 7 % It can either be a domain file (argus type, .exp extension), or an array of element flags. … … 11 11 % a string 'all' will be considered as the entire domain 12 12 % 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 model13 % NB: L1L2 and MLHO cannot currently be coupled to any other ice flow model 14 14 % 15 15 % Usage: … … 39 39 HOflag = FlagElements(md,getfieldvalue(options,'HO','')); 40 40 L1L2flag = FlagElements(md,getfieldvalue(options,'L1L2','')); 41 MLHOflag = FlagElements(md,getfieldvalue(options,'MLHO','')); 41 42 FSflag = FlagElements(md,getfieldvalue(options,'FS','')); 42 43 filltype = getfieldvalue(options,'fill','none'); … … 53 54 54 55 %check that each element has at least one flag 55 if any(SIAflag+SSAflag+HOflag+L1L2flag+ FSflag==0),56 if any(SIAflag+SSAflag+HOflag+L1L2flag+MLHOflag+FSflag==0), 56 57 error('elements type not assigned, supported models are ''SIA'',''SSA'',''HO'' and ''FS''') 57 58 end 58 59 59 60 %check that each element has only one flag 60 if any(SIAflag+SSAflag+HOflag+L1L2flag+ FSflag>1),61 if any(SIAflag+SSAflag+HOflag+L1L2flag+MLHOflag+FSflag>1), 61 62 disp('setflowequation warning message: some elements have several types, higher order type is used for them') 62 63 SIAflag(find(SIAflag & SSAflag))=0; … … 69 70 error('L1L2 cannot be coupled to any other model'); 70 71 end 72 if any(MLHOflag) & any(SIAflag | SSAflag | HOflag | FSflag) 73 error('MLHO cannot be coupled to any other model'); 74 end 71 75 72 76 %Check that no HO or FS for 2d mesh … … 83 87 84 88 %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; 89 nodeonSIA=zeros(md.mesh.numberofvertices,1); nodeonSIA(md.mesh.elements(find(SIAflag),:))=1; 90 nodeonSSA=zeros(md.mesh.numberofvertices,1); nodeonSSA(md.mesh.elements(find(SSAflag),:))=1; 91 nodeonHO=zeros(md.mesh.numberofvertices,1); nodeonHO(md.mesh.elements(find(HOflag),:))=1; 92 nodeonL1L2=zeros(md.mesh.numberofvertices,1); nodeonL1L2(md.mesh.elements(find(L1L2flag),:))=1; 93 nodeonMLHO=zeros(md.mesh.numberofvertices,1); nodeonMLHO(md.mesh.elements(find(MLHOflag),:))=1; 93 94 nodeonFS=zeros(md.mesh.numberofvertices,1); 94 95 noneflag=zeros(md.mesh.numberofelements,1); … … 247 248 md.flowequation.element_equation(find(SSAflag))=2; 248 249 md.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; 250 md.flowequation.element_equation(find(MLHOflag))=4; 251 md.flowequation.element_equation(find(HOflag))=5; 252 md.flowequation.element_equation(find(FSflag))=6; 253 md.flowequation.element_equation(find(SSAHOflag))=7; 254 md.flowequation.element_equation(find(SSAFSflag))=8; 255 md.flowequation.element_equation(find(HOFSflag))=9; 254 256 255 257 %border … … 260 262 %Create vertices_type 261 263 md.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; 264 pos=find(nodeonSSA); md.flowequation.vertex_equation(pos)=2; 265 pos=find(nodeonL1L2); md.flowequation.vertex_equation(pos)=3; 266 pos=find(nodeonMLHO); md.flowequation.vertex_equation(pos)=4; 267 pos=find(nodeonHO); md.flowequation.vertex_equation(pos)=5; 268 pos=find(nodeonFS); md.flowequation.vertex_equation(pos)=6; 270 269 %DO SIA LAST! Otherwise spcs might not be set up correctly (SIA should have priority) 271 270 pos=find(nodeonSIA); … … 278 277 end 279 278 pos=find(nodeonSSAHO); 280 md.flowequation.vertex_equation(pos)= 6;279 md.flowequation.vertex_equation(pos)=7; 281 280 pos=find(nodeonHOFS); 282 md.flowequation.vertex_equation(pos)= 7;281 md.flowequation.vertex_equation(pos)=8; 283 282 pos=find(nodeonSSAFS); 284 md.flowequation.vertex_equation(pos)= 8;283 md.flowequation.vertex_equation(pos)=9; 285 284 286 285 %figure out solution types … … 288 287 md.flowequation.isSSA = double(any(md.flowequation.element_equation == 2)); 289 288 md.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)); 289 md.flowequation.isMLHO = double(any(md.flowequation.element_equation == 4)); 290 md.flowequation.isHO = double(any(md.flowequation.element_equation == 5)); 291 md.flowequation.isFS = double(any(md.flowequation.element_equation == 6)); 292 292 293 293 return -
issm/trunk-jpl/src/m/parameterization/setflowequation.py
r24293 r25609 10 10 11 11 This routine works like plotmodel: it works with an even number of inputs 12 'SIA', 'SSA', 'HO', 'L1L2', ' FS' and 'fill' are the possible options12 'SIA', 'SSA', 'HO', 'L1L2', 'MLHO', 'FS' and 'fill' are the possible options 13 13 that must be followed by the corresponding exp file or flags list 14 14 It can either be a domain file (argus type, .exp extension), or an array of element flags. … … 44 44 HOflag = FlagElements(md, options.getfieldvalue('HO', '')) 45 45 L1L2flag = FlagElements(md, options.getfieldvalue('L1L2', '')) 46 MLHOflag = FlagElements(md, options.getfieldvalue('MLHO', '')) 46 47 FSflag = FlagElements(md, options.getfieldvalue('FS', '')) 47 48 filltype = options.getfieldvalue('fill', 'none') … … 55 56 HOflag = ~SIAflag & ~SSAflag & ~FSflag 56 57 #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): 58 59 raise TypeError("elements type not assigned, supported models are 'SIA', 'SSA', 'HO' and 'FS'") 59 60 60 61 #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): 62 63 print("setflowequation warning message: some elements have several types, higher order type is used for them") 63 64 SIAflag[np.where(np.logical_and(SIAflag, SSAflag))] = False … … 65 66 SSAflag[np.where(np.logical_and(SSAflag, HOflag))] = False 66 67 67 #check that L1L2 is not coupled to any other model for now68 #check that L1L2 and MLHO is not coupled to any other model for now 68 69 if any(L1L2flag) and any(SIAflag + SSAflag + HOflag + FSflag): 69 70 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') 70 73 71 74 #Check that no HO or FS for 2d mesh … … 85 88 nodeonL1L2 = np.zeros(md.mesh.numberofvertices, bool) 86 89 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 87 92 nodeonHO = np.zeros(md.mesh.numberofvertices, bool) 88 93 nodeonHO[md.mesh.elements[np.where(HOflag), :] - 1] = True … … 235 240 md.flowequation.element_equation[np.where(SSAflag)] = 2 236 241 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 242 248 243 249 #border … … 252 258 pos = np.where(nodeonL1L2) 253 259 md.flowequation.vertex_equation[pos] = 3 260 pos = np.where(nodeonMLHO) 261 md.flowequation.vertex_equation[pos] = 4 254 262 pos = np.where(nodeonHO) 255 md.flowequation.vertex_equation[pos] = 4263 md.flowequation.vertex_equation[pos] = 5 256 264 pos = np.where(nodeonFS) 257 md.flowequation.vertex_equation[pos] = 5265 md.flowequation.vertex_equation[pos] = 6 258 266 #DO SIA LAST! Otherwise spcs might not be set up correctly (SIA should have priority) 259 267 pos = np.where(nodeonSIA) … … 264 272 md.flowequation.vertex_equation[pos] = 0 265 273 pos = np.where(nodeonSSAHO) 266 md.flowequation.vertex_equation[pos] = 6274 md.flowequation.vertex_equation[pos] = 7 267 275 pos = np.where(nodeonHOFS) 268 md.flowequation.vertex_equation[pos] = 7276 md.flowequation.vertex_equation[pos] = 8 269 277 pos = np.where(nodeonSSAFS) 270 md.flowequation.vertex_equation[pos] = 8278 md.flowequation.vertex_equation[pos] = 9 271 279 272 280 #figure out solution types 273 281 md.flowequation.isSIA = any(md.flowequation.element_equation == 1) 274 282 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) 278 287 279 288 return md -
issm/trunk-jpl/src/m/plot/plot_elementstype.m
r19533 r25609 16 16 %plot 17 17 subplot(width,width,i); 18 p = []; 18 19 19 20 if 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 47 27 else 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 112 38 end 113 legend([p1 p2 p3 p4 p5 p6 p7 p8 p9],... 114 'None','SIA','SSA','L1L2','HO',... 39 legend(p,'None','SIA','SSA','L1L2','MLHO','HO',... 115 40 'SSAHO','FS','SSAFS','HOFS'); 116 41
Note:
See TracChangeset
for help on using the changeset viewer.