Changeset 575 for trunk/src/calc_field.m


Ignore:
Timestamp:
Feb 27, 2013, 6:39:32 PM (8 years ago)
Author:
sommeria
Message:

various bugs corrected

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 them
     1%'calc_field': defines fields (velocity, vort, div...) from civx data (old conventions) and calculate them.
    22%---------------------------------------------------------------------
    33% [DataOut,errormsg]=calc_field(FieldList,DataIn,Coord_interp)
     
    121121        XMin=min(XMin);
    122122        YMin=min(YMin);
    123         if ~isfield(DataIn,'Mesh')
    124             DataIn.Mesh=sqrt(2*(XMax-XMin)*(YMax-YMin)/numel(DataIn.Coord_tps));
     123        if ~isfield(DataIn,'CoordMesh')
     124            DataIn.Coord
     125            Mesh=sqrt(2*(XMax-XMin)*(YMax-YMin)/numel(DataIn.Coord_tps));
    125126            % adjust the mesh to a value 1, 2 , 5 *10^n
    126             ord=10^(floor(log10(DataIn.Mesh)));%order of magnitude
    127             if DataIn.Mesh/ord>=5
    128                 DataIn.Mesh=5*ord;
    129             elseif DataIn.Mesh/ord>=2
    130                 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;
    131132            else
    132                 DataIn.Mesh=ord;
     133                DataIn.CoordMesh=ord;
    133134            end
    134135        end
    135         coord_x=XMin:DataIn.Mesh:XMax;% increase the recommanded mesh to  visualisation
    136         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;
    137138        DataOut.coord_x=[XMin XMax];
    138139        DataOut.coord_y=[YMin YMax];
Note: See TracChangeset for help on using the changeset viewer.