Index: /issm/trunk/src/m/utils/Interp/PatchToVec.m
===================================================================
--- /issm/trunk/src/m/utils/Interp/PatchToVec.m	(revision 8667)
+++ /issm/trunk/src/m/utils/Interp/PatchToVec.m	(revision 8668)
@@ -6,9 +6,12 @@
 
 %if the patch is P0, we need to transform the vector a little bit first
-if size(Patch.value,2)==1,
-	vec=Patch.value(Patch.element);
-else
-	connectivity=sparse(Patch.index(:),1,1);
-	value       =sparse(Patch.index(:),1,Patch.value(:));
-	vec=full(value./connectivity);
-end
+switch(Patch.interpolation(1)),
+	case P0Enum,
+		vec(Patch.element)=Patch.value;
+	case P1Enum,
+		connectivity=sparse(Patch.index(:),1,1);
+		value       =sparse(Patch.index(:),1,Patch.value(:));
+		vec=full(value./connectivity);
+	otherwise,
+		error('interpolation not supported yet');
+	end
