Changeset 9532
- Timestamp:
- 08/31/11 16:37:56 (14 years ago)
- Location:
- issm/trunk/src/m
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/m/classes/model.m
r9522 r9532 23 23 numberofnodes = modelfield('default',0,'marshall',true,'format','Integer'); 24 24 elements = modelfield('default',NaN,'marshall',true,'format','DoubleMat','mattype',2); 25 elements_type = modelfield('default',NaN,'marshall',true,' format','DoubleMat','mattype',2);26 vertices_type = modelfield('default',NaN,'marshall',true,' format','DoubleMat','mattype',1);25 elements_type = modelfield('default',NaN,'marshall',true,'preprocess','marshallapproximations','format','DoubleMat','mattype',2); 26 vertices_type = modelfield('default',NaN,'marshall',true,'preprocess','marshallapproximations','format','DoubleMat','mattype',1); 27 27 x = modelfield('default',NaN,'marshall',true,'format','DoubleMat','mattype',1); 28 28 y = modelfield('default',NaN,'marshall',true,'format','DoubleMat','mattype',1); … … 39 39 numberofnodes2d = modelfield('default',0,'marshall',true,'format','Integer'); 40 40 elements2d = modelfield('default',NaN,'marshall',true,'format','DoubleMat','mattype',3); 41 elements_type2d = modelfield('default',NaN,'marshall',false);42 vertices_type2d = modelfield('default',NaN,'marshall',false);43 41 x2d = modelfield('default',NaN,'marshall',false); 44 42 y2d = modelfield('default',NaN,'marshall',false); -
issm/trunk/src/m/model/collapse.m
r9451 r9532 45 45 46 46 %elementstype 47 if ~isnan(md.elements_type2d) 48 md.elements_type=md.elements_type2d; 49 elseif ~isnan(md.elements_type) 47 if ~isnan(md.elements_type) 50 48 md.elements_type=project2d(md,md.elements_type,1); 51 49 end … … 109 107 md.y2d=NaN; 110 108 md.elements2d=NaN; 111 md.elements_type2d=md.elements_type;112 109 md.numberofelements2d=md.numberofelements; 113 110 md.numberofnodes2d=md.numberofnodes; -
issm/trunk/src/m/model/display/displaymesh.m
r9451 r9532 17 17 fielddisplay(md,'numberofnodes2d','number of nodes'); 18 18 fielddisplay(md,'elements2d','index into (x,y,z), coordinates of the nodes'); 19 fielddisplay(md,'elements_type2d','element types');20 19 fielddisplay(md,'x2d','nodes x coordinate'); 21 20 fielddisplay(md,'y2d','nodes y coordinate'); -
issm/trunk/src/m/model/extrude.m
r9451 r9532 106 106 md.y2d=md.y; 107 107 md.elements2d=md.elements; 108 md.elements_type2d=md.elements_type;109 md.vertices_type2d=md.vertices_type;110 108 md.numberofelements2d=md.numberofelements; 111 109 md.numberofnodes2d=md.numberofnodes; … … 157 155 %elementstype 158 156 if ~isnan(md.elements_type) 159 oldelements_type=md.elements_type 2d;157 oldelements_type=md.elements_type; 160 158 md.elements_type=zeros(number_el3d,1); 161 159 md.elements_type=project3d(md,'vector',oldelements_type,'type','element'); … … 168 166 %verticestype 169 167 if ~isnan(md.vertices_type) 170 oldvertices_type=md.vertices_type2d;171 168 md.vertices_type=zeros(number_nodes3d,1); 172 169 md.vertices_type=project3d(md,'vector',oldvertices_type,'type','node'); -
issm/trunk/src/m/model/ismodelselfconsistent.m
r9521 r9532 404 404 checksize(md,fields,[md.numberofelements 1]); 405 405 %Check the values of elements_type 406 checkvalues(md,{'elements_type'},[MacAyealApproximationEnum() HutterApproximationEnum() PattynApproximationEnum()... 407 MacAyealPattynApproximationEnum() MacAyealStokesApproximationEnum() PattynStokesApproximationEnum() StokesApproximationEnum() NoneApproximationEnum()]); 406 checkvalues(md,{'elements_type'},[0:7]); 408 407 if (md.dim==2), 409 checkvalues(md,{'elements_type'},[ MacAyealApproximationEnum() HutterApproximationEnum()]);408 checkvalues(md,{'elements_type'},[1 2]); 410 409 end 411 410 if (md.ismacayealpattyn==0 && md.ishutter==0 && md.isstokes==0), … … 418 417 checksize(md,fields,[md.numberofnodes 1]); 419 418 %Check the values of vertices_type 420 checkvalues(md,{'vertices_type'},[MacAyealApproximationEnum() HutterApproximationEnum() PattynApproximationEnum()... 421 MacAyealPattynApproximationEnum() StokesApproximationEnum() MacAyealStokesApproximationEnum() PattynStokesApproximationEnum() NoneApproximationEnum()]); 419 checkvalues(md,{'vertices_type'},[0:7]); 422 420 if (md.dim==2), 423 checkvalues(md,{'vertices_type'},[ MacAyealApproximationEnum() HutterApproximationEnum()]);421 checkvalues(md,{'vertices_type'},[1 2]); 424 422 end 425 423 if (md.ismacayealpattyn==0 && md.ishutter==0 && md.isstokes==0), … … 436 434 % {{{2 437 435 %HUTTER ON ICESHELF WARNING 438 if any(md.elements_type== HutterApproximationEnum& md.elementoniceshelf),436 if any(md.elements_type==1 & md.elementoniceshelf), 439 437 disp(sprintf('\n !!! Warning: Hutter''s model is not consistent on ice shelves !!!\n')); 440 438 end -
issm/trunk/src/m/model/marshall.m
r9522 r9532 370 370 count=count+numpairsforthisrift; 371 371 end 372 372 function out=marshallapproximations(in), 373 out=in; 374 pos=find(in==0); out(pos,end)=NoneApproximationEnum; 375 pos=find(in==1); out(pos,end)=HutterApproximationEnum; 376 pos=find(in==2); out(pos,end)=MacAyealApproximationEnum; 377 pos=find(in==3); out(pos,end)=PattynApproximationEnum; 378 pos=find(in==4); out(pos,end)=StokesApproximationEnum; 379 pos=find(in==5); out(pos,end)=MacAyealPattynApproximationEnum; 380 pos=find(in==6); out(pos,end)=MacAyealStokesApproximationEnum; 381 pos=find(in==7); out(pos,end)=PattynStokesApproximationEnum; 382 -
issm/trunk/src/m/model/mechanicalproperties.m
r9423 r9532 20 20 error('only 2d model supported yet'); 21 21 end 22 if any(md.elements_type~= MacAyealApproximationEnum),22 if any(md.elements_type~=2), 23 23 disp('Warning: the model has some non macayeal elements. These will be treated like MacAyeal''s elements'); 24 24 end -
issm/trunk/src/m/model/modelextract.m
r9451 r9532 139 139 md2.elements2d(:,3)=Pnode(md2.elements2d(:,3)); 140 140 141 if ~isnan(md2.elements_type2d), md2.elements_type2d=md1.elements_type2d(pos_elem_2d); end;142 141 md2.x2d=md1.x(pos_node_2d); 143 142 md2.y2d=md1.y(pos_node_2d); -
issm/trunk/src/m/model/plot/plot_elementstype.m
r8472 r9532 19 19 if is2d 20 20 %Hutter elements 21 posH=find(data== HutterApproximationEnum);21 posH=find(data==1); 22 22 A=elements(posH,1); B=elements(posH,2); C=elements(posH,3); 23 p1=patch( 'Faces', [A B C], 'Vertices', [x y z],'CData', HutterApproximationEnum,'FaceColor','flat','EdgeColor',edgecolor);23 p1=patch( 'Faces', [A B C], 'Vertices', [x y z],'CData',1,'FaceColor','flat','EdgeColor',edgecolor); 24 24 %MacAyeal element 25 posM=find(data== MacAyealApproximationEnum);25 posM=find(data==2); 26 26 A=elements(posM,1); B=elements(posM,2); C=elements(posM,3); 27 p2=patch( 'Faces', [A B C], 'Vertices', [x y z],'CData', MacAyealApproximationEnum,'FaceColor','flat','EdgeColor',edgecolor);27 p2=patch( 'Faces', [A B C], 'Vertices', [x y z],'CData',2,'FaceColor','flat','EdgeColor',edgecolor); 28 28 %Pattyn element 29 posP=find(data== PattynApproximationEnum);29 posP=find(data==3); 30 30 A=elements(posP,1); B=elements(posP,2); C=elements(posP,3); 31 p3=patch( 'Faces', [A B C], 'Vertices', [x y z],'CData', PattynApproximationEnum,'FaceColor','flat','EdgeColor',edgecolor);31 p3=patch( 'Faces', [A B C], 'Vertices', [x y z],'CData',3,'FaceColor','flat','EdgeColor',edgecolor); 32 32 %MacAyealPattyn element 33 posMP=find(data== MacAyealPattynApproximationEnum);33 posMP=find(data==5); 34 34 A=elements(posMP,1); B=elements(posMP,2); C=elements(posMP,3); 35 p5=patch( 'Faces', [A B C], 'Vertices', [x y z],'CData', MacAyealPattynApproximationEnum,'FaceColor','flat','EdgeColor',edgecolor);35 p5=patch( 'Faces', [A B C], 'Vertices', [x y z],'CData',5,'FaceColor','flat','EdgeColor',edgecolor); 36 36 %Stokes elements 37 posS=find(data== StokesApproximationEnum);37 posS=find(data==4); 38 38 A=elements(posS,1); B=elements(posS,2); C=elements(posS,3); 39 p6=patch( 'Faces', [A B C], 'Vertices', [x y z],'CData', StokesApproximationEnum,'FaceColor','flat','EdgeColor',edgecolor);39 p6=patch( 'Faces', [A B C], 'Vertices', [x y z],'CData',4,'FaceColor','flat','EdgeColor',edgecolor); 40 40 %MacAyealStokes elements 41 posMS=find(data== MacAyealStokesApproximationEnum);41 posMS=find(data==6); 42 42 A=elements(posMS,1); B=elements(posMS,2); C=elements(posMS,3); 43 p7=patch( 'Faces', [A B C], 'Vertices', [x y z],'CData', MacAyealStokesApproximationEnum,'FaceColor','flat','EdgeColor',edgecolor);43 p7=patch( 'Faces', [A B C], 'Vertices', [x y z],'CData',6,'FaceColor','flat','EdgeColor',edgecolor); 44 44 %PattynStokes elements 45 posPS=find(data== PattynStokesApproximationEnum);45 posPS=find(data==7); 46 46 A=elements(posPS,1); B=elements(posPS,2); C=elements(posPS,3); 47 p8=patch( 'Faces', [A B C], 'Vertices', [x y z],'CData', PattynStokesApproximationEnum,'FaceColor','flat','EdgeColor',edgecolor);47 p8=patch( 'Faces', [A B C], 'Vertices', [x y z],'CData',7,'FaceColor','flat','EdgeColor',edgecolor); 48 48 %None elements 49 posNONE=find(data== NoneApproximationEnum);49 posNONE=find(data==0); 50 50 A=elements(posNONE,1); B=elements(posNONE,2); C=elements(posNONE,3); 51 p9=patch( 'Faces', [A B C], 'Vertices', [x y z],'CData', NoneApproximationEnum,'FaceColor','flat','EdgeColor',edgecolor);51 p9=patch( 'Faces', [A B C], 'Vertices', [x y z],'CData',0,'FaceColor','flat','EdgeColor',edgecolor); 52 52 53 53 legend([p1 p2 p3 p5 p6 p7 p8 p9],... … … 57 57 else 58 58 %Hutter elements 59 posH=find(data== HutterApproximationEnum);59 posH=find(data==1); 60 60 A=elements(posH,1); B=elements(posH,2); C=elements(posH,3); D=elements(posH,4); E=elements(posH,5); F=elements(posH,6); 61 p1=patch( 'Faces', [A B C],'Vertices', [x y z],'CData', HutterApproximationEnum,'FaceColor','flat','EdgeColor',edgecolor);62 patch( 'Faces', [D E F], 'Vertices', [x y z],'CData', HutterApproximationEnum,'FaceColor','flat','EdgeColor',edgecolor);63 patch( 'Faces', [A B E D],'Vertices', [x y z],'CData', HutterApproximationEnum,'FaceColor','flat','EdgeColor',edgecolor);64 patch( 'Faces', [B E F C],'Vertices', [x y z],'CData', HutterApproximationEnum,'FaceColor','flat','EdgeColor',edgecolor);65 patch( 'Faces', [C A D F],'Vertices', [x y z],'CData', HutterApproximationEnum,'FaceColor','flat','EdgeColor',edgecolor);61 p1=patch( 'Faces', [A B C],'Vertices', [x y z],'CData', 1,'FaceColor','flat','EdgeColor',edgecolor); 62 patch( 'Faces', [D E F], 'Vertices', [x y z],'CData', 1,'FaceColor','flat','EdgeColor',edgecolor); 63 patch( 'Faces', [A B E D],'Vertices', [x y z],'CData', 1,'FaceColor','flat','EdgeColor',edgecolor); 64 patch( 'Faces', [B E F C],'Vertices', [x y z],'CData', 1,'FaceColor','flat','EdgeColor',edgecolor); 65 patch( 'Faces', [C A D F],'Vertices', [x y z],'CData', 1,'FaceColor','flat','EdgeColor',edgecolor); 66 66 %MacAyeal elements 67 posM=find(data== MacAyealApproximationEnum);67 posM=find(data==2); 68 68 A=elements(posM,1); B=elements(posM,2); C=elements(posM,3); D=elements(posM,4); E=elements(posM,5); F=elements(posM,6); 69 p2=patch( 'Faces', [A B C],'Vertices', [x y z],'CData', MacAyealApproximationEnum,'FaceColor','flat','EdgeColor',edgecolor);70 patch( 'Faces', [D E F], 'Vertices', [x y z],'CData', MacAyealApproximationEnum,'FaceColor','flat','EdgeColor',edgecolor);71 patch( 'Faces', [A B E D],'Vertices', [x y z],'CData', MacAyealApproximationEnum,'FaceColor','flat','EdgeColor',edgecolor);72 patch( 'Faces', [B E F C],'Vertices', [x y z],'CData', MacAyealApproximationEnum,'FaceColor','flat','EdgeColor',edgecolor);73 patch( 'Faces', [C A D F],'Vertices', [x y z],'CData', MacAyealApproximationEnum,'FaceColor','flat','EdgeColor',edgecolor);69 p2=patch( 'Faces', [A B C],'Vertices', [x y z],'CData', 2,'FaceColor','flat','EdgeColor',edgecolor); 70 patch( 'Faces', [D E F], 'Vertices', [x y z],'CData', 2,'FaceColor','flat','EdgeColor',edgecolor); 71 patch( 'Faces', [A B E D],'Vertices', [x y z],'CData', 2,'FaceColor','flat','EdgeColor',edgecolor); 72 patch( 'Faces', [B E F C],'Vertices', [x y z],'CData', 2,'FaceColor','flat','EdgeColor',edgecolor); 73 patch( 'Faces', [C A D F],'Vertices', [x y z],'CData', 2,'FaceColor','flat','EdgeColor',edgecolor); 74 74 %Pattyn elements 75 posP=find(data== PattynApproximationEnum);75 posP=find(data==3); 76 76 A=elements(posP,1); B=elements(posP,2); C=elements(posP,3); D=elements(posP,4); E=elements(posP,5); F=elements(posP,6); 77 p3=patch( 'Faces', [A B C],'Vertices', [x y z],'CData', PattynApproximationEnum,'FaceColor','flat','EdgeColor',edgecolor);78 patch( 'Faces', [D E F], 'Vertices', [x y z],'CData', PattynApproximationEnum,'FaceColor','flat','EdgeColor',edgecolor);79 patch( 'Faces', [A B E D],'Vertices', [x y z],'CData', PattynApproximationEnum,'FaceColor','flat','EdgeColor',edgecolor);80 patch( 'Faces', [B E F C],'Vertices', [x y z],'CData', PattynApproximationEnum,'FaceColor','flat','EdgeColor',edgecolor);81 patch( 'Faces', [C A D F],'Vertices', [x y z],'CData', PattynApproximationEnum,'FaceColor','flat','EdgeColor',edgecolor);77 p3=patch( 'Faces', [A B C],'Vertices', [x y z],'CData', 3,'FaceColor','flat','EdgeColor',edgecolor); 78 patch( 'Faces', [D E F], 'Vertices', [x y z],'CData', 3,'FaceColor','flat','EdgeColor',edgecolor); 79 patch( 'Faces', [A B E D],'Vertices', [x y z],'CData', 3,'FaceColor','flat','EdgeColor',edgecolor); 80 patch( 'Faces', [B E F C],'Vertices', [x y z],'CData', 3,'FaceColor','flat','EdgeColor',edgecolor); 81 patch( 'Faces', [C A D F],'Vertices', [x y z],'CData', 3,'FaceColor','flat','EdgeColor',edgecolor); 82 82 %Stokes elements 83 posS=find(data== StokesApproximationEnum);83 posS=find(data==4); 84 84 A=elements(posS,1); B=elements(posS,2); C=elements(posS,3); D=elements(posS,4); E=elements(posS,5); F=elements(posS,6); 85 p4=patch( 'Faces', [A B C],'Vertices', [x y z],'CData', StokesApproximationEnum,'FaceColor','flat','EdgeColor',edgecolor);86 patch( 'Faces', [D E F], 'Vertices', [x y z],'CData', StokesApproximationEnum,'FaceColor','flat','EdgeColor',edgecolor);87 patch( 'Faces', [A B E D],'Vertices', [x y z],'CData', StokesApproximationEnum,'FaceColor','flat','EdgeColor',edgecolor);88 patch( 'Faces', [B E F C],'Vertices', [x y z],'CData', StokesApproximationEnum,'FaceColor','flat','EdgeColor',edgecolor);89 patch( 'Faces', [C A D F],'Vertices', [x y z],'CData', StokesApproximationEnum,'FaceColor','flat','EdgeColor',edgecolor);85 p4=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 90 %MacAyealPattyn elements 91 posP=find(data== MacAyealPattynApproximationEnum);91 posP=find(data==5); 92 92 A=elements(posP,1); B=elements(posP,2); C=elements(posP,3); D=elements(posP,4); E=elements(posP,5); F=elements(posP,6); 93 p5=patch( 'Faces', [A B C],'Vertices', [x y z],'CData', MacAyealPattynApproximationEnum,'FaceColor','flat','EdgeColor',edgecolor);94 patch( 'Faces', [D E F], 'Vertices', [x y z],'CData', MacAyealPattynApproximationEnum,'FaceColor','flat','EdgeColor',edgecolor);95 patch( 'Faces', [A B E D],'Vertices', [x y z],'CData', MacAyealPattynApproximationEnum,'FaceColor','flat','EdgeColor',edgecolor);96 patch( 'Faces', [B E F C],'Vertices', [x y z],'CData', MacAyealPattynApproximationEnum,'FaceColor','flat','EdgeColor',edgecolor);97 patch( 'Faces', [C A D F],'Vertices', [x y z],'CData', MacAyealPattynApproximationEnum,'FaceColor','flat','EdgeColor',edgecolor);93 p5=patch( 'Faces', [A B C],'Vertices', [x y z],'CData', 5,'FaceColor','flat','EdgeColor',edgecolor); 94 patch( 'Faces', [D E F], 'Vertices', [x y z],'CData', 5,'FaceColor','flat','EdgeColor',edgecolor); 95 patch( 'Faces', [A B E D],'Vertices', [x y z],'CData', 5,'FaceColor','flat','EdgeColor',edgecolor); 96 patch( 'Faces', [B E F C],'Vertices', [x y z],'CData', 5,'FaceColor','flat','EdgeColor',edgecolor); 97 patch( 'Faces', [C A D F],'Vertices', [x y z],'CData', 5,'FaceColor','flat','EdgeColor',edgecolor); 98 98 %PattynStokes elements 99 PosPS=find(data== PattynStokesApproximationEnum);99 PosPS=find(data==7); 100 100 A=elements(PosPS,1); B=elements(PosPS,2); C=elements(PosPS,3); D=elements(PosPS,4); E=elements(PosPS,5); F=elements(PosPS,6); 101 p6=patch( 'Faces', [A B C],'Vertices', [x y z],'CData', PattynStokesApproximationEnum,'FaceColor','flat','EdgeColor',edgecolor);102 patch( 'Faces', [D E F], 'Vertices', [x y z],'CData', PattynStokesApproximationEnum,'FaceColor','flat','EdgeColor',edgecolor);103 patch( 'Faces', [A B E D],'Vertices', [x y z],'CData', PattynStokesApproximationEnum,'FaceColor','flat','EdgeColor',edgecolor);104 patch( 'Faces', [B E F C],'Vertices', [x y z],'CData', PattynStokesApproximationEnum,'FaceColor','flat','EdgeColor',edgecolor);105 patch( 'Faces', [C A D F],'Vertices', [x y z],'CData', PattynStokesApproximationEnum,'FaceColor','flat','EdgeColor',edgecolor);101 p6=patch( 'Faces', [A B C],'Vertices', [x y z],'CData', 7,'FaceColor','flat','EdgeColor',edgecolor); 102 patch( 'Faces', [D E F], 'Vertices', [x y z],'CData', 7,'FaceColor','flat','EdgeColor',edgecolor); 103 patch( 'Faces', [A B E D],'Vertices', [x y z],'CData', 7,'FaceColor','flat','EdgeColor',edgecolor); 104 patch( 'Faces', [B E F C],'Vertices', [x y z],'CData', 7,'FaceColor','flat','EdgeColor',edgecolor); 105 patch( 'Faces', [C A D F],'Vertices', [x y z],'CData', 7,'FaceColor','flat','EdgeColor',edgecolor); 106 106 %MacAyealStokes elements 107 PosMS=find(data== MacAyealStokesApproximationEnum);107 PosMS=find(data==6); 108 108 A=elements(PosMS,1); B=elements(PosMS,2); C=elements(PosMS,3); D=elements(PosMS,4); E=elements(PosMS,5); F=elements(PosMS,6); 109 p7=patch( 'Faces', [A B C],'Vertices', [x y z],'CData', MacAyealStokesApproximationEnum,'FaceColor','flat','EdgeColor',edgecolor);110 patch( 'Faces', [D E F], 'Vertices', [x y z],'CData', MacAyealStokesApproximationEnum,'FaceColor','flat','EdgeColor',edgecolor);111 patch( 'Faces', [A B E D],'Vertices', [x y z],'CData', MacAyealStokesApproximationEnum,'FaceColor','flat','EdgeColor',edgecolor);112 patch( 'Faces', [B E F C],'Vertices', [x y z],'CData', MacAyealStokesApproximationEnum,'FaceColor','flat','EdgeColor',edgecolor);113 patch( 'Faces', [C A D F],'Vertices', [x y z],'CData', MacAyealStokesApproximationEnum,'FaceColor','flat','EdgeColor',edgecolor);109 p7=patch( 'Faces', [A B C],'Vertices', [x y z],'CData', 6,'FaceColor','flat','EdgeColor',edgecolor); 110 patch( 'Faces', [D E F], 'Vertices', [x y z],'CData', 6,'FaceColor','flat','EdgeColor',edgecolor); 111 patch( 'Faces', [A B E D],'Vertices', [x y z],'CData', 6,'FaceColor','flat','EdgeColor',edgecolor); 112 patch( 'Faces', [B E F C],'Vertices', [x y z],'CData', 6,'FaceColor','flat','EdgeColor',edgecolor); 113 patch( 'Faces', [C A D F],'Vertices', [x y z],'CData', 6,'FaceColor','flat','EdgeColor',edgecolor); 114 114 %None elements 115 PosNONE=find(data== NoneApproximationEnum);115 PosNONE=find(data==0); 116 116 A=elements(PosNONE,1); B=elements(PosNONE,2); C=elements(PosNONE,3); D=elements(PosNONE,4); E=elements(PosNONE,5); F=elements(PosNONE,6); 117 p8=patch( 'Faces', [A B C],'Vertices', [x y z],'CData', NoneApproximationEnum,'FaceColor','flat','EdgeColor',edgecolor);118 patch( 'Faces', [D E F], 'Vertices', [x y z],'CData', NoneApproximationEnum,'FaceColor','flat','EdgeColor',edgecolor);119 patch( 'Faces', [A B E D],'Vertices', [x y z],'CData', NoneApproximationEnum,'FaceColor','flat','EdgeColor',edgecolor);120 patch( 'Faces', [B E F C],'Vertices', [x y z],'CData', NoneApproximationEnum,'FaceColor','flat','EdgeColor',edgecolor);121 patch( 'Faces', [C A D F],'Vertices', [x y z],'CData', NoneApproximationEnum,'FaceColor','flat','EdgeColor',edgecolor);117 p8=patch( 'Faces', [A B C],'Vertices', [x y z],'CData', 0,'FaceColor','flat','EdgeColor',edgecolor); 118 patch( 'Faces', [D E F], 'Vertices', [x y z],'CData', 0,'FaceColor','flat','EdgeColor',edgecolor); 119 patch( 'Faces', [A B E D],'Vertices', [x y z],'CData', 0,'FaceColor','flat','EdgeColor',edgecolor); 120 patch( 'Faces', [B E F C],'Vertices', [x y z],'CData', 0,'FaceColor','flat','EdgeColor',edgecolor); 121 patch( 'Faces', [C A D F],'Vertices', [x y z],'CData', 0,'FaceColor','flat','EdgeColor',edgecolor); 122 122 123 123 legend([p1 p2 p3 p4 p5 p6 p7 p8],... -
issm/trunk/src/m/model/plot/processmesh.m
r9451 r9532 39 39 elements2d=md.elements2d; 40 40 elements=md.elements; 41 elements_type2d=md.elements_type2d;42 41 43 42 %is it a 2d plot? … … 64 63 z=zeros(size(x2d)); 65 64 elements=elements2d; 66 elements_type=elements_type2d;67 65 end 68 66 else -
issm/trunk/src/m/model/setelementstype.m
r9451 r9532 74 74 nodeonhutter(md.elements(find(hutterflag),:))=1; 75 75 md.nodeonhutter=nodeonhutter; 76 md.elements_type(find(hutterflag))= HutterApproximationEnum();76 md.elements_type(find(hutterflag))=1; 77 77 78 78 %2: MacAyeal elements … … 80 80 nodeonmacayeal(md.elements(find(macayealflag),:))=1; 81 81 md.nodeonmacayeal=nodeonmacayeal; 82 md.elements_type(find(macayealflag))= MacAyealApproximationEnum();82 md.elements_type(find(macayealflag))=2; 83 83 84 84 %3: Pattyn elements … … 86 86 nodeonpattyn(md.elements(find(pattynflag),:))=1; 87 87 md.nodeonpattyn=nodeonpattyn; 88 md.elements_type(find(pattynflag))= PattynApproximationEnum();88 md.elements_type(find(pattynflag))=3; 89 89 90 90 %4: Stokes elements … … 100 100 nodeonstokes(md.elements(find(stokesflag),:))=1; 101 101 md.nodeonstokes=nodeonstokes; 102 md.elements_type(find(stokesflag))= StokesApproximationEnum();102 md.elements_type(find(stokesflag))=4; 103 103 104 104 %Then complete with NoneApproximation or the other model used if there is no stokes … … 108 108 nodeonpattyn(md.elements(find(pattynflag),:))=1; 109 109 md.nodeonpattyn=nodeonpattyn; 110 md.elements_type(find(~stokesflag))= PattynApproximationEnum();110 md.elements_type(find(~stokesflag))=3; 111 111 elseif any(macayealflag), %fill with macayeal 112 112 macayealflag(~stokesflag)=1; 113 113 nodeonmacayeal(md.elements(find(macayealflag),:))=1; 114 114 md.nodeonmacayeal=nodeonmacayeal; 115 md.elements_type(find(~stokesflag))= MacAyealApproximationEnum();115 md.elements_type(find(~stokesflag))=2; 116 116 else %fill with none 117 117 %5: None elements (non Stokes) 118 md.elements_type(find(~stokesflag))= NoneApproximationEnum();118 md.elements_type(find(~stokesflag))=0; 119 119 end 120 120 end … … 155 155 156 156 %Create MacaAyealPattynApproximation where needed 157 md.elements_type(find(macayealpattynflag))= MacAyealPattynApproximationEnum();157 md.elements_type(find(macayealpattynflag))=5; 158 158 159 159 %Now recreate nodeonmacayeal and nodeonmacayealpattyn … … 174 174 175 175 %Create MacaAyealPattynApproximation where needed 176 md.elements_type(find(pattynstokesflag))= PattynStokesApproximationEnum();176 md.elements_type(find(pattynstokesflag))=7; 177 177 178 178 %Now recreate nodeonpattynstokes … … 193 193 md.nodeonstokes=nodeonstokes; 194 194 195 %Create MacaAyeal MacAyealApproximation where needed196 md.elements_type(find(macayealstokesflag))= MacAyealStokesApproximationEnum();195 %Create MacaAyeal Approximation where needed 196 md.elements_type(find(macayealstokesflag))=6; 197 197 198 198 %Now recreate nodeonmacayealstokes … … 207 207 md.vertices_type=zeros(md.numberofnodes,1); 208 208 pos=find(nodeonhutter); 209 md.vertices_type(pos)= HutterApproximationEnum();209 md.vertices_type(pos)=1; 210 210 pos=find(nodeonmacayeal); 211 md.vertices_type(pos)= MacAyealApproximationEnum();211 md.vertices_type(pos)=2; 212 212 pos=find(nodeonpattyn); 213 md.vertices_type(pos)= PattynApproximationEnum();213 md.vertices_type(pos)=3; 214 214 pos=find(nodeonhutter); 215 md.vertices_type(pos)= HutterApproximationEnum();215 md.vertices_type(pos)=1; 216 216 pos=find(nodeonpattyn & nodeonmacayeal); 217 md.vertices_type(pos)= PattynApproximationEnum();217 md.vertices_type(pos)=3; 218 218 pos=find(nodeonmacayealpattyn); 219 md.vertices_type(pos)= MacAyealPattynApproximationEnum();219 md.vertices_type(pos)=5; 220 220 pos=find(nodeonstokes); 221 md.vertices_type(pos)= StokesApproximationEnum();221 md.vertices_type(pos)=4; 222 222 if any(stokesflag), 223 223 pos=find(~nodeonstokes); 224 224 if(~any(pattynflag) & ~any(macayealflag)), 225 md.vertices_type(pos)= NoneApproximationEnum();225 md.vertices_type(pos)=0; 226 226 end 227 227 end 228 228 pos=find(nodeonpattynstokes); 229 md.vertices_type(pos)= PattynStokesApproximationEnum();229 md.vertices_type(pos)=7; 230 230 pos=find(nodeonmacayealstokes); 231 md.vertices_type(pos)= MacAyealStokesApproximationEnum();231 md.vertices_type(pos)=6; 232 232 233 233 %figure out solution types 234 md.ishutter=double(any(md.elements_type== HutterApproximationEnum));235 md.ismacayealpattyn=double(any(md.elements_type== MacAyealApproximationEnum | md.elements_type==PattynApproximationEnum));236 md.isstokes=double(any(md.elements_type== StokesApproximationEnum));237 238 end 234 md.ishutter=double(any(md.elements_type==1)); 235 md.ismacayealpattyn=double(any(md.elements_type==2 | md.elements_type==3)); 236 md.isstokes=double(any(md.elements_type==4)); 237 238 end
Note:
See TracChangeset
for help on using the changeset viewer.