md=triangle(model(),'../Exp/Square.exp',50000.);
md=setmask(md,'all','');
md=parameterize(md,'../Par/SquareShelfConstrained.par');
md=setflowequation(md,'SSA','all');
md.cluster=generic('name',oshostname(),'np',2);

%output
md.stressbalance.requested_outputs={'default','DeviatoricStressxx','DeviatoricStressyy','DeviatoricStressxy','MassFlux1','MassFlux2','MassFlux3','MassFlux4','MassFlux5','MassFlux6'};
md.outputdefinition.definitions={...
	massfluxatgate('MassFlux1',['../Exp/MassFlux1.exp']),...
	massfluxatgate('MassFlux2',['../Exp/MassFlux2.exp']),...
	massfluxatgate('MassFlux3',['../Exp/MassFlux3.exp']),...
	massfluxatgate('MassFlux4',['../Exp/MassFlux4.exp']),...
	massfluxatgate('MassFlux5',['../Exp/MassFlux5.exp']),...
	massfluxatgate('MassFlux6',['../Exp/MassFlux6.exp'])...
	};

md=solve(md,StressbalanceSolutionEnum());

%Fields and tolerances to track changes
field_names     ={'Vx','Vy','Vel','Pressure',...
	'DeviatoricStressxx','DeviatoricStressyy','DeviatoricStressxy','MassFlux1','MassFlux2','MassFlux3','MassFlux4','MassFlux5','MassFlux6'};
field_tolerances={2e-13,1e-13,1e-13,1e-13,...
	1e-13,1e-13,1e-13,...
	1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13 };
field_values={...
	(md.results.StressbalanceSolution.Vx),...
	(md.results.StressbalanceSolution.Vy),...
	(md.results.StressbalanceSolution.Vel),...
	(md.results.StressbalanceSolution.Pressure),...
	(md.results.StressbalanceSolution.DeviatoricStressxx),...
	(md.results.StressbalanceSolution.DeviatoricStressyy),...
	(md.results.StressbalanceSolution.DeviatoricStressxy),...
	(md.results.StressbalanceSolution.MassFlux1),...
	(md.results.StressbalanceSolution.MassFlux2),...
	(md.results.StressbalanceSolution.MassFlux3),...
	(md.results.StressbalanceSolution.MassFlux4),...
	(md.results.StressbalanceSolution.MassFlux5),...
	(md.results.StressbalanceSolution.MassFlux6)...
	};
