Changeset 25223
- Timestamp:
- 07/06/20 20:11:19 (5 years ago)
- Location:
- issm/trunk-jpl/src/m/qmu
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified issm/trunk-jpl/src/m/qmu/preqmu.m ¶
r25041 r25223 98 98 field_name=variable_fieldnames{i}; 99 99 fieldvariable=md.qmu.variables(ivar).(field_name); 100 if fieldvariable.isscaled() ;100 if fieldvariable.isscaled() | fieldvariable.isdistributed(); 101 101 variablepartitions{end+1}=fieldvariable.partition; 102 102 variablepartitions_npart(end+1)=qmupart2npart(fieldvariable.partition); 103 variablepartitions_nt(end+1)=fieldvariable.nsteps; 103 if isfield(fieldvariable,'nsteps'), 104 variablepartitions_nt(end+1)=fieldvariable.nsteps; 105 else 106 variablepartitions_nt(end+1)=1; 107 end 104 108 else 105 109 variablepartitions{end+1}=[]; -
TabularUnified issm/trunk-jpl/src/m/qmu/setupdesign/QmuSetupVariables.m ¶
r25033 r25223 72 72 end 73 73 74 elseif strncmp(descriptor,'distributed_',12), 75 76 %we have a distributed variable, expand it over the partition. First recover the partition: 77 partition=variables.partition; 78 %figure out number of partitions: 79 npart=qmupart2npart(partition); 80 81 if isa(variables,'uniform_uncertain'), 82 nlower=size(variables.lower,1); 83 nupper=size(variables.upper,1); 84 if (nlower ~= npart || nupper ~=npart), 85 error('QmuSetupVariables error message: upper and lower fields should have the same number of rows as the number of partitions'); 86 end 87 elseif isa(variables,'normal_uncertain'), 88 nstddev=size(variables.stddev,1); 89 nmean=size(variables.mean,1); 90 if (nstddev ~= npart || nmean ~=npart), 91 error('QmuSetupVariables error message: stddev and mean fields should have the same number of rows as the number of partitions'); 92 end 93 elseif isa(variables,'histogram_bin_uncertain'), 94 ncounts=length(variables.counts); 95 npairs=length(variables.pairs_per_variable); 96 nabs=length(variables.abscissas); 97 if (ncounts ~= npart), 98 error(sprintf('QmuSetupVariables error message: counts size (%i) should be equal to the number of partitions (%i)',ncounts,npart)); 99 end 100 if (npairs ~= npart), 101 error(sprintf('QmuSetupVariables error message: pairs_per_variable size (%i) should be equal to the number of partitions (%i)',npairs,npart)); 102 end 103 if (nabs ~= npart), 104 error(sprintf('QmuSetupVariables error message: abscissas size (%i) should be equal to the number of partitions (%i)',nabs,npart)); 105 end 106 end 107 108 %ok, dealing with distributed variable. Distribute according to how many 109 %partitions we want. 110 for j=1:npart, 111 dvar(end+1) =variables; 112 dvar(end).descriptor=sprintf('%s_%d',variables.descriptor,j); 113 if isa(variables,'uniform_uncertain'), 114 dvar(end ).lower=variables.lower(j); 115 dvar(end ).upper=variables.upper(j); 116 dvar(end ).partition=[]; 117 elseif isa(variables,'normal_uncertain'), 118 dvar(end ).stddev=variables.stddev(j); 119 dvar(end ).mean=variables.mean(j); 120 dvar(end ).partition=[]; 121 elseif isa(variables,'histogram_bin_uncertain'), 122 dvar(end).pairs_per_variable=variables.pairs_per_variable(j); 123 dvar(end).abscissas=variables.abscissas{j}; 124 dvar(end).counts=variables.counts{j}; 125 dvar(end).partition=[]; 126 end 127 end 74 128 else 75 129 dvar(end+1)=variables;
Note:
See TracChangeset
for help on using the changeset viewer.