Index: /issm/branches/trunk-larour-SLPS2022/src/m/classes/qmu.m
===================================================================
--- /issm/branches/trunk-larour-SLPS2022/src/m/classes/qmu.m	(revision 27749)
+++ /issm/branches/trunk-larour-SLPS2022/src/m/classes/qmu.m	(revision 27750)
@@ -226,5 +226,7 @@
 				return;
 			end
-			WriteData(fid,prefix,'data',self.method.params.samples,'name','md.qmu.method.params.samples','format','Integer');
+			if strcmpi(self.method.method,'nond_sampling'),
+				WriteData(fid,prefix,'data',self.method.params.samples,'name','md.qmu.method.params.samples','format','Integer');
+			end
 			WriteData(fid,prefix,'object',self,'fieldname','numberofresponses','format','Integer');
 			WriteData(fid,prefix,'object',self,'fieldname','variabledescriptors','format','StringArray');
Index: /issm/branches/trunk-larour-SLPS2022/src/m/classes/qmu/continuous_design.m
===================================================================
--- /issm/branches/trunk-larour-SLPS2022/src/m/classes/qmu/continuous_design.m	(revision 27749)
+++ /issm/branches/trunk-larour-SLPS2022/src/m/classes/qmu/continuous_design.m	(revision 27750)
@@ -38,119 +38,98 @@
 		scale_type='none';
 		scale     = 1.;
+		partition = [];
+		nsteps    = 0;
 	end
 
 	methods
-		function [cdv]=continuous_design(varargin)
-
-			switch nargin
-
-				%  create a default object
-
-				case 0
-
-					%  copy the object
-
-				case 1
-					if isa(varargin{1},'continuous_design')
-						cdv=varargin{1};
-					else
-						error('Object ''%s'' is a ''%s'' class object, not ''%s''.',...
-							inputname(1),class(varargin{1}),'continuous_design');
-					end
-
-					%  create the object from the input
-
-				otherwise
-					asizec=num2cell(array_size(varargin{1:min(nargin,6)}));
-					cdv(asizec{:})=continuous_design;
-					clear asizec
-
-					if ischar(varargin{1})
-						varargin{1}=cellstr(varargin{1});
-					end
-					for i=1:numel(cdv)
-						if (numel(varargin{1}) > 1)
-							cdv(i).descriptor=varargin{1}{i};
-						else
-							cdv(i).descriptor=[char(varargin{1}) string_dim(cdv,i,'vector')];
-						end
-					end
-
-					if (nargin >= 2)
-						for i=1:numel(cdv)
-							if (numel(varargin{2}) > 1)
-								cdv(i).initpt    =varargin{2}(i);
-							else
-								cdv(i).initpt    =varargin{2};
-							end
-						end
-						if (nargin >= 3)
-							for i=1:numel(cdv)
-								if (numel(varargin{3}) > 1)
-									cdv(i).lower     =varargin{3}(i);
-								else
-									cdv(i).lower     =varargin{3};
-								end
-							end
-							if (nargin >= 4)
-								for i=1:numel(cdv)
-									if (numel(varargin{4}) > 1)
-										cdv(i).upper     =varargin{4}(i);
-									else
-										cdv(i).upper     =varargin{4};
-									end
-								end
-								if (nargin >= 5)
-									if ischar(varargin{5})
-										varargin{5}=cellstr(varargin{5});
-									end
-									for i=1:numel(cdv)
-										if (numel(varargin{5}) > 1)
-											cdv(i).scale_type=varargin{5}{i};
-										else
-											cdv(i).scale_type=char(varargin{5});
-										end
-									end
-									if (nargin >= 6)
-										for i=1:numel(cdv)
-											if (numel(varargin{6}) > 1)
-												cdv(i).scale     =varargin{6}(i);
-											else
-												cdv(i).scale     =varargin{6};
-											end
-										end
-										if (nargin > 6)
-											warning('continuous_design:extra_arg',...
-												'Extra arguments for object of class ''%s''.',...
-												class(cdv));
-										end
-									end
-								end
-							end
-						end
-					end
-			end
-
-		end
-
-		function []=disp(cdv)
-
-			%  display the object
-
-			disp(sprintf('\n'));
-			for i=1:numel(cdv)
-				disp(sprintf('class ''%s'' object ''%s%s'' = \n',...
-					class(cdv),inputname(1),string_dim(cdv,i)));
-				disp(sprintf('    descriptor: ''%s'''  ,cdv(i).descriptor));
-				disp(sprintf('        initpt: %g'      ,cdv(i).initpt));
-				disp(sprintf('         lower: %g'      ,cdv(i).lower));
-				disp(sprintf('         upper: %g'      ,cdv(i).upper));
-				disp(sprintf('    scale_type: ''%s'''  ,cdv(i).scale_type));
-				disp(sprintf('         scale: %g\n'    ,cdv(i).scale));
-			end
-
-		end
-
-		function [desc]  =prop_desc(cdv,dstr)
+		function self=continuous_design(varargin) % {{{
+
+			%recover options:
+			options=pairoptions(varargin{:});
+
+			%initialize fields:
+			self.descriptor=getfieldvalue(options,'descriptor');
+			self.initpt=getfieldvalue(options,'initpt');
+			self.lower=getfieldvalue(options,'lower');
+			self.upper=getfieldvalue(options,'upper');
+			self.scale_type=getfieldvalue(options,'scale_type','none');
+			self.scale=getfieldvalue(options,'scale',1.);
+
+			%if the variable is scaled,  a partition vector should have been 
+			%supplied, and that partition vector should have as many partitions 
+			%as the upper and lower vectors: 
+			if self.isscaled() | self.isdistributed(),
+				self.partition=getfieldvalue(options,'partition');
+				self.nsteps=getfieldvalue(options,'nsteps',1);
+				npart=qmupart2npart(self.partition);
+				if npart~=size(self.upper,1),
+					error(['continuous_design constructor: for the scaled variable ' self.descriptor ' the row size of the upper field should be identical to the number of partitions']);
+				end
+				if npart~=size(self.lower,1),
+					error(['continuous_design constructor: for the scaled variable ' self.descriptor ' the row size of the lower field should be identical to the number of partitions']);
+				end
+				if self.nsteps~=size(self.upper,2),
+					error(['continuous_design constructor: for the scaled variable ' self.descriptor ' the col size of the upper field should be identical to the number of time steps']);
+				end
+				if self.nsteps~=size(self.lower,2),
+					error(['continuous_design constructor: for the scaled variable ' self.descriptor ' the col size of the lower field should be identical to the number of time steps']);
+				end
+
+			end
+
+
+
+		end % }}}
+		function disp(self) % {{{
+
+			disp(sprintf('   continuous design variable: '));
+			fielddisplay(self,'descriptor','name tag');
+			fielddisplay(self,'initpt','initial point');
+			fielddisplay(self,'lower','lower values');
+			fielddisplay(self,'upper','upper values');
+			fielddisplay(self,'scale_type','scale type');
+			fielddisplay(self,'scale','scale');
+
+		end % }}}
+			function md=checkconsistency(self,md,solution,analyses) % {{{
+
+			md = checkfield(md,'field',self.upper,'fieldname','continuous_design.upper','NaN',1,'Inf',1,'>=',0);
+			md = checkfield(md,'field',self.lower,'fieldname','continuous_design.lower','NaN',1,'Inf',1,'>=',0);
+			if self.isscaled(),
+				if isempty(self.partition),
+					error('continuous_design is a scaled variable, but it''s missing a partition vector');
+				end
+				%better have a partition vector that has as many partitions as loer's size:
+				if size(self.lower,1)~=partition_npart(self.partition),
+					error('continuous_design error message: row size of lower and partition size should be identical');
+				end
+				if size(self.upper,1)~=partition_npart(self.partition),
+					error('continuous_design error message: row size of upper and partition size should be identical');
+				end
+				%we need as steps in lower and upper as there are time steps: 
+				if size(self.lower,2)~=self.nsteps,
+					error('continuous_design error message: col size of lower and number of time steps should be identical');
+				end
+				if size(self.upper,2)~=self.nsteps,
+					error('continuous_design error message: col size of upper and number of time steps should be identical');
+				end
+
+				md = checkfield(md,'field',self.partition,'fieldname','continuous_design.partition','NaN',1,'Inf',1,'>=',-1,'numel',[md.mesh.numberofvertices,md.mesh.numberofelements]);
+				if size(self.partition,2)>1,
+					error('continuous_design error message: partition should be a column vector');
+				end
+				partcheck=unique(self.partition);
+				partmin=min(partcheck);
+				partmax=max(partcheck);
+				if partmax<-1,
+					error('continuous_design error message: partition vector''s min value should be -1 (for no partition), or start at 0');
+				end
+				nmax=max(md.mesh.numberofelements,md.mesh.numberofvertices);
+				if partmax>nmax,
+					error('continuous_design error message: partition vector''s values cannot go over the number of vertices or elements');
+				end
+			end
+		end % }}}
+		function [desc]  =prop_desc(cdv,dstr) % {{{
 			desc=cell(1,numel(cdv));
 			for i=1:numel(cdv)
@@ -166,6 +145,6 @@
 			end
 			desc=allempty(desc);
-		end
-		function [initpt]=prop_initpt(cdv)
+		end % }}}
+		function [initpt]=prop_initpt(cdv) % {{{
 			initpt=zeros(1,numel(cdv));
 			for i=1:numel(cdv)
@@ -173,6 +152,6 @@
 			end
 			initpt=allequal(initpt,0.);
-		end
-		function [lower] =prop_lower(cdv)
+		end % }}}
+		function [lower] =prop_lower(cdv) % {{{
 			lower=zeros(1,numel(cdv));
 			for i=1:numel(cdv)
@@ -180,6 +159,6 @@
 			end
 			lower=allequal(lower,-Inf);
-		end
-		function [upper] =prop_upper(cdv)
+		end % }}}
+		function [upper] =prop_upper(cdv) % {{{
 			upper=zeros(1,numel(cdv));
 			for i=1:numel(cdv)
@@ -187,15 +166,15 @@
 			end
 			upper=allequal(upper, Inf);
-		end
-		function [mean]  =prop_mean(cdv)
+		end % }}}
+		function [mean]  =prop_mean(cdv) % {{{
 			mean=[];
-		end
-		function [stddev]=prop_stddev(cdv)
+		end % }}}
+		function [stddev]=prop_stddev(cdv)  % {{{
 			stddev=[];
-		end
-		function [initst]=prop_initst(cdv)
+		end % }}}
+		function [initst]=prop_initst(cdv) % {{{
 			initst=[];
-		end
-		function [stype] =prop_stype(cdv)
+		end % }}}
+		function [stype] =prop_stype(cdv) % {{{
 			stype=cell(1,numel(cdv));
 			for i=1:numel(cdv)
@@ -203,6 +182,6 @@
 			end
 			stype=allequal(stype,'none');
-		end
-		function [scale] =prop_scale(cdv)
+		end % }}}
+		function [scale] =prop_scale(cdv) % {{{
 			scale=zeros(1,numel(cdv));
 			for i=1:numel(cdv)
@@ -210,5 +189,5 @@
 			end
 			scale=allequal(scale,1.);
-		end
+		end % }}}
 		function [abscissas] =prop_abscissas(hbu) % {{{
             abscissas=[]; 
@@ -220,20 +199,28 @@
 			pairs_per_variable=[];
         end % }}}
-		function checkconsistency(self,md,solution,analyses) % {{{
-		end % }}}
-
+		%new methods:
+			function distributed=isdistributed(self) % {{{
+				if strncmp(self.descriptor,'distributed_',12),
+					distributed=1;
+				else
+					distributed=0;
+				end
+			end % }}}
+				function scaled=isscaled(self) % {{{
+					if strncmp(self.descriptor,'scaled_',7),
+						scaled=1;
+					else
+						scaled=0;
+					end
+				end % }}}
 	end
 
 	methods (Static)
-		function []=dakota_write(fidi,dvar)
-
+		function []=dakota_write(fidi,dvar) % {{{
 			%  collect only the variables of the appropriate class
-
 			cdv=struc_class(dvar,'continuous_design');
-
 			%  write variables
-
 			vlist_write(fidi,'continuous_design','cdv',cdv);
-		end
+		end % }}}
 	end
 end
Index: /issm/branches/trunk-larour-SLPS2022/src/m/classes/qmu/normal_uncertain.m
===================================================================
--- /issm/branches/trunk-larour-SLPS2022/src/m/classes/qmu/normal_uncertain.m	(revision 27749)
+++ /issm/branches/trunk-larour-SLPS2022/src/m/classes/qmu/normal_uncertain.m	(revision 27750)
@@ -34,5 +34,5 @@
 			%supplied, and that partition vector should have as many partitions 
 			%as the mean and stddev vectors:
-			if self.isscaled(),
+			if self.isscaled() | self.isdistributed(),
 				self.partition=getfieldvalue(options,'partition');
 				self.nsteps=getfieldvalue(options,'nsteps',1);
Index: /issm/branches/trunk-larour-SLPS2022/src/m/qmu/dakota_m_write.m
===================================================================
--- /issm/branches/trunk-larour-SLPS2022/src/m/qmu/dakota_m_write.m	(revision 27749)
+++ /issm/branches/trunk-larour-SLPS2022/src/m/qmu/dakota_m_write.m	(revision 27750)
@@ -155,5 +155,4 @@
 
 function [ixc]=vsets_write(fidm,ixc,dvar,variables,params,varargin)
-
 for i=1:length(variables)
     if isfield(dvar,variables{i})
Index: /issm/branches/trunk-larour-SLPS2022/src/m/qmu/postqmu.m
===================================================================
--- /issm/branches/trunk-larour-SLPS2022/src/m/qmu/postqmu.m	(revision 27749)
+++ /issm/branches/trunk-larour-SLPS2022/src/m/qmu/postqmu.m	(revision 27750)
@@ -47,4 +47,15 @@
 		end
 	end
+	if strcmpi(md.qmu.method.method,'list_parameter_study'),
+		dakotaresults.modelresults={};
+		md2=md;
+		md2.qmu.isdakota=0;
+		for i=md.qmu.method.params.list_of_points,
+			disp(['Reading qmu file ' md2.miscellaneous.name '.outbin.' num2str(i)]);
+			md2=loadresultsfromdisk(md2,[md2.miscellaneous.name '.outbin.' num2str(i)]);
+			dakotaresults.modelresults{end+1}=md2.results;
+		end
+	end
+
 end
 if ~strcmpi(md.qmu.statistics.method(1).name,'None'),
Index: /issm/branches/trunk-larour-SLPS2022/src/m/qmu/preqmu.m
===================================================================
--- /issm/branches/trunk-larour-SLPS2022/src/m/qmu/preqmu.m	(revision 27749)
+++ /issm/branches/trunk-larour-SLPS2022/src/m/qmu/preqmu.m	(revision 27750)
@@ -23,5 +23,5 @@
 
 %retrieve variables and resposnes for this particular analysis.
-variables=md.qmu.variables(ivar);
+variables=md.qmu.variables(ivar)
 responses=md.qmu.responses(iresp);
 
Index: /issm/branches/trunk-larour-SLPS2022/src/m/qmu/setupdesign/QmuSetupVariables.m
===================================================================
--- /issm/branches/trunk-larour-SLPS2022/src/m/qmu/setupdesign/QmuSetupVariables.m	(revision 27749)
+++ /issm/branches/trunk-larour-SLPS2022/src/m/qmu/setupdesign/QmuSetupVariables.m	(revision 27750)
@@ -38,5 +38,15 @@
 			error('QmuSetupVariables error message: stddev and mean fields should have the same number of cols as the number of time steps');
 		end
-
+	elseif isa(variables,'continuous_design'),
+		nupper=size(variables.upper,1);
+		nlower=size(variables.lower,1);
+		if (nupper ~= npart || nlower ~=npart),
+			error('QmuSetupVariables error message: upper and lower fields should have the same number of rows as the number of partitions');
+		end
+		nupper=size(variables.upper,2);
+		nlower=size(variables.lower,2);
+		if (nupper ~= nt || nlower ~=nt),
+			error('QmuSetupVariables error message: upper and lower fields should have the same number of cols as the number of time steps');
+		end
 	end
 
@@ -53,4 +63,8 @@
 				dvar(end  ).stddev=variables.stddev(j);
 				dvar(end  ).mean=variables.mean(j);
+			elseif isa(variables,'continuous_design'),
+				dvar(end  ).upper=variables.upper(j);
+				dvar(end  ).lower=variables.lower(j);
+				dvar(end  ).initpt=variables.initpt(j);
 			end
 		end
@@ -66,4 +80,8 @@
 					dvar(end  ).stddev=variables.stddev(j,k);
 					dvar(end  ).mean=variables.mean(j,k);
+				elseif isa(variables,'continuous_design'),
+					dvar(end  ).upper=variables.upper(j,k);
+					dvar(end  ).lower=variables.lower(j,k);
+					dvar(end  ).initpt=variables.initpt(j,k);
 				end
 			end
@@ -90,4 +108,10 @@
 		if (nstddev ~= npart || nmean ~=npart),
 			error('QmuSetupVariables error message: stddev and mean fields should have the same number of rows as the number of partitions');
+		end
+	elseif isa(variables,'continuous_design'),
+		nupper=size(variables.upper,1);
+		nlower=size(variables.lower,1);
+		if (nupper ~= npart || nlower ~=npart),
+			error('QmuSetupVariables error message: upper and lower fields should have the same number of rows as the number of partitions');
 		end
 	elseif isa(variables,'histogram_bin_uncertain'),
@@ -119,4 +143,9 @@
 			dvar(end  ).mean=variables.mean(j);
 			dvar(end  ).partition=[];
+		elseif isa(variables,'continuous_design'),
+			dvar(end  ).upper=variables.upper(j);
+			dvar(end  ).lower=variables.lower(j);
+			dvar(end  ).initpt=variables.initpt(j);
+			dvar(end  ).partition=[];
 		elseif isa(variables,'histogram_bin_uncertain'),
 			dvar(end).pairs_per_variable=variables.pairs_per_variable(j);
Index: /issm/branches/trunk-larour-SLPS2022/src/m/qmu/vlist_write.m
===================================================================
--- /issm/branches/trunk-larour-SLPS2022/src/m/qmu/vlist_write.m	(revision 27749)
+++ /issm/branches/trunk-larour-SLPS2022/src/m/qmu/vlist_write.m	(revision 27750)
@@ -3,5 +3,4 @@
 %
 function []=vlist_write(fidi,cstring,cstring2,dvar)
-
 if isempty(dvar)
     return;
Index: /issm/branches/trunk-larour-SLPS2022/src/m/solve/loadresultsfromcluster.m
===================================================================
--- /issm/branches/trunk-larour-SLPS2022/src/m/solve/loadresultsfromcluster.m	(revision 27749)
+++ /issm/branches/trunk-larour-SLPS2022/src/m/solve/loadresultsfromcluster.m	(revision 27750)
@@ -35,4 +35,9 @@
 		if strcmpi(md.qmu.method.method,'nond_sampling'),
 			for i=1:md.qmu.method.params.samples
+				filelist{end+1}=[md.miscellaneous.name '.outbin.' num2str(i)];
+			end
+		end
+		if strcmpi(md.qmu.method.method,'list_parameter_study'),
+			for i=md.qmu.method.params.list_of_points,
 				filelist{end+1}=[md.miscellaneous.name '.outbin.' num2str(i)];
 			end
