Changeset 548 for trunk/src/sub_field.m
- Timestamp:
- Oct 10, 2012, 11:25:35 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/sub_field.m
r520 r548 45 45 end 46 46 if ~isfield(Field,AttrName) || ~isequal(Field_1.(AttrName),Field.(AttrName)) 47 SubData.ListGlobalAttribute=[SubData.ListGlobalAttribute {AttrNameNew}];48 SubData.(AttrNameNew)=Field_1.(AttrName);47 SubData.ListGlobalAttribute=[SubData.ListGlobalAttribute {AttrNameNew}]; 48 SubData.(AttrNameNew)=Field_1.(AttrName); 49 49 end 50 50 end … … 149 149 150 150 %% substrat fields when possible 151 [CellVarIndex,NbDim,CellVarType,errormsg]=find_field_cells(SubData); 151 %[CellVarIndex,NbDim,CellVarType,errormsg]=find_field_cells(SubData); 152 [CellInfo,NbDim,errormsg]=find_field_cells(SubData) 152 153 ind_remove=zeros(size(SubData.ListVarName)); 153 154 ivar=[]; 154 155 ivar_1=[]; 155 for icell=1:numel(Cell VarIndex)156 if ~isempty(Cell VarIndex{icell})157 if isfield(Cell VarType{icell},'scalar') && numel(CellVarType{icell}.scalar)==2 && SubData.VarAttribute{CellVarType{icell}.scalar(2)}.CheckSub;158 ivar=[ivar Cell VarType{icell}.scalar(1)];159 ivar_1=[ivar_1 Cell VarType{icell}.scalar(2)];156 for icell=1:numel(CellInfo) 157 if ~isempty(CellInfo{icell}) 158 if isfield(CellInfo{icell},'VarIndex_scalar') && numel(CellInfo{icell}.VarIndex_scalar)==2 && SubData.VarAttribute{CellInfo{icell}.VarIndex_scalar(2)}.CheckSub; 159 ivar=[ivar CellInfo{icell}.VarIndex_scalar(1)]; 160 ivar_1=[ivar_1 CellInfo{icell}.VarIndex_scalar(2)]; 160 161 end 161 if isfield(Cell VarType{icell},'vector_x') && numel(CellVarType{icell}.vector_x)==2 && SubData.VarAttribute{CellVarType{icell}.vector_x(2)}.CheckSub;162 ivar=[ivar Cell VarType{icell}.vector_x(1)];163 ivar_1=[ivar_1 Cell VarType{icell}.vector_x(2)];162 if isfield(CellInfo{icell},'VarIndex_vector_x') && numel(CellInfo{icell}.VarIndex_vector_x)==2 && SubData.VarAttribute{CellInfo{icell}.VarIndex_vector_x(2)}.CheckSub; 163 ivar=[ivar CellInfo{icell}.VarIndex_vector_x(1)]; 164 ivar_1=[ivar_1 CellInfo{icell}.VarIndex_vector_x(2)]; 164 165 end 165 if isfield(Cell VarType{icell},'vector_y') && numel(CellVarType{icell}.vector_y)==2 && SubData.VarAttribute{CellVarType{icell}.vector_y(2)}.CheckSub;166 ivar=[ivar Cell VarType{icell}.vector_y(1)];167 ivar_1=[ivar_1 Cell VarType{icell}.vector_y(2)];166 if isfield(CellInfo{icell},'VarIndex_vector_y') && numel(CellInfo{icell}.VarIndex_vector_y)==2 && SubData.VarAttribute{CellInfo{icell}.VarIndex_vector_y(2)}.CheckSub; 167 ivar=[ivar CellInfo{icell}.VarIndex_vector_y(1)]; 168 ivar_1=[ivar_1 CellInfo{icell}.VarIndex_vector_y(2)]; 168 169 end 169 170 end … … 172 173 VarName=SubData.ListVarName{ivar(imod)}; 173 174 VarName_1=SubData.ListVarName{ivar_1(imod)}; 174 SubData.(VarName)= SubData.(VarName)-SubData.(VarName_1);175 SubData.(VarName)=double(SubData.(VarName))-double(SubData.(VarName_1)); 175 176 ind_remove(ivar_1(imod))=1; 176 177 end
Note: See TracChangeset
for help on using the changeset viewer.