Changeset 575 for trunk/src/calc_field.m
 Timestamp:
 Feb 27, 2013, 6:39:32 PM (8 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

trunk/src/calc_field.m
r546 r575 1 %'calc_field': defines fields (velocity, vort, div...) from civx data and calculate them1 %'calc_field': defines fields (velocity, vort, div...) from civx data (old conventions) and calculate them. 2 2 % 3 3 % [DataOut,errormsg]=calc_field(FieldList,DataIn,Coord_interp) … … 121 121 XMin=min(XMin); 122 122 YMin=min(YMin); 123 if ~isfield(DataIn,'Mesh') 124 DataIn.Mesh=sqrt(2*(XMaxXMin)*(YMaxYMin)/numel(DataIn.Coord_tps)); 123 if ~isfield(DataIn,'CoordMesh') 124 DataIn.Coord 125 Mesh=sqrt(2*(XMaxXMin)*(YMaxYMin)/numel(DataIn.Coord_tps)); 125 126 % adjust the mesh to a value 1, 2 , 5 *10^n 126 ord=10^(floor(log10(DataIn. Mesh)));%order of magnitude127 if DataIn. Mesh/ord>=5128 DataIn. Mesh=5*ord;129 elseif DataIn. Mesh/ord>=2130 DataIn. Mesh=2*ord;127 ord=10^(floor(log10(DataIn.CoordMesh)));%order of magnitude 128 if DataIn.CoordMesh/ord>=5 129 DataIn.CoordMesh=5*ord; 130 elseif DataIn.CoordMesh/ord>=2 131 DataIn.CoordMesh=2*ord; 131 132 else 132 DataIn. Mesh=ord;133 DataIn.CoordMesh=ord; 133 134 end 134 135 end 135 coord_x=XMin:DataIn. Mesh:XMax;% increase the recommanded mesh to visualisation136 coord_y=YMin:DataIn. Mesh:YMax;136 coord_x=XMin:DataIn.CoordMesh:XMax;% increase the recommanded mesh to visualisation 137 coord_y=YMin:DataIn.CoordMesh:YMax; 137 138 DataOut.coord_x=[XMin XMax]; 138 139 DataOut.coord_y=[YMin YMax];
Note: See TracChangeset
for help on using the changeset viewer.