Changeset 9532


Ignore:
Timestamp:
08/31/11 16:37:56 (14 years ago)
Author:
Mathieu Morlighem
Message:

removed verticestype2d and elementstype2d
elementstype and verticestype are not enums anymore

Location:
issm/trunk/src/m
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk/src/m/classes/model.m

    r9522 r9532  
    2323                 numberofnodes       = modelfield('default',0,'marshall',true,'format','Integer');
    2424                 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);
    2727                 x                   = modelfield('default',NaN,'marshall',true,'format','DoubleMat','mattype',1);
    2828                 y                   = modelfield('default',NaN,'marshall',true,'format','DoubleMat','mattype',1);
     
    3939                 numberofnodes2d    = modelfield('default',0,'marshall',true,'format','Integer');
    4040                 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);
    4341                 x2d                = modelfield('default',NaN,'marshall',false);
    4442                 y2d                = modelfield('default',NaN,'marshall',false);
  • issm/trunk/src/m/model/collapse.m

    r9451 r9532  
    4545
    4646%elementstype
    47 if ~isnan(md.elements_type2d)
    48         md.elements_type=md.elements_type2d;
    49 elseif ~isnan(md.elements_type)
     47if ~isnan(md.elements_type)
    5048        md.elements_type=project2d(md,md.elements_type,1);
    5149end     
     
    109107md.y2d=NaN;
    110108md.elements2d=NaN;
    111 md.elements_type2d=md.elements_type;
    112109md.numberofelements2d=md.numberofelements;
    113110md.numberofnodes2d=md.numberofnodes;
  • issm/trunk/src/m/model/display/displaymesh.m

    r9451 r9532  
    1717        fielddisplay(md,'numberofnodes2d','number of nodes');
    1818        fielddisplay(md,'elements2d','index into (x,y,z), coordinates of the nodes');
    19         fielddisplay(md,'elements_type2d','element types');
    2019        fielddisplay(md,'x2d','nodes x coordinate');
    2120        fielddisplay(md,'y2d','nodes y coordinate');
  • issm/trunk/src/m/model/extrude.m

    r9451 r9532  
    106106md.y2d=md.y;
    107107md.elements2d=md.elements;
    108 md.elements_type2d=md.elements_type;
    109 md.vertices_type2d=md.vertices_type;
    110108md.numberofelements2d=md.numberofelements;
    111109md.numberofnodes2d=md.numberofnodes;
     
    157155%elementstype
    158156if ~isnan(md.elements_type)
    159         oldelements_type=md.elements_type2d;
     157        oldelements_type=md.elements_type;
    160158        md.elements_type=zeros(number_el3d,1);
    161159        md.elements_type=project3d(md,'vector',oldelements_type,'type','element');
     
    168166%verticestype
    169167if ~isnan(md.vertices_type)
    170         oldvertices_type=md.vertices_type2d;
    171168        md.vertices_type=zeros(number_nodes3d,1);
    172169        md.vertices_type=project3d(md,'vector',oldvertices_type,'type','node');
  • issm/trunk/src/m/model/ismodelselfconsistent.m

    r9521 r9532  
    404404                        checksize(md,fields,[md.numberofelements 1]);
    405405                        %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]);
    408407                        if (md.dim==2),
    409                                 checkvalues(md,{'elements_type'},[MacAyealApproximationEnum() HutterApproximationEnum()]);
     408                                checkvalues(md,{'elements_type'},[1 2]);
    410409                        end
    411410                        if (md.ismacayealpattyn==0 && md.ishutter==0 && md.isstokes==0),
     
    418417                        checksize(md,fields,[md.numberofnodes 1]);
    419418                        %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]);
    422420                        if (md.dim==2),
    423                                 checkvalues(md,{'vertices_type'},[MacAyealApproximationEnum() HutterApproximationEnum()]);
     421                                checkvalues(md,{'vertices_type'},[1 2]);
    424422                        end
    425423                        if (md.ismacayealpattyn==0 && md.ishutter==0 && md.isstokes==0),
     
    436434                        % {{{2
    437435                        %HUTTER ON ICESHELF WARNING
    438                         if any(md.elements_type==HutterApproximationEnum & md.elementoniceshelf),
     436                        if any(md.elements_type==1 & md.elementoniceshelf),
    439437                                disp(sprintf('\n !!! Warning: Hutter''s model is not consistent on ice shelves !!!\n'));
    440438                        end
  • issm/trunk/src/m/model/marshall.m

    r9522 r9532  
    370370                count=count+numpairsforthisrift;
    371371        end
    372 
     372function 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  
    2020        error('only 2d model supported yet');
    2121end
    22 if any(md.elements_type~=MacAyealApproximationEnum),
     22if any(md.elements_type~=2),
    2323        disp('Warning: the model has some non macayeal elements. These will be treated like MacAyeal''s elements');
    2424end
  • issm/trunk/src/m/model/modelextract.m

    r9451 r9532  
    139139                md2.elements2d(:,3)=Pnode(md2.elements2d(:,3));
    140140
    141                 if ~isnan(md2.elements_type2d), md2.elements_type2d=md1.elements_type2d(pos_elem_2d); end;
    142141                md2.x2d=md1.x(pos_node_2d);
    143142                md2.y2d=md1.y(pos_node_2d);
  • issm/trunk/src/m/model/plot/plot_elementstype.m

    r8472 r9532  
    1919if is2d
    2020        %Hutter elements
    21         posH=find(data==HutterApproximationEnum);
     21        posH=find(data==1);
    2222        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);
    2424        %MacAyeal element
    25         posM=find(data==MacAyealApproximationEnum);
     25        posM=find(data==2);
    2626        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);
    2828        %Pattyn element
    29         posP=find(data==PattynApproximationEnum);
     29        posP=find(data==3);
    3030        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);
    3232        %MacAyealPattyn element
    33         posMP=find(data==MacAyealPattynApproximationEnum);
     33        posMP=find(data==5);
    3434        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);
    3636        %Stokes elements
    37         posS=find(data==StokesApproximationEnum);
     37        posS=find(data==4);
    3838        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);
    4040        %MacAyealStokes elements
    41         posMS=find(data==MacAyealStokesApproximationEnum);
     41        posMS=find(data==6);
    4242        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);
    4444        %PattynStokes elements
    45         posPS=find(data==PattynStokesApproximationEnum);
     45        posPS=find(data==7);
    4646        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);
    4848        %None elements
    49         posNONE=find(data==NoneApproximationEnum);
     49        posNONE=find(data==0);
    5050        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);
    5252
    5353        legend([p1 p2 p3 p5 p6 p7 p8 p9],...
     
    5757else
    5858        %Hutter elements
    59         posH=find(data==HutterApproximationEnum);
     59        posH=find(data==1);
    6060        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);
    6666        %MacAyeal elements
    67         posM=find(data==MacAyealApproximationEnum);
     67        posM=find(data==2);
    6868        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);
    7474        %Pattyn elements
    75         posP=find(data==PattynApproximationEnum);
     75        posP=find(data==3);
    7676        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);
    8282        %Stokes elements
    83         posS=find(data==StokesApproximationEnum);
     83        posS=find(data==4);
    8484        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);
    9090        %MacAyealPattyn elements
    91         posP=find(data==MacAyealPattynApproximationEnum);
     91        posP=find(data==5);
    9292        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);
    9898        %PattynStokes elements
    99         PosPS=find(data==PattynStokesApproximationEnum);
     99        PosPS=find(data==7);
    100100        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);
    106106        %MacAyealStokes elements
    107         PosMS=find(data==MacAyealStokesApproximationEnum);
     107        PosMS=find(data==6);
    108108        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);
    114114        %None elements
    115         PosNONE=find(data==NoneApproximationEnum);
     115        PosNONE=find(data==0);
    116116        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);
    122122
    123123        legend([p1 p2 p3 p4 p5 p6 p7 p8],...
  • issm/trunk/src/m/model/plot/processmesh.m

    r9451 r9532  
    3939        elements2d=md.elements2d;
    4040        elements=md.elements;
    41         elements_type2d=md.elements_type2d;
    4241
    4342        %is it a 2d plot?
     
    6463                z=zeros(size(x2d));
    6564                elements=elements2d;
    66                 elements_type=elements_type2d;
    6765        end
    6866else
  • issm/trunk/src/m/model/setelementstype.m

    r9451 r9532  
    7474nodeonhutter(md.elements(find(hutterflag),:))=1;
    7575md.nodeonhutter=nodeonhutter;
    76 md.elements_type(find(hutterflag))=HutterApproximationEnum();
     76md.elements_type(find(hutterflag))=1;
    7777
    7878%2: MacAyeal elements
     
    8080nodeonmacayeal(md.elements(find(macayealflag),:))=1;
    8181md.nodeonmacayeal=nodeonmacayeal;
    82 md.elements_type(find(macayealflag))=MacAyealApproximationEnum();
     82md.elements_type(find(macayealflag))=2;
    8383
    8484%3: Pattyn elements
     
    8686nodeonpattyn(md.elements(find(pattynflag),:))=1;
    8787md.nodeonpattyn=nodeonpattyn;
    88 md.elements_type(find(pattynflag))=PattynApproximationEnum();
     88md.elements_type(find(pattynflag))=3;
    8989
    9090%4: Stokes elements
     
    100100nodeonstokes(md.elements(find(stokesflag),:))=1;
    101101md.nodeonstokes=nodeonstokes;
    102 md.elements_type(find(stokesflag))=StokesApproximationEnum();
     102md.elements_type(find(stokesflag))=4;
    103103
    104104%Then complete with NoneApproximation or the other model used if there is no stokes
     
    108108                nodeonpattyn(md.elements(find(pattynflag),:))=1;
    109109                md.nodeonpattyn=nodeonpattyn;
    110                 md.elements_type(find(~stokesflag))=PattynApproximationEnum();
     110                md.elements_type(find(~stokesflag))=3;
    111111        elseif any(macayealflag), %fill with macayeal
    112112                macayealflag(~stokesflag)=1;
    113113                nodeonmacayeal(md.elements(find(macayealflag),:))=1;
    114114                md.nodeonmacayeal=nodeonmacayeal;
    115                 md.elements_type(find(~stokesflag))=MacAyealApproximationEnum();
     115                md.elements_type(find(~stokesflag))=2;
    116116        else %fill with none
    117117        %5: None elements (non Stokes)
    118                 md.elements_type(find(~stokesflag))=NoneApproximationEnum();
     118                md.elements_type(find(~stokesflag))=0;
    119119        end
    120120end
     
    155155
    156156                %Create MacaAyealPattynApproximation where needed
    157                 md.elements_type(find(macayealpattynflag))=MacAyealPattynApproximationEnum();
     157                md.elements_type(find(macayealpattynflag))=5;
    158158
    159159                %Now recreate nodeonmacayeal and nodeonmacayealpattyn
     
    174174
    175175                %Create MacaAyealPattynApproximation where needed
    176                 md.elements_type(find(pattynstokesflag))=PattynStokesApproximationEnum();
     176                md.elements_type(find(pattynstokesflag))=7;
    177177
    178178                %Now recreate nodeonpattynstokes
     
    193193                md.nodeonstokes=nodeonstokes;
    194194
    195                 %Create MacaAyealMacAyealApproximation where needed
    196                 md.elements_type(find(macayealstokesflag))=MacAyealStokesApproximationEnum();
     195                %Create MacaAyeal Approximation where needed
     196                md.elements_type(find(macayealstokesflag))=6;
    197197
    198198                %Now recreate nodeonmacayealstokes
     
    207207md.vertices_type=zeros(md.numberofnodes,1);
    208208pos=find(nodeonhutter);
    209 md.vertices_type(pos)=HutterApproximationEnum();
     209md.vertices_type(pos)=1;
    210210pos=find(nodeonmacayeal);
    211 md.vertices_type(pos)=MacAyealApproximationEnum();
     211md.vertices_type(pos)=2;
    212212pos=find(nodeonpattyn);
    213 md.vertices_type(pos)=PattynApproximationEnum();
     213md.vertices_type(pos)=3;
    214214pos=find(nodeonhutter);
    215 md.vertices_type(pos)=HutterApproximationEnum();
     215md.vertices_type(pos)=1;
    216216pos=find(nodeonpattyn & nodeonmacayeal);
    217 md.vertices_type(pos)=PattynApproximationEnum();
     217md.vertices_type(pos)=3;
    218218pos=find(nodeonmacayealpattyn);
    219 md.vertices_type(pos)=MacAyealPattynApproximationEnum();
     219md.vertices_type(pos)=5;
    220220pos=find(nodeonstokes);
    221 md.vertices_type(pos)=StokesApproximationEnum();
     221md.vertices_type(pos)=4;
    222222if any(stokesflag),
    223223        pos=find(~nodeonstokes);
    224224        if(~any(pattynflag) & ~any(macayealflag)),
    225                 md.vertices_type(pos)=NoneApproximationEnum();
     225                md.vertices_type(pos)=0;
    226226        end
    227227end
    228228pos=find(nodeonpattynstokes);
    229 md.vertices_type(pos)=PattynStokesApproximationEnum();
     229md.vertices_type(pos)=7;
    230230pos=find(nodeonmacayealstokes);
    231 md.vertices_type(pos)=MacAyealStokesApproximationEnum();
     231md.vertices_type(pos)=6;
    232232
    233233%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
     234md.ishutter=double(any(md.elements_type==1));
     235md.ismacayealpattyn=double(any(md.elements_type==2 | md.elements_type==3));
     236md.isstokes=double(any(md.elements_type==4));
     237
     238end
Note: See TracChangeset for help on using the changeset viewer.