Changeset 5126
- Timestamp:
- 08/10/10 14:33:22 (15 years ago)
- Location:
- issm/trunk/src/m/classes/public
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/m/classes/public/extrude.m
r5071 r5126 186 186 %dead grids 187 187 md.deadgrids=ones(md.numberofgrids,1); 188 md.deadgrids(md.elements(md.elements_type(:,1)~=MacAyeal FormulationEnum,:))=0;%non macayeal grids are not dead188 md.deadgrids(md.elements(md.elements_type(:,1)~=MacAyealApproximationEnum,:))=0;%non macayeal grids are not dead 189 189 md.deadgrids(find(md.gridonbed))=0;%grids from elements on bed are not dead 190 190 end -
issm/trunk/src/m/classes/public/ismodelselfconsistent.m
r5071 r5126 58 58 checksize(md,fields,[md.numberofelements 2]); 59 59 %Check the values of elements_type(1) 60 checkvalues(md,{'elements_type(:,1)'},[MacAyeal FormulationEnum() HutterFormulationEnum() PattynFormulationEnum()]);60 checkvalues(md,{'elements_type(:,1)'},[MacAyealApproximationEnum() HutterApproximationEnum() PattynApproximationEnum()]); 61 61 %Check the values of elements_type(2) 62 checkvalues(md,{'elements_type(:,2)'},[Stokes FormulationEnum() NoneFormulationEnum()]);62 checkvalues(md,{'elements_type(:,2)'},[StokesApproximationEnum() NoneApproximationEnum()]); 63 63 if (md.dim==2), 64 checkvalues(md,{'elements_type(:,1)'},[MacAyeal FormulationEnum() HutterFormulationEnum()]);64 checkvalues(md,{'elements_type(:,1)'},[MacAyealApproximationEnum() HutterApproximationEnum()]); 65 65 end 66 66 if (md.ismacayealpattyn==0 && md.ishutter==0 && md.isstokes==0), … … 73 73 checksize(md,fields,[md.numberofgrids 2]); 74 74 %Check the values of elements_type(1) 75 checkvalues(md,{'elements_type(:,1)'},[MacAyeal FormulationEnum() HutterFormulationEnum() PattynFormulationEnum() MacAyealPattynFormulationEnum()]);75 checkvalues(md,{'elements_type(:,1)'},[MacAyealApproximationEnum() HutterApproximationEnum() PattynApproximationEnum() MacAyealPattynApproximationEnum()]); 76 76 %Check the values of elements_type(2) 77 checkvalues(md,{'elements_type(:,2)'},[Stokes FormulationEnum() NoneFormulationEnum()]);77 checkvalues(md,{'elements_type(:,2)'},[StokesApproximationEnum() NoneApproximationEnum()]); 78 78 if (md.dim==2), 79 checkvalues(md,{'elements_type(:,1)'},[MacAyeal FormulationEnum() HutterFormulationEnum()]);79 checkvalues(md,{'elements_type(:,1)'},[MacAyealApproximationEnum() HutterApproximationEnum()]); 80 80 end 81 81 if (md.ismacayealpattyn==0 && md.ishutter==0 && md.isstokes==0), … … 205 205 206 206 %HUTTER ON ICESHELF WARNING 207 if any(md.elements_type(:,1)==Hutter FormulationEnum & md.elementoniceshelf),207 if any(md.elements_type(:,1)==HutterApproximationEnum & md.elementoniceshelf), 208 208 disp(sprintf('\n !!! Warning: Hutter''s model is not consistent on ice shelves !!!\n')); 209 209 end -
issm/trunk/src/m/classes/public/mechanicalproperties.m
r3994 r5126 20 20 error('only 2d model supported yet'); 21 21 end 22 if any(md.elements_type(:,1)~=MacAyeal FormulationEnum),22 if any(md.elements_type(:,1)~=MacAyealApproximationEnum), 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/classes/public/modelextract.m
r4690 r5126 212 212 pos=find(sum(md2.spcvelocity(:,1:3),2)); %find all the grids on the boundary of the domain without icefront 213 213 md2.gridonstokes(pos)=0; %we have to constrain all the boundary of the domain without icefront 214 stokes_elements=find(md2.elements_type(:,2)==Stokes FormulationEnum()); %find the elements on the stokes domain214 stokes_elements=find(md2.elements_type(:,2)==StokesApproximationEnum()); %find the elements on the stokes domain 215 215 borderflags=zeros(numberofgrids2,1); 216 216 borderflags(md2.elements(stokes_elements,:))=1; %find all the grids of the elements on stokes domain, ie stokes grids and borderstokes -
issm/trunk/src/m/classes/public/plot/plot_elementstype.m
r4330 r5126 21 21 if is2d 22 22 %Hutter elements 23 posH=find(data(:,1)==Hutter FormulationEnum);23 posH=find(data(:,1)==HutterApproximationEnum); 24 24 A=elements(posH,1); B=elements(posH,2); C=elements(posH,3); 25 p1=patch( 'Faces', [A B C], 'Vertices', [x y z],'CData',Hutter FormulationEnum,'FaceColor','flat','EdgeColor',edgecolor);25 p1=patch( 'Faces', [A B C], 'Vertices', [x y z],'CData',HutterApproximationEnum,'FaceColor','flat','EdgeColor',edgecolor); 26 26 %MacAyeal element 27 posH=find(data(:,1)==MacAyeal FormulationEnum);27 posH=find(data(:,1)==MacAyealApproximationEnum); 28 28 A=elements(posH,1); B=elements(posH,2); C=elements(posH,3); 29 p2=patch( 'Faces', [A B C], 'Vertices', [x y z],'CData',MacAyeal FormulationEnum,'FaceColor','flat','EdgeColor',edgecolor);29 p2=patch( 'Faces', [A B C], 'Vertices', [x y z],'CData',MacAyealApproximationEnum,'FaceColor','flat','EdgeColor',edgecolor); 30 30 %Pattyn element 31 posH=find(data(:,1)==Pattyn FormulationEnum);31 posH=find(data(:,1)==PattynApproximationEnum); 32 32 A=elements(posH,1); B=elements(posH,2); C=elements(posH,3); 33 p3=patch( 'Faces', [A B C], 'Vertices', [x y z],'CData',Pattyn FormulationEnum,'FaceColor','flat','EdgeColor',edgecolor);33 p3=patch( 'Faces', [A B C], 'Vertices', [x y z],'CData',PattynApproximationEnum,'FaceColor','flat','EdgeColor',edgecolor); 34 34 %Stokes elements 35 35 alpha=0.35; 36 posS=find(data(:,2)==Stokes FormulationEnum);36 posS=find(data(:,2)==StokesApproximationEnum); 37 37 if ~isempty(posS) 38 38 A=elements(posS,1); B=elements(posS,2); C=elements(posS,3); 39 % p4=patch( 'Faces', [A B C], 'Vertices', [x y z],'CData',Stokes FormulationEnum,'FaceColor','flat','EdgeColor',edgecolor,'EdgeAlpha',alpha,'FaceAlpha',alpha);39 % p4=patch( 'Faces', [A B C], 'Vertices', [x y z],'CData',StokesApproximationEnum,'FaceColor','flat','EdgeColor',edgecolor,'EdgeAlpha',alpha,'FaceAlpha',alpha); 40 40 % legend([p1 p2 p3 p4],'Hutter''s elements','MacAyeal''s elements','Pattyn''s elements','Stokes''s elements'); 41 41 else … … 44 44 else 45 45 %Hutter elements 46 posH=find(data(:,1)==Hutter FormulationEnum);46 posH=find(data(:,1)==HutterApproximationEnum); 47 47 A=elements(posH,1); B=elements(posH,2); C=elements(posH,3); D=elements(posH,4); E=elements(posH,5); F=elements(posH,6); 48 p1=patch( 'Faces', [A B C], 'Vertices', [x y z],'CData', Hutter FormulationEnum,'FaceColor','flat','EdgeColor',edgecolor);49 patch( 'Faces', [D E F], 'Vertices', [x y z],'CData', Hutter FormulationEnum,'FaceColor','flat','EdgeColor',edgecolor);50 patch( 'Faces', [A B E D], 'Vertices', [x y z],'CData', Hutter FormulationEnum,'FaceColor','flat','EdgeColor',edgecolor);51 patch( 'Faces', [B E F C ], 'Vertices', [x y z],'CData', Hutter FormulationEnum,'FaceColor','flat','EdgeColor',edgecolor);52 patch( 'Faces', [C A D F ], 'Vertices', [x y z],'CData', Hutter FormulationEnum,'FaceColor','flat','EdgeColor',edgecolor);48 p1=patch( 'Faces', [A B C], 'Vertices', [x y z],'CData', HutterApproximationEnum,'FaceColor','flat','EdgeColor',edgecolor); 49 patch( 'Faces', [D E F], 'Vertices', [x y z],'CData', HutterApproximationEnum,'FaceColor','flat','EdgeColor',edgecolor); 50 patch( 'Faces', [A B E D], 'Vertices', [x y z],'CData', HutterApproximationEnum,'FaceColor','flat','EdgeColor',edgecolor); 51 patch( 'Faces', [B E F C ], 'Vertices', [x y z],'CData', HutterApproximationEnum,'FaceColor','flat','EdgeColor',edgecolor); 52 patch( 'Faces', [C A D F ], 'Vertices', [x y z],'CData', HutterApproximationEnum,'FaceColor','flat','EdgeColor',edgecolor); 53 53 %MacAyeal elements 54 posM=find(data(:,1)==MacAyeal FormulationEnum);54 posM=find(data(:,1)==MacAyealApproximationEnum); 55 55 A=elements(posM,1); B=elements(posM,2); C=elements(posM,3); D=elements(posM,4); E=elements(posM,5); F=elements(posM,6); 56 p2=patch( 'Faces', [A B C], 'Vertices', [x y z],'CData', MacAyeal FormulationEnum,'FaceColor','flat','EdgeColor',edgecolor);57 patch( 'Faces', [D E F], 'Vertices', [x y z],'CData', MacAyeal FormulationEnum,'FaceColor','flat','EdgeColor',edgecolor);58 patch( 'Faces', [A B E D], 'Vertices', [x y z],'CData', MacAyeal FormulationEnum,'FaceColor','flat','EdgeColor',edgecolor);59 patch( 'Faces', [B E F C ], 'Vertices', [x y z],'CData', MacAyeal FormulationEnum,'FaceColor','flat','EdgeColor',edgecolor);60 patch( 'Faces', [C A D F ], 'Vertices', [x y z],'CData', MacAyeal FormulationEnum,'FaceColor','flat','EdgeColor',edgecolor);56 p2=patch( 'Faces', [A B C], 'Vertices', [x y z],'CData', MacAyealApproximationEnum,'FaceColor','flat','EdgeColor',edgecolor); 57 patch( 'Faces', [D E F], 'Vertices', [x y z],'CData', MacAyealApproximationEnum,'FaceColor','flat','EdgeColor',edgecolor); 58 patch( 'Faces', [A B E D], 'Vertices', [x y z],'CData', MacAyealApproximationEnum,'FaceColor','flat','EdgeColor',edgecolor); 59 patch( 'Faces', [B E F C ], 'Vertices', [x y z],'CData', MacAyealApproximationEnum,'FaceColor','flat','EdgeColor',edgecolor); 60 patch( 'Faces', [C A D F ], 'Vertices', [x y z],'CData', MacAyealApproximationEnum,'FaceColor','flat','EdgeColor',edgecolor); 61 61 %Pattyn elements 62 posP=find(data(:,1)==Pattyn FormulationEnum);62 posP=find(data(:,1)==PattynApproximationEnum); 63 63 A=elements(posP,1); B=elements(posP,2); C=elements(posP,3); D=elements(posP,4); E=elements(posP,5); F=elements(posP,6); 64 p3=patch( 'Faces', [A B C], 'Vertices', [x y z],'CData', Pattyn FormulationEnum,'FaceColor','flat','EdgeColor',edgecolor);65 patch( 'Faces', [D E F], 'Vertices', [x y z],'CData', Pattyn FormulationEnum,'FaceColor','flat','EdgeColor',edgecolor);66 patch( 'Faces', [A B E D], 'Vertices', [x y z],'CData', Pattyn FormulationEnum,'FaceColor','flat','EdgeColor',edgecolor);67 patch( 'Faces', [B E F C ], 'Vertices', [x y z],'CData', Pattyn FormulationEnum,'FaceColor','flat','EdgeColor',edgecolor);68 patch( 'Faces', [C A D F ], 'Vertices', [x y z],'CData', Pattyn FormulationEnum,'FaceColor','flat','EdgeColor',edgecolor);64 p3=patch( 'Faces', [A B C], 'Vertices', [x y z],'CData', PattynApproximationEnum,'FaceColor','flat','EdgeColor',edgecolor); 65 patch( 'Faces', [D E F], 'Vertices', [x y z],'CData', PattynApproximationEnum,'FaceColor','flat','EdgeColor',edgecolor); 66 patch( 'Faces', [A B E D], 'Vertices', [x y z],'CData', PattynApproximationEnum,'FaceColor','flat','EdgeColor',edgecolor); 67 patch( 'Faces', [B E F C ], 'Vertices', [x y z],'CData', PattynApproximationEnum,'FaceColor','flat','EdgeColor',edgecolor); 68 patch( 'Faces', [C A D F ], 'Vertices', [x y z],'CData', PattynApproximationEnum,'FaceColor','flat','EdgeColor',edgecolor); 69 69 %Stokes elements 70 70 alpha=0.35; 71 posS=find(data(:,2)==Stokes FormulationEnum);71 posS=find(data(:,2)==StokesApproximationEnum); 72 72 if ~isempty(posS) 73 73 A=elements(posS,1); B=elements(posS,2); C=elements(posS,3); D=elements(posS,4); E=elements(posS,5); F=elements(posS,6); -
issm/trunk/src/m/classes/public/setelementstype.m
r5071 r5126 77 77 gridonhutter(md.elements(find(hutterflag),:))=1; 78 78 md.gridonhutter=gridonhutter; 79 md.elements_type(find(hutterflag),1)=Hutter FormulationEnum();79 md.elements_type(find(hutterflag),1)=HutterApproximationEnum(); 80 80 81 81 %2: MacAyeal elements … … 83 83 gridonmacayeal(md.elements(find(macayealflag),:))=1; 84 84 md.gridonmacayeal=gridonmacayeal; 85 md.elements_type(find(macayealflag),1)=MacAyeal FormulationEnum();85 md.elements_type(find(macayealflag),1)=MacAyealApproximationEnum(); 86 86 87 87 %3: Pattyn elements … … 89 89 gridonpattyn(md.elements(find(pattynflag),:))=1; 90 90 md.gridonpattyn=gridonpattyn; 91 md.elements_type(find(pattynflag),1)=Pattyn FormulationEnum();91 md.elements_type(find(pattynflag),1)=PattynApproximationEnum(); 92 92 93 93 %4: Stokes elements 94 94 md.gridonstokes=gridonstokes; 95 md.elements_type(find(stokesflag),2)=Stokes FormulationEnum();95 md.elements_type(find(stokesflag),2)=StokesApproximationEnum(); 96 96 97 97 %5: None elements (non Stokes) 98 md.elements_type(find(~stokesflag),2)=None FormulationEnum();98 md.elements_type(find(~stokesflag),2)=NoneApproximationEnum(); 99 99 100 100 %Create vertices_type 101 101 md.vertices_type=zeros(md.numberofgrids,2); 102 102 pos=find(gridonhutter); 103 md.vertices_type(pos,1)=Hutter FormulationEnum();103 md.vertices_type(pos,1)=HutterApproximationEnum(); 104 104 pos=find(gridonmacayeal); 105 md.vertices_type(pos,1)=MacAyeal FormulationEnum();105 md.vertices_type(pos,1)=MacAyealApproximationEnum(); 106 106 pos=find(gridonpattyn); 107 md.vertices_type(pos,1)=Pattyn FormulationEnum();107 md.vertices_type(pos,1)=PattynApproximationEnum(); 108 108 pos=find(gridonhutter); 109 md.vertices_type(pos,1)=Hutter FormulationEnum();109 md.vertices_type(pos,1)=HutterApproximationEnum(); 110 110 pos=find(gridonpattyn & gridonmacayeal); 111 md.vertices_type(pos,1)=MacAyealPattyn FormulationEnum();111 md.vertices_type(pos,1)=MacAyealPattynApproximationEnum(); 112 112 pos=find(gridonstokes); 113 md.vertices_type(pos,2)=Stokes FormulationEnum();113 md.vertices_type(pos,2)=StokesApproximationEnum(); 114 114 pos=find(~gridonstokes); 115 md.vertices_type(pos,2)=None FormulationEnum();115 md.vertices_type(pos,2)=NoneApproximationEnum(); 116 116 117 117 %Create the border grids between Pattyn and MacAyeal and extrude them … … 138 138 139 139 %figure out the border stokes grids 140 stokes_elements=find(md.elements_type(:,2)==Stokes FormulationEnum()); %find the elements on the stokes domain140 stokes_elements=find(md.elements_type(:,2)==StokesApproximationEnum()); %find the elements on the stokes domain 141 141 borderflags=zeros(md.numberofgrids,1); 142 142 borderflags(md.elements(stokes_elements,:))=1; %find all the grids of the elements on stokes domain, ie stokes grids and borderstokes … … 144 144 145 145 %figure out solution types 146 md.ishutter=double(any(md.elements_type(:,1)==Hutter FormulationEnum));147 md.ismacayealpattyn=double(any(md.elements_type(:,1)==MacAyeal FormulationEnum | md.elements_type(:,1)==PattynFormulationEnum));148 md.isstokes=double(any(md.elements_type(:,2)==Stokes FormulationEnum));146 md.ishutter=double(any(md.elements_type(:,1)==HutterApproximationEnum)); 147 md.ismacayealpattyn=double(any(md.elements_type(:,1)==MacAyealApproximationEnum | md.elements_type(:,1)==PattynApproximationEnum)); 148 md.isstokes=double(any(md.elements_type(:,2)==StokesApproximationEnum)); 149 149 150 150 end
Note:
See TracChangeset
for help on using the changeset viewer.