Index: /issm/trunk/src/m/model/setelementstype.m
===================================================================
--- /issm/trunk/src/m/model/setelementstype.m	(revision 6711)
+++ /issm/trunk/src/m/model/setelementstype.m	(revision 6712)
@@ -41,5 +41,5 @@
 	hutterflag(find(~macayealflag & ~pattynflag))=1;
 elseif strcmpi(filltype,'macayeal'),
-	macayealflag(find(~hutterflag & ~pattynflag))=1;
+	macayealflag(find(~hutterflag & ~pattynflag & ~stokesflag))=1;
 elseif strcmpi(filltype,'pattyn'),
 	pattynflag(find(~hutterflag & ~macayealflag & ~stokesflag))=1;
@@ -113,4 +113,9 @@
 		md.gridonpattyn=gridonpattyn;
 		md.elements_type(find(~stokesflag))=PattynApproximationEnum();
+	elseif any(macayealflag), %fill with macayeal
+		macayealflag(~stokesflag)=1;
+		gridonmacayeal(md.elements(find(macayealflag),:))=1;
+		md.gridonmacayeal=gridonmacayeal;
+		md.elements_type(find(~stokesflag))=MacAyealApproximationEnum();
 	else %fill with none 
 	%5: None elements (non Stokes)
@@ -184,4 +189,5 @@
 		matrixelements=ismember(md.elements,find(gridonmacayealstokes));
 		commonelements=sum(matrixelements,2)~=0;
+		plotmodel(md,'data',gridonmacayeal,'view',2,'edgecolor','k')
 		commonelements(find(macayealflag))=0; %only one layer: the elements previously in macayeal
 		stokesflag(find(commonelements))=0; %these elements are now macayealmacayealelements
@@ -221,5 +227,5 @@
 if any(stokesflag),
 	pos=find(~gridonstokes);
-	if(~any(pattynflag)),
+	if(~any(pattynflag) & ~any(macayealflag)),
 		md.vertices_type(pos)=NoneApproximationEnum();
 	end
