Ignore:
Timestamp:
07/22/10 18:57:52 (15 years ago)
Author:
Eric.Larour
Message:

New MeshProfileIntersection module, with local routines.
Needed a new object, Segment, because this is highly dynamic in nature.

More qmu debugging, especially dealing with segments for Mass flux computation.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk/src/m/qmu/process_qmu_response_data.m

    r4430 r4773  
    77
    88
     9%preliminary data
     10process_mass_flux_profiles=0;
    911
     12
     13%loop through response descriptors, and act accordingly
    1014for i=1:numel(md.responsedescriptors),
    11         if strncmpi(md.responsedescriptors{i},'mass_flux',9),
    12                 indx=str2int(md.responsedescriptors{i}(10:end));
    13                 if isempty(indx) || ~indx
    14                         indx=1;
    15                 end
    1615
    17                 %we need a profile of points on which to compute the mass_flux, is it here?
    18                 if isnans(md.qmu_mass_flux_profile),
    19                         error('process_qmu_response_data error message: could not find a mass_flux exp profile!');
    20                 end
    21                 if ~(ischar(md.qmu_mass_flux_profile) && (indx == 1)) && ...
    22                    ~(iscell(md.qmu_mass_flux_profile) && length(md.qmu_mass_flux_profile) >= indx && ischar(md.qmu_mass_flux_profile{indx})),
    23                         error('process_qmu_response_data error message: mass_flux exp profile should be a domain outline name');
    24                 end
    25 
    26                 %ok, process the qmu_mass_flux_profile to build a list of segments:
    27                 if ischar(md.qmu_mass_flux_profile),
    28                         md.qmu_mass_flux_segments=MassFluxProcessProfile(md);
    29                         md.qmu_mass_flux_num_segments=size(md.qmu_mass_flux_segments,1);
    30                 else
    31                         if isempty(md.qmu_mass_flux_segments) || ~iscell(md.qmu_mass_flux_segments)
    32                                 md.qmu_mass_flux_segments=cell(numel(md.qmu_mass_flux_profile),1);
    33                         end
    34                         if isempty(md.qmu_mass_flux_num_segments) || ...
    35                            (numel(md.qmu_mass_flux_num_segments) == 1 && isnan(md.qmu_mass_flux_num_segments))
    36                                 md.qmu_mass_flux_num_segments=zeros(numel(md.qmu_mass_flux_profile),1);
    37                         end
    38                         save=md.qmu_mass_flux_profile;
    39                         md.qmu_mass_flux_profile=md.qmu_mass_flux_profile{indx};
    40                         md.qmu_mass_flux_segments{indx,1}=MassFluxProcessProfile(md);
    41                         md.qmu_mass_flux_num_segments(indx,1)=size(md.qmu_mass_flux_segments{indx},1);
    42                         md.qmu_mass_flux_profile=save;
    43                         clear save
    44                 end
     16        %Do we have to process  mass flux profiles?
     17        if strncmpi(md.responsedescriptors{i},'MassFlux',8),
     18                process_mass_flux_profiles=1;
    4519        end
    4620end
    4721
    48 % for now, concatenate all segments from cells to make a double array for parallel
    49 if iscell(md.qmu_mass_flux_segments)
    50         segments=zeros(0,5);
    51         for i=1:length(md.qmu_mass_flux_num_segments)
    52                 if md.qmu_mass_flux_num_segments(i)
    53                         segments=[segments; md.qmu_mass_flux_segments{i}];
    54                 end
     22
     23%deal with mass flux profiles
     24if process_mass_flux_profiles,
     25
     26        %we need a profile of points on which to compute the mass_flux, is it here?
     27        if isnans(md.qmu_mass_flux_profiles),
     28                error('process_qmu_response_data error message: could not find a mass_flux exp profile!');
    5529        end
    56         md.qmu_mass_flux_segments=segments;
    57         clear segments
     30       
     31        if ~iscell(md.qmu_mass_flux_profiles),
     32                error('process_qmu_response_data error message: qmu_mass_flux_profiles field should be a cell array of domain outline names');
     33        end
     34
     35        if isempty(md.qmu_mass_flux_profiles),
     36                error('process_qmu_response_data error message: qmu_mass_flux_profiles cannot be empty!');
     37        end
     38
     39        %ok, process the domains named in qmu_mass_flux_profiles,  to build a list of segments
     40        md.qmu_mass_flux_segments=cell(numel(md.qmu_mass_flux_profiles),1);
     41
     42        for i=1:numel(md.qmu_mass_flux_profiles),
     43                md.qmu_mass_flux_segments{i}=MassFluxProcessProfile(md,md.qmu_mass_flux_profile_directory,md.qmu_mass_flux_profiles{i});
     44        end
    5845end
    5946
     47error;
     48
Note: See TracChangeset for help on using the changeset viewer.