Index: /issm/trunk/src/m/classes/public/bamg.m
===================================================================
--- /issm/trunk/src/m/classes/public/bamg.m	(revision 5860)
+++ /issm/trunk/src/m/classes/public/bamg.m	(revision 5861)
@@ -10,4 +10,5 @@
 %   - hminVertices: minimum edge length for each vertex (mesh)
 %   - hmaxVertices: maximum edge length for each vertex (mesh)
+%   - prescribedVertices:  vertices that should be kept by bamg. [x,y,marker]; marker is optional
 %
 %   - anisomax    : maximum ration between the smallest and largest edges (default is 10^30)
@@ -223,4 +224,36 @@
 			count=count+nods;
 		end
+	end
+
+	%Deal with vertices that need to be kept by mesher
+	if exist(options,'prescribedVertices'),
+
+		%recover xvertices yvertices
+		prescribedVertices=getfieldvalue(options,'prescribedVertices');
+		xvertices=prescribedVertices(:,1);
+		yvertices=prescribedVertices(:,2);
+		if(size(prescribedVertices,2)==3),
+			markers=prescribedVertices(:,3);
+		else 
+			markers=[];
+		end
+	
+		%only keep those inside
+		flags=ContourToNodes(xvertices,yvertices,domain(1),0);
+		pos=find(flags);
+		xvertices=xvertices(pos);
+		yvertices=yvertices(pos);
+		if ~isempty(markers),
+			markers=markers(pos);
+		end
+
+		%Add all points to bamg_geometry
+		nods=length(xvertices);
+		if isempty(markers),
+			markers=4*ones(nods,1);
+		end
+
+		bamg_geometry.Vertices=[bamg_geometry.Vertices; [xvertices yvertices markers]]; 
+
 	end
 
