Changeset 6705


Ignore:
Timestamp:
12/09/10 11:13:45 (14 years ago)
Author:
seroussi
Message:

include macayeal/stokes in setelementstype

File:
1 edited

Legend:

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

    r5969 r6705  
    6767
    6868%Stokes can only be used alone for now:
    69 if any(stokesflag) &any(hutterflag+macayealflag),
     69if any(stokesflag) &any(hutterflag),
    7070        error('setelementstype error message: stokes cannot be used with any other model for now, put stokes everywhere')
    7171end
     
    123123gridonmacayealpattyn=zeros(md.numberofgrids,1);
    124124gridonpattynstokes=zeros(md.numberofgrids,1);
     125gridonmacayealstokes=zeros(md.numberofgrids,1);
    125126if strcmpi(coupling_method,'penalties'),
    126127        %Create the border grids between Pattyn and MacAyeal and extrude them
     
    177178                gridonpattynstokes=zeros(md.numberofgrids,1);
    178179                gridonpattynstokes(md.elements(find(pattynstokesflag),:))=1;
    179         elseif any(stokesflag) & any(macayealflag+hutterflag),
     180        elseif any(stokesflag) & any(macayealflag),
     181                %Find grid at the border
     182                gridonmacayealstokes(find(gridonmacayeal & gridonstokes))=1;
     183                %Stokes elements in contact with this layer become MacAyealStokes elements
     184                matrixelements=ismember(md.elements,find(gridonmacayealstokes));
     185                commonelements=sum(matrixelements,2)~=0;
     186                commonelements(find(macayealflag))=0; %only one layer: the elements previously in macayeal
     187                stokesflag(find(commonelements))=0; %these elements are now macayealmacayealelements
     188                macayealstokesflag=zeros(md.numberofelements,1);
     189                macayealstokesflag(find(commonelements))=1;
     190                gridonstokes=zeros(md.numberofgrids,1);
     191                gridonstokes(md.elements(find(stokesflag),:))=1;
     192                md.gridonstokes=gridonstokes;
     193
     194                %Create MacaAyealMacAyealApproximation where needed
     195                md.elements_type(find(macayealstokesflag))=MacAyealStokesApproximationEnum();
     196
     197                %Now recreate gridonmacayealstokes
     198                gridonmacayealstokes=zeros(md.numberofgrids,1);
     199                gridonmacayealstokes(md.elements(find(macayealstokesflag),:))=1;
     200        elseif any(stokesflag) & any(hutterflag),
    180201                error('type of coupling not supported yet');
    181202        end
     
    206227pos=find(gridonpattynstokes);
    207228md.vertices_type(pos)=PattynStokesApproximationEnum();
     229pos=find(gridonmacayealstokes);
     230md.vertices_type(pos)=MacAyealStokesApproximationEnum();
    208231
    209232%figure out solution types
Note: See TracChangeset for help on using the changeset viewer.