Index: ../trunk-jpl/test/NightlyRun/test101.m
===================================================================
--- ../trunk-jpl/test/NightlyRun/test101.m	(revision 18943)
+++ ../trunk-jpl/test/NightlyRun/test101.m	(revision 18944)
@@ -7,12 +7,12 @@
 %output
 md.stressbalance.requested_outputs={'default','DeviatoricStressxx','DeviatoricStressyy','DeviatoricStressxy','MassFlux1','MassFlux2','MassFlux3','MassFlux4','MassFlux5','MassFlux6'};
 md.outputdefinition.definitions={...
-	massfluxatgate('name','MassFlux1','profilename',['../Exp/MassFlux1.exp'],'definitionenum',Outputdefinition1Enum),...
-	massfluxatgate('name','MassFlux2','profilename',['../Exp/MassFlux2.exp'],'definitionenum',Outputdefinition2Enum),...
-	massfluxatgate('name','MassFlux3','profilename',['../Exp/MassFlux3.exp'],'definitionenum',Outputdefinition3Enum),...
-	massfluxatgate('name','MassFlux4','profilename',['../Exp/MassFlux4.exp'],'definitionenum',Outputdefinition4Enum),...
-	massfluxatgate('name','MassFlux5','profilename',['../Exp/MassFlux5.exp'],'definitionenum',Outputdefinition5Enum),...
-	massfluxatgate('name','MassFlux6','profilename',['../Exp/MassFlux6.exp'],'definitionenum',Outputdefinition6Enum)...
+	massfluxatgate('name','MassFlux1','profilename',['../Exp/MassFlux1.exp'],'definitionenum',Outputdefinition1Enum()),...
+	massfluxatgate('name','MassFlux2','profilename',['../Exp/MassFlux2.exp'],'definitionenum',Outputdefinition2Enum()),...
+	massfluxatgate('name','MassFlux3','profilename',['../Exp/MassFlux3.exp'],'definitionenum',Outputdefinition3Enum()),...
+	massfluxatgate('name','MassFlux4','profilename',['../Exp/MassFlux4.exp'],'definitionenum',Outputdefinition4Enum()),...
+	massfluxatgate('name','MassFlux5','profilename',['../Exp/MassFlux5.exp'],'definitionenum',Outputdefinition5Enum()),...
+	massfluxatgate('name','MassFlux6','profilename',['../Exp/MassFlux6.exp'],'definitionenum',Outputdefinition6Enum())...
 	};
 
 md=solve(md,StressbalanceSolutionEnum());
Index: ../trunk-jpl/test/NightlyRun/test101.py
===================================================================
--- ../trunk-jpl/test/NightlyRun/test101.py	(revision 18943)
+++ ../trunk-jpl/test/NightlyRun/test101.py	(revision 18944)
@@ -18,12 +18,12 @@
 #outputs
 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')
+		massfluxatgate('name','MassFlux1','profilename','../Exp/MassFlux1.exp','definitionenum',Outputdefinition1Enum()),
+		massfluxatgate('name','MassFlux2','profilename','../Exp/MassFlux2.exp','definitionenum',Outputdefinition2Enum()),
+		massfluxatgate('name','MassFlux3','profilename','../Exp/MassFlux3.exp','definitionenum',Outputdefinition3Enum()),
+		massfluxatgate('name','MassFlux4','profilename','../Exp/MassFlux4.exp','definitionenum',Outputdefinition4Enum()),
+		massfluxatgate('name','MassFlux5','profilename','../Exp/MassFlux5.exp','definitionenum',Outputdefinition5Enum()),
+		massfluxatgate('name','MassFlux6','profilename','../Exp/MassFlux6.exp','definitionenum',Outputdefinition6Enum())
 		]
 
 md=solve(md,StressbalanceSolutionEnum())
Index: ../trunk-jpl/src/m/classes/massfluxatgate.m
===================================================================
--- ../trunk-jpl/src/m/classes/massfluxatgate.m	(revision 18943)
+++ ../trunk-jpl/src/m/classes/massfluxatgate.m	(revision 18944)
@@ -7,12 +7,12 @@
 classdef massfluxatgate
 	properties (SetAccess=public)  
 		%massfluxatgate 
-		name                = '';
-		definitionenum     = NaN; %enum that identifies this output definition uniquely, from Outputdefinition[1-10]Enum
-		profilename            = ''; 
+		name            = '';
+		definitionenum  = 0;
+		profilename     = ''; 
 	end
 	properties (SetAccess=private)  
-		segments            = NaN;
+		segments        = NaN;
 	end
 	methods
 		function obj = massfluxatgate(varargin) % {{{
@@ -39,7 +39,7 @@
 				error('massfluxatgate error message: ''profilename'' field should be a string!');
 			end
 			
-			md = checkfield(md,'fieldname','obj.definitionenum','field',obj.definitionenum,'values',[Outputdefinition1Enum,Outputdefinition2Enum,Outputdefinition3Enum,Outputdefinition4Enum,Outputdefinition5Enum,Outputdefinition6Enum,Outputdefinition7Enum,Outputdefinition8Enum,Outputdefinition9Enum,Outputdefinition10Enum]);
+			md = checkfield(md,'field',obj.definitionenum,'values',[Outputdefinition1Enum(),Outputdefinition2Enum(),Outputdefinition3Enum(),Outputdefinition4Enum(),Outputdefinition5Enum(),Outputdefinition6Enum(),Outputdefinition7Enum(),Outputdefinition8Enum(),Outputdefinition9Enum(),Outputdefinition10Enum()]);
 
 			%check the profilename points to a file!: 
 			if exist(obj.profilename,'file')~=2,
@@ -51,6 +51,7 @@
 
 			fielddisplay(obj,'name','identifier for this massfluxatgate response');
 			fielddisplay(obj,'profilename','name of file (shapefile or argus file) defining a profile (or gate)');
+			fielddisplay(obj,'definitionenum','enum that identifies this output definition uniquely, from Outputdefinition[1-10]Enum');
 			
 		end % }}}
 		function marshall(obj,md,fid) % {{{
Index: ../trunk-jpl/src/m/classes/massfluxatgate.py
===================================================================
--- ../trunk-jpl/src/m/classes/massfluxatgate.py	(revision 18943)
+++ ../trunk-jpl/src/m/classes/massfluxatgate.py	(revision 18944)
@@ -1,5 +1,6 @@
 from fielddisplay import fielddisplay
 from EnumDefinitions import *
+from pairoptions import pairoptions
 from checkfield import checkfield
 from WriteData import WriteData
 from MeshProfileIntersection import MeshProfileIntersection
@@ -13,16 +14,28 @@
 		  massfluxatgate=massfluxatgate('GateName','PathToExpFile')
 	"""
 
-	def __init__(self,name,profilename): # {{{
-		self.name           = name
-		self.profilename    = profilename
-		self.segments       = float('NaN')
+	def __init__(self,*args): # {{{
 
+		self.name            = ''
+		self.definitionenum  = 0
+		self.profilename     = ''
+		self.segments        = float('NaN')
+
+		#set defaults
+		self.setdefaultparameters()
+
+		#use provided options to change fields
+		options=pairoptions(*args)
+
+		#OK get other fields
+		self=options.AssignObjectFields(self)
+
 		#}}}
 	def __repr__(self): # {{{
 
 		string="   Massfluxatgate:"
 		string="%s\n%s"%(string,fielddisplay(self,'name','identifier for this massfluxatgate response'))
+		string="%s\n%s"%(string,fielddisplay(self,'definitionenum','enum that identifies this output definition uniquely, from Outputdefinition[1-10]Enum'))
 		string="%s\n%s"%(string,fielddisplay(self,'profilename','name of file (shapefile or argus file) defining a profile (or gate)'))
 		return string
 		#}}}
@@ -36,6 +49,8 @@
 			
 		if  not isinstance(self.profilename, basestring):
 			raise RuntimeError("massfluxatgate error message: 'profilename' field should be a string!") 
+
+			md = checkfield(md,'field',self.definitionenum,'values',[Outputdefinition1Enum(),Outputdefinition2Enum(),Outputdefinition3Enum(),Outputdefinition4Enum(),Outputdefinition5Enum(),Outputdefinition6Enum(),Outputdefinition7Enum(),Outputdefinition8Enum(),Outputdefinition9Enum(),Outputdefinition10Enum()])
 		
 		#check the profilename points to a file!: 
 		if not os.path.isfile(self.profilename):
@@ -50,6 +65,7 @@
 
 		#ok, marshall name and segments: 
 		WriteData(fid,'object',self,'fieldname','name','format','String')
+		WriteData(fid,'object',self,'fieldname','definitionenum','format','Integer')
 		WriteData(fid,'object',self,'fieldname','segments','format','DoubleMat','mattype',1)
 
 	# }}}
