Index: /issm/trunk/test/Validation/ISMIP/TestA/Square.par
===================================================================
--- /issm/trunk/test/Validation/ISMIP/TestA/Square.par	(revision 4882)
+++ /issm/trunk/test/Validation/ISMIP/TestA/Square.par	(revision 4883)
@@ -22,10 +22,5 @@
 disp('      boundary conditions for diagnostic model');
 %Create grid on boundary fist (because we cannot use mesh)
-md.gridonboundary=zeros(md.numberofgrids,1);
-pos=find(md.x==0 | md.y==0 | md.x==max(md.x) | md.y==max(md.y));
-md.gridonboundary(pos)=1;
-md.gridondirichlet_diag=zeros(md.numberofgrids,1);
-pos=find(md.gridonboundary);md.gridondirichlet_diag(pos)=1;
-md.dirichletvalues_diag=zeros(md.numberofgrids,2);
-md.segmentonneumann_diag=zeros(0,3);
-md.gridondirichlet_thermal=zeros(md.numberofgrids,1);
+md=SetIceSheetBC(md);
+
+md.np=3;
Index: /issm/trunk/test/Validation/ISMIP/TestA/runme.m
===================================================================
--- /issm/trunk/test/Validation/ISMIP/TestA/runme.m	(revision 4882)
+++ /issm/trunk/test/Validation/ISMIP/TestA/runme.m	(revision 4883)
@@ -12,27 +12,29 @@
 md=extrude(md,10,1);
 
-%Create dirichlet on the bed on top of the borders
-pos=find(md.gridonbed);
-md.gridondirichlet_diag(pos)=1;
-
 md=setelementstype(md,'pattyn','all');
 %md=setelementstype(md,'pattyn','all','stokes','all'); 
 
 %Create dirichlet on the bed only
-md.gridondirichlet_diag=zeros(md.numberofgrids,1);
+md.spcvelocity=zeros(md.numberofgrids,6);
 pos=find(md.gridonbed);
-md.gridondirichlet_diag(pos)=1;
+md.spcvelocity(pos,1:2)=1;
 
 %Create MPCs to have periodic boundary conditions
-posx=find(md.x==0);
-posx2=find(md.x==max(md.x));
-
-posy=find(md.y==0 & md.x~=0 & md.x~=max(md.x)); %Don't take the same grids two times
-posy2=find(md.y==max(md.y) & md.x~=0 & md.x~=max(md.x));
-
-md.penalties=[posx,posx2;posy,posy2];
+%posx=find(md.x==0);
+%posx2=find(md.x==max(md.x));
+%
+%posy=find(md.y==0 & md.x~=0 & md.x~=max(md.x)); %Don't take the same grids two times
+%posy2=find(md.y==max(md.y) & md.x~=0 & md.x~=max(md.x));
+%
+%md.penalties=[posx,posx2;posy,posy2];
 
 %Compute the diagnostic
-md=solve(md,'analysis_type','diagnostic','package','ice');
+md=solve(md,'analysis_type',DiagnosticSolutionEnum);
+vx=zeros(md.numberofgrids,1);
+vx(md.results.DiagnosticSolution.Vx.index)=md.results.DiagnosticSolution.Vx.value;
+vy=zeros(md.numberofgrids,1);
+vy(md.results.DiagnosticSolution.Vy.index)=md.results.DiagnosticSolution.Vy.value;
+vz=zeros(md.numberofgrids,1);
+vz(md.results.DiagnosticSolution.Vz.index)=md.results.DiagnosticSolution.Vz.value;
 
-plotmodel(md,'data',md.results.diagnostic.vx,'data',md.results.diagnostic.vy,'data',md.results.diagnostic.vz,'layer#all',md.numlayers,'contourlevels',{9.2,18.4,27.6,46,73.6,82.8},'contourlevels',{0,-1.2,-0.9,-0.6,-0.3,1.2},'contourlevels',{-5.2,-3.9,-1.3,0,1.3,3.9,5.2})
+plotmodel(md,'data',vx,'data',vy,'data',vz,'layer#all',md.numlayers,'contourlevels',{9.2,18.4,27.6,46,73.6,82.8},'contourlevels',{0,-1.2,-0.9,-0.6,-0.3,1.2},'contourlevels',{-5.2,-3.9,-1.3,0,1.3,3.9,5.2})
Index: /issm/trunk/test/Validation/ISMIP/TestB/Square.par
===================================================================
--- /issm/trunk/test/Validation/ISMIP/TestB/Square.par	(revision 4882)
+++ /issm/trunk/test/Validation/ISMIP/TestB/Square.par	(revision 4883)
@@ -20,12 +20,7 @@
 md.rheology_n=3*ones(md.numberofelements,1);
 
-disp('      boundary conditions for diagnostic model: ');
-%Create grid on boundary fist (because wi can not use mesh)
-md.gridonboundary=zeros(md.numberofgrids,1);
-pos=find(md.x==0 | md.y==0 | md.x==max(md.x) | md.y==max(md.y));
-md.gridonboundary(pos)=1;
-md.gridondirichlet_diag=zeros(md.numberofgrids,1);
-pos=find(md.gridonboundary);md.gridondirichlet_diag(pos)=1;
-md.dirichletvalues_diag=zeros(md.numberofgrids,2);
-md.segmentonneumann_diag=zeros(0,3);
-md.gridondirichlet_thermal=zeros(md.numberofgrids,1);
+disp('      boundary conditions for diagnostic model');
+%Create grid on boundary fist (because we cannot use mesh)
+md=SetIceSheetBC(md);
+
+md.np=3;
Index: /issm/trunk/test/Validation/ISMIP/TestB/runme.m
===================================================================
--- /issm/trunk/test/Validation/ISMIP/TestB/runme.m	(revision 4882)
+++ /issm/trunk/test/Validation/ISMIP/TestB/runme.m	(revision 4883)
@@ -12,27 +12,29 @@
 md=extrude(md,10,1);
 
-%Create dirichlet on the bed on top of the boundary
-pos=find(md.gridonbed);
-md.gridondirichlet_diag(pos)=1;
-
 %md=setelementstype(md,'pattyn','all','stokes','all'); 
 md=setelementstype(md,'pattyn','all');
 
 %Create dirichlet on the bed only
-md.gridondirichlet_diag=zeros(md.numberofgrids,1);
+md.spcvelocity=zeros(md.numberofgrids,6);
 pos=find(md.gridonbed);
-md.gridondirichlet_diag(pos)=1;
+md.spcvelocity(pos,1:2)=1;
 
-%Create MPCs to have periodic boundary conditions
-posx=find(md.x==0);
-posx2=find(md.x==max(md.x));
-
-posy=find(md.y==0 & md.x~=0 & md.x~=max(md.x)); %Don't take the same grids two times
-posy2=find(md.y==max(md.y) & md.x~=0 & md.x~=max(md.x));
-
-md.penalties=[posx,posx2;posy,posy2];
+%%Create MPCs to have periodic boundary conditions
+%posx=find(md.x==0);
+%posx2=find(md.x==max(md.x));
+%
+%posy=find(md.y==0 & md.x~=0 & md.x~=max(md.x)); %Don't take the same grids two times
+%posy2=find(md.y==max(md.y) & md.x~=0 & md.x~=max(md.x));
+%
+%md.penalties=[posx,posx2;posy,posy2];
 
 %Compute the diagnostic
-md=solve(md,'analysis_type','diagnostic','package','ice');
+md=solve(md,'analysis_type',DiagnosticSolutionEnum);
+vx=zeros(md.numberofgrids,1);
+vx(md.results.DiagnosticSolution.Vx.index)=md.results.DiagnosticSolution.Vx.value;
+vy=zeros(md.numberofgrids,1);
+vy(md.results.DiagnosticSolution.Vy.index)=md.results.DiagnosticSolution.Vy.value;
+vz=zeros(md.numberofgrids,1);
+vz(md.results.DiagnosticSolution.Vz.index)=md.results.DiagnosticSolution.Vz.value;
 
-plotmodel(md,'data',md.results.diagnostic.vx,'data',md.results.diagnostic.vy,'data',md.results.diagnostic.vz,'layer#all',md.numlayers)
+plotmodel(md,'data',vx,'data',vy,'data',vz,'layer#all',md.numlayers,'contourlevels',{9.2,18.4,27.6,46,73.6,82.8},'contourlevels',{0,-1.2,-0.9,-0.6,-0.3,1.2},'contourlevels',{-5.2,-3.9,-1.3,0,1.3,3.9,5.2})
Index: /issm/trunk/test/Validation/ISMIP/TestC/Square.par
===================================================================
--- /issm/trunk/test/Validation/ISMIP/TestC/Square.par	(revision 4882)
+++ /issm/trunk/test/Validation/ISMIP/TestC/Square.par	(revision 4883)
@@ -22,10 +22,4 @@
 disp('      boundary conditions for diagnostic model: ');
 %Create grid on boundary fist (because wi can not use mesh)
-md.gridonboundary=zeros(md.numberofgrids,1);
-pos=find(md.x==0 | md.y==0 | md.x==max(md.x) | md.y==max(md.y));
-md.gridonboundary(pos)=1;
-md.gridondirichlet_diag=zeros(md.numberofgrids,1);
-pos=find(md.gridonboundary);md.gridondirichlet_diag(pos)=1;
-md.dirichletvalues_diag=zeros(md.numberofgrids,2);
-md.segmentonneumann_diag=zeros(0,3);
-md.gridondirichlet_thermal=ones(md.numberofgrids,1); %surface temperature
+md=SetIceSheetBC(md);
+md.np=3;
Index: /issm/trunk/test/Validation/ISMIP/TestC/runme.m
===================================================================
--- /issm/trunk/test/Validation/ISMIP/TestC/runme.m	(revision 4882)
+++ /issm/trunk/test/Validation/ISMIP/TestC/runme.m	(revision 4883)
@@ -15,21 +15,21 @@
 %md=setelementstype(md,'pattyn','all','stokes','all'); 
 
-%Add dirichlet values on the corners (we need dirichlet somewhere
-md.gridondirichlet_diag=zeros(md.numberofgrids,1);
-pos=find((md.x==0 |md.x==L) & (md.y==0 | md.y==L));
-%pos=find((md.x==0 |md.x==L | md.y==0 | md.y==L)); %dirichlet on all the boundaries
-md.gridondirichlet_diag(pos)=1;
-
-%Create MPCs to have periodic boundary conditions
-posx=find(md.x==0);
-posx2=find(md.x==L);
-
-posy=find(md.y==0 & md.x~=0 & md.x~=L); %Don't take the same grids two times
-posy2=find(md.y==L & md.x~=0 & md.x~=L);
-
-md.penalties=[posx,posx2;posy,posy2];
+%%Create MPCs to have periodic boundary conditions
+%posx=find(md.x==0);
+%posx2=find(md.x==L);
+%
+%posy=find(md.y==0 & md.x~=0 & md.x~=L); %Don't take the same grids two times
+%posy2=find(md.y==L & md.x~=0 & md.x~=L);
+%
+%md.penalties=[posx,posx2;posy,posy2];
 
 %Compute the diagnostic
-md=solve(md,'analysis_type','diagnostic','package','ice');
+md=solve(md,'analysis_type',DiagnosticSolutionEnum);
+vx=zeros(md.numberofgrids,1);
+vx(md.results.DiagnosticSolution.Vx.index)=md.results.DiagnosticSolution.Vx.value;
+vy=zeros(md.numberofgrids,1);
+vy(md.results.DiagnosticSolution.Vy.index)=md.results.DiagnosticSolution.Vy.value;
+vz=zeros(md.numberofgrids,1);
+vz(md.results.DiagnosticSolution.Vz.index)=md.results.DiagnosticSolution.Vz.value;
 
-plotmodel(md,'data',md.results.diagnostic.vx,'data',md.results.diagnostic.vy,'data',md.results.diagnostic.vz,'layer#all',md.numlayers,'contourlevels',{10.878,16.317,21.756,43.51,59.829},'contourlevels',{-2.421,-1.614,-0.807,3.228},'contourlevels',{-2.48,-1.86,0,0.62,1.24,1.86,2.48})
+plotmodel(md,'data',vx,'data',vy,'data',vz,'layer#all',md.numlayers,'contourlevels',{10.878,16.317,21.756,43.51,59.829},'contourlevels',{-2.421,-1.614,-0.807,3.228},'contourlevels',{-2.48,-1.86,0,0.62,1.24,1.86,2.48})
Index: /issm/trunk/test/Validation/ISMIP/TestD/Square.par
===================================================================
--- /issm/trunk/test/Validation/ISMIP/TestD/Square.par	(revision 4882)
+++ /issm/trunk/test/Validation/ISMIP/TestD/Square.par	(revision 4883)
@@ -22,10 +22,5 @@
 disp('      boundary conditions for diagnostic model: ');
 %Create grid on boundary fist (because wi can not use mesh)
-md.gridonboundary=zeros(md.numberofgrids,1);
-pos=find(md.x==0 | md.y==0 | md.x==max(md.x) | md.y==max(md.y));
-md.gridonboundary(pos)=1;
-md.gridondirichlet_diag=zeros(md.numberofgrids,1);
-pos=find(md.gridonboundary);md.gridondirichlet_diag(pos)=1;
-md.dirichletvalues_diag=zeros(md.numberofgrids,2);
-md.segmentonneumann_diag=zeros(0,3);
-md.gridondirichlet_thermal=ones(md.numberofgrids,1); %surface temperature
+md=SetIceSheetBC(md);
+
+md.np=3;
Index: /issm/trunk/test/Validation/ISMIP/TestD/runme.m
===================================================================
--- /issm/trunk/test/Validation/ISMIP/TestD/runme.m	(revision 4882)
+++ /issm/trunk/test/Validation/ISMIP/TestD/runme.m	(revision 4883)
@@ -16,9 +16,4 @@
 %md=setelementstype(md,'pattyn','all','stokes','all'); 
 
-%No dirichlet in this model, just periodic boundary conditions
-md.gridondirichlet_diag=zeros(md.numberofgrids,1);
-pos=find((md.x==0 |md.x==80000 ) & (md.y==0 | md.y==80000));
-md.gridondirichlet_diag(pos)=1;
-
 %We need one grd on dirichlet (in the middle)
 %md.gridondirichlet_diag(33)=1;
@@ -35,5 +30,11 @@
 
 %Compute the diagnostic
-md=solve(md,'analysis_type','diagnostic','package','ice');
+md=solve(md,'analysis_type',DiagnosticSolutionEnum);
+vx=zeros(md.numberofgrids,1);
+vx(md.results.DiagnosticSolution.Vx.index)=md.results.DiagnosticSolution.Vx.value;
+vy=zeros(md.numberofgrids,1);
+vy(md.results.DiagnosticSolution.Vy.index)=md.results.DiagnosticSolution.Vy.value;
+vz=zeros(md.numberofgrids,1);
+vz(md.results.DiagnosticSolution.Vz.index)=md.results.DiagnosticSolution.Vz.value;
 
-plotmodel(md,'data',md.results.diagnostic.vx,'data',md.results.diagnostic.vy,'data',md.results.diagnostic.vz,'layer#all',md.numlayers)
+plotmodel(md,'data',vx,'data',vy,'data',vz,'layer#all',md.numlayers)
Index: /issm/trunk/test/Validation/ISMIP/TestE/Square.par
===================================================================
--- /issm/trunk/test/Validation/ISMIP/TestE/Square.par	(revision 4882)
+++ /issm/trunk/test/Validation/ISMIP/TestE/Square.par	(revision 4883)
@@ -34,10 +34,5 @@
 disp('      boundary conditions for diagnostic model: ');
 %Create grid on boundary fist (because wi can not use mesh)
-md.gridonboundary=zeros(md.numberofgrids,1);
-pos=find(md.x==0 | md.y==0 | md.x==max(md.x) | md.y==max(md.y));
-md.gridonboundary(pos)=1;
-md.gridondirichlet_diag=zeros(md.numberofgrids,1);
-pos=find(md.y==0 | md.y==max(md.y));md.gridondirichlet_diag(pos)=1;
-md.dirichletvalues_diag=zeros(md.numberofgrids,2);
-md.segmentonneumann_diag=zeros(0,3);
-md.gridondirichlet_thermal=ones(md.numberofgrids,1); %surface temperature
+md=SetIceSheetBC(md);
+
+md.np=3;
Index: /issm/trunk/test/Validation/ISMIP/TestE/runme.m
===================================================================
--- /issm/trunk/test/Validation/ISMIP/TestE/runme.m	(revision 4882)
+++ /issm/trunk/test/Validation/ISMIP/TestE/runme.m	(revision 4883)
@@ -13,19 +13,22 @@
 md=extrude(md,10,1);
 
-md.gridondirichlet_diag(find(md.gridonbed))=1; %case 1: no slip
-%md.gridondirichlet_diag(find(md.gridonbed & (md.y<2200 | md.y> 2500)))=1; %case 2: slip between 2200 and 2500m
+md=setelementstype(md,'pattyn','all');
+%md=setelementstype(md,'pattyn','all','stokes','all'); 
 
-%md=setelementstype(md,'pattyn','all');
-md=setelementstype(md,'pattyn','all','stokes','all'); 
-
-md.gridonstokes(find(md.x==0 | md.x==Lx))=0;
-%Create MPCs to have periodic boundary conditions
-posx=find(md.x==0);
-posx2=find(md.x==max(md.x));
-
-md.penalties=[posx,posx2];
+%md.gridonstokes(find(md.x==0 | md.x==Lx))=0;
+%%Create MPCs to have periodic boundary conditions
+%posx=find(md.x==0);
+%posx2=find(md.x==max(md.x));
+%
+%md.penalties=[posx,posx2];
 
 %Compute the diagnostic
-md=solve(md,'analysis_type','diagnostic','package','ice');
+md=solve(md,'analysis_type',DiagnosticSolutionEnum);
+vx=zeros(md.numberofgrids,1);
+vx(md.results.DiagnosticSolution.Vx.index)=md.results.DiagnosticSolution.Vx.value;
+vy=zeros(md.numberofgrids,1);
+vy(md.results.DiagnosticSolution.Vy.index)=md.results.DiagnosticSolution.Vy.value;
+vz=zeros(md.numberofgrids,1);
+vz(md.results.DiagnosticSolution.Vz.index)=md.results.DiagnosticSolution.Vz.value;
 
-plotmodel(md,'data',md.results.diagnostic.vx,'data',md.results.diagnostic.vy,'data',md.results.diagnostic.vz,'layer#all',md.numlayers)
+plotmodel(md,'data',vx,'data',vy,'data',vz,'layer#all',md.numlayers)
Index: /issm/trunk/test/Validation/ISMIP/TestF/Square.par
===================================================================
--- /issm/trunk/test/Validation/ISMIP/TestF/Square.par	(revision 4882)
+++ /issm/trunk/test/Validation/ISMIP/TestF/Square.par	(revision 4883)
@@ -37,5 +37,5 @@
 md.connectivity=200;
 md.np=8;
-md.cluster='astrid';
+md.cluster='wilkes';
 md.time=50;
 
Index: /issm/trunk/test/Validation/ISMIP/TestF/runme.m
===================================================================
--- /issm/trunk/test/Validation/ISMIP/TestF/runme.m	(revision 4882)
+++ /issm/trunk/test/Validation/ISMIP/TestF/runme.m	(revision 4883)
@@ -8,8 +8,8 @@
 md=model;
 %md=squaremesh(md,L,L,nx,ny);
-md=mesh(md,'DomainOutline.exp',2500);
+md=mesh(md,'DomainOutline.exp',5500);
 md=geography(md,'',''); %ice sheet test
 md=parameterize(md,'Square.par');
-md=extrude(md,10,1);
+md=extrude(md,5,1);
 
 md=setelementstype(md,'pattyn','all');
@@ -31,5 +31,11 @@
 
 %Compute the diagnostic
-md=solve(md,'analysis_type','transient');
+md=solve(md,'analysis_type',Transient3DSolutionEnum);
+vx=zeros(md.numberofgrids,1);
+vx(md.results.Transient2DSolution(end).Vx.index)=md.results.Transient3DSolution.Vx(end).value;
+vy=zeros(md.numberofgrids,1);
+vy(md.results.Transient3DSolution.Vy(end).index)=md.results.Transient3DSolution.Vy(end).value;
+vz=zeros(md.numberofgrids,1);
+vz(md.results.Transient3DSolution.Vz(end).index)=md.results.Transient3DSolution(end).Vz.value;
 
-%plotmodel(md,'data',md.results.diagnostic.vx,'data',md.results.diagnostic.vy,'data',md.results.diagnostic.vz,'layer#all',md.numlayers,'contourlevels',{9.2,18.4,27.6,46,73.6,82.8},'contourlevels',{0,-1.2,-0.9,-0.6,-0.3,1.2},'contourlevels',{-5.2,-3.9,-1.3,0,1.3,3.9,5.2})
+%plotmodel(md,'data',vx,'data',vy,'data',vz,'layer#all',md.numlayers,'contourlevels',{9.2,18.4,27.6,46,73.6,82.8},'contourlevels',{0,-1.2,-0.9,-0.6,-0.3,1.2},'contourlevels',{-5.2,-3.9,-1.3,0,1.3,3.9,5.2})
