Index: /issm/trunk/test/Verification/test29_MassFlux/DomainOutline.exp
===================================================================
--- /issm/trunk/test/Verification/test29_MassFlux/DomainOutline.exp	(revision 4956)
+++ /issm/trunk/test/Verification/test29_MassFlux/DomainOutline.exp	(revision 4956)
@@ -0,0 +1,10 @@
+## Name:domainoutline
+## Icon:0
+# Points Count  Value
+5 1.
+# X pos Y pos
+0 0
+1 0 
+1 1 
+0 1 
+0 0 
Index: /issm/trunk/test/Verification/test29_MassFlux/Front.exp
===================================================================
--- /issm/trunk/test/Verification/test29_MassFlux/Front.exp	(revision 4956)
+++ /issm/trunk/test/Verification/test29_MassFlux/Front.exp	(revision 4956)
@@ -0,0 +1,10 @@
+## Name:icefront
+## Icon:0
+# Points Count  Value
+5 1.
+# X pos Y pos
+-1000 900000
+-1000 1100000
+1100000 1100000
+1100000 900000
+-1000 900000
Index: /issm/trunk/test/Verification/test29_MassFlux/Lrel29.m
===================================================================
--- /issm/trunk/test/Verification/test29_MassFlux/Lrel29.m	(revision 4956)
+++ /issm/trunk/test/Verification/test29_MassFlux/Lrel29.m	(revision 4956)
@@ -0,0 +1,31 @@
+%Dakota options
+md.variables.nuv=normal_uncertain.empty();
+md.variables.nuv(end+1)=normal_uncertain('DragCoefficient',1,0.01);
+
+md.responses=struct();
+md.responses.rf =response_function.empty();
+md.responses.rf (end+1)=response_function('MaxVel',[],[0.0001 0.001 0.01 0.25 0.5 0.75 0.99 0.999 0.9999]);
+md.responses.rf (end+1)=response_function('MassFlux1',[],[0.0001 0.001 0.01 0.25 0.5 0.75 0.99 0.999 0.9999]);
+md.responses.rf (end+1)=response_function('MassFlux2',[],[0.0001 0.001 0.01 0.25 0.5 0.75 0.99 0.999 0.9999]);
+md.responses.rf (end+1)=response_function('MassFlux3',[],[0.0001 0.001 0.01 0.25 0.5 0.75 0.99 0.999 0.9999]);
+
+%mass flux profiles
+md.qmu_mass_flux_profiles={'MassFlux1.exp','MassFlux2.exp','MassFlux3.exp'};
+md.qmu_mass_flux_profile_directory=pwd;
+
+
+md.qmu_method     =dakota_method('nond_l');
+
+md.qmu_params.direct=true;
+md.qmu_params.analysis_driver='diagnostic';
+md.qmu_params.evaluation_concurrency=1;
+md.qmu_params.interval_type='forward';
+md.qmu_params.tabular_graphics_data=true;
+
+%partitioning
+md.npart=20;
+md=partitioner(md,'package','chaco','npart',md.npart,'weighting','on');
+md.part=md.part-1;
+md.qmu_analysis=1;
+
+md.eps_rel=10^-10; %tighten for qmu analyses
Index: /issm/trunk/test/Verification/test29_MassFlux/MassFlux1.exp
===================================================================
--- /issm/trunk/test/Verification/test29_MassFlux/MassFlux1.exp	(revision 4956)
+++ /issm/trunk/test/Verification/test29_MassFlux/MassFlux1.exp	(revision 4956)
@@ -0,0 +1,7 @@
+## Name:MassFlux1
+## Icon:0
+# Points Count Value
+2 1.000000
+# X pos Y pos
+.2 .4 
+.5 .8
Index: /issm/trunk/test/Verification/test29_MassFlux/MassFlux2.exp
===================================================================
--- /issm/trunk/test/Verification/test29_MassFlux/MassFlux2.exp	(revision 4956)
+++ /issm/trunk/test/Verification/test29_MassFlux/MassFlux2.exp	(revision 4956)
@@ -0,0 +1,7 @@
+## Name:MassFlux2
+## Icon:0
+# Points Count Value
+2 1.000000
+# X pos Y pos
+.5 .8
+.8 .4
Index: /issm/trunk/test/Verification/test29_MassFlux/MassFlux3.exp
===================================================================
--- /issm/trunk/test/Verification/test29_MassFlux/MassFlux3.exp	(revision 4956)
+++ /issm/trunk/test/Verification/test29_MassFlux/MassFlux3.exp	(revision 4956)
@@ -0,0 +1,7 @@
+## Name:MassFlux3
+## Icon:0
+# Points Count Value
+2 1.000000
+# X pos Y pos
+.2 .4 
+.8 .4
Index: /issm/trunk/test/Verification/test29_MassFlux/Square.par
===================================================================
--- /issm/trunk/test/Verification/test29_MassFlux/Square.par	(revision 4956)
+++ /issm/trunk/test/Verification/test29_MassFlux/Square.par	(revision 4956)
@@ -0,0 +1,47 @@
+%Start defining model parameters here
+
+%dynamics
+md.verbose=0;
+md.dt=1; %1 year
+md.ndt=md.dt*10; 
+md.artificial_diffusivity=0;
+md.mem_debug=0;
+
+%special values 
+md.rho_ice=1;
+
+hconstant=1;
+md.thickness=hconstant*ones(md.numberofgrids,1);
+md.bed=-md.rho_ice/md.rho_water*md.thickness+100;
+md.surface=md.bed+md.thickness;
+
+md.drag_type=2; %0 none 1 plastic 2 viscous
+md.drag_coefficient=20*ones(md.numberofgrids,1); %q=1.
+%Take care of iceshelves: no basal drag
+pos=find(md.elementoniceshelf);
+md.drag_coefficient(md.elements(pos,:))=0;
+md.drag_p=ones(md.numberofelements,1);
+md.drag_q=ones(md.numberofelements,1);
+md.viscosity_overshoot=0.3;
+
+md.observed_temperature=(273-20)*ones(md.numberofgrids,1);
+
+md.rheology_B=paterson(md.observed_temperature);
+md.rheology_n=3*ones(md.numberofelements,1);
+
+%Deal with boundary conditions:
+md=SetMarineIceSheetBC(md,'Front.exp');
+
+%Parallel options
+md.np=8;
+md.time=50;
+md.waitonlock=30;
+
+%constrain all velocities to 1 m/yr, in the y-direction
+md.spcvelocity(:,1:3)=1;
+md.spcvelocity(:,4)=0;
+md.spcvelocity(:,5)=1*md.yts;
+md.spcvelocity(:,6)=0;
+
+%Dakota:
+Lrel29
Index: /issm/trunk/test/Verification/test29_MassFlux/configuration.m
===================================================================
--- /issm/trunk/test/Verification/test29_MassFlux/configuration.m	(revision 4956)
+++ /issm/trunk/test/Verification/test29_MassFlux/configuration.m	(revision 4956)
@@ -0,0 +1,27 @@
+%name
+testname='test29_MassFlux';
+
+%meshing
+resolution=.1;
+domainname='DomainOutline.exp';
+riftname='';
+rifts=0;
+
+%geography
+iceshelfname='';
+icesheetname='';
+
+%parameterization
+parametername='Square.par';
+			
+%elements type
+elementstype='''macayeal'',''all''';
+
+%extrusion
+numlayers=0;
+extrusionexponent=NaN;
+
+%sequences     analysis    sub_analysis  qmu   control  control_fit parallel
+sequences={  {DiagnosticSolutionEnum,  NoneAnalysisEnum,      1 ,     0,      'nan'        0    };...
+			 {DiagnosticSolutionEnum,  NoneAnalysisEnum,      1 ,     0,      'nan'        1    };...
+	};
Index: /issm/trunk/test/Verification/test29_MassFlux/length_profiles.m
===================================================================
--- /issm/trunk/test/Verification/test29_MassFlux/length_profiles.m	(revision 4956)
+++ /issm/trunk/test/Verification/test29_MassFlux/length_profiles.m	(revision 4956)
@@ -0,0 +1,5 @@
+for i=1:3,
+	a=md.qmu_mass_flux_segments{i};
+	%sum(sqrt((a(:,3)-a(:,1)).^2+ (a(:,4)-a(:,2)).^2))
+	[sum(a(:,3)-a(:,1)) sum(a(:,4)-a(:,2))]
+end
Index: /issm/trunk/test/Verification/test29_MassFlux/testpostsolve.m
===================================================================
--- /issm/trunk/test/Verification/test29_MassFlux/testpostsolve.m	(revision 4956)
+++ /issm/trunk/test/Verification/test29_MassFlux/testpostsolve.m	(revision 4956)
@@ -0,0 +1,7 @@
+md=tres(md,'dakota');
+%ok, mass flux of 3 profiles should be -.3, -.3 and the sum, which is -.6
+%we recover those mass fluxes through the mean of the response.
+%also, we recover the max velo, which should be 1m/s. 
+%we put all that data in the importancefactors, which we will use to test for success.
+
+md.results.dakota.importancefactors=[md.results.dakota.dresp_out(1).mean md.results.dakota.dresp_out(2).mean md.results.dakota.dresp_out(3).mean md.results.dakota.dresp_out(4).mean];
Index: /issm/trunk/test/Verification/test29_MassFlux/testpresolve.m
===================================================================
--- /issm/trunk/test/Verification/test29_MassFlux/testpresolve.m	(revision 4956)
+++ /issm/trunk/test/Verification/test29_MassFlux/testpresolve.m	(revision 4956)
@@ -0,0 +1,4 @@
+%rm existing results
+if exist('./qmu')
+	system('rm -rf qmu/');
+end
