Changeset 17559


Ignore:
Timestamp:
03/27/14 08:53:53 (11 years ago)
Author:
Mathieu Morlighem
Message:

CHG: changing some md.mesh.dimension

Location:
issm/trunk-jpl/src/m
Files:
41 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/m/classes/model.m

    r17558 r17559  
    113113                        %2014 March 26th
    114114                        if isa(md.mesh,'mesh'),
    115                                 if(md.mesh.dimension==2),
     115                                if(strcmp(meshtype(md.mesh),'2Dhorizontal')),
    116116                                        md.mesh=mesh2d(md.mesh);
    117117                                else
  • issm/trunk-jpl/src/m/classes/modellist.m

    r15987 r17559  
    3232
    3333                        %2D or 3D?
    34                         if md.mesh.dimension==3,
     34                        if strcmp(meshtype(md.mesh),'3D'),
    3535                                numberofelements=md.mesh.numberofelements2d; %this will be forgotten when we get out.
    3636                                flags=project2d(md,flags,1);
     
    8484                        for i=1:size(flag_list,1),
    8585                                disp(['   ' num2str(i) '/' num2str(size(flag_list,1))]);
    86                                 if md.mesh.dimension==3,
     86                                if strcmp(meshtype(md.mesh),'3D'),
    8787                                        flags2d=flag_list{i};
    8888                                        realflags=project3d(md,flags2d,'element');
  • issm/trunk-jpl/src/m/classes/rifts.m

    r16765 r17559  
    2828                        end
    2929                        if numrifts,
    30                                 if ~(md.mesh.dimension==2),
     30                                if ~(strcmp(meshtype(md.mesh),'2Dhorizontal')),
    3131                                        md = checkmessage(md,['models with rifts are only supported in 2d for now!']);
    3232                                end
  • issm/trunk-jpl/src/m/classes/rifts.py

    r17497 r17559  
    3939
    4040                if numrifts:
    41                         if not md.mesh.dimension==2:
     41                        if not m.strcmp(md.mesh.meshtype(),'2Dhorizontal'):
    4242                                md.checkmessage("models with rifts are only supported in 2d for now!")
    4343                        if not isinstance(self.riftstruct,list):
  • issm/trunk-jpl/src/m/classes/spheremesh.m

    r16764 r17559  
    1313                phi                         = NaN
    1414                elements                    = NaN
    15                 dimension                   = 0;
    1615                numberoflayers              = 0;
    1716                numberofelements            = 0;
     
    4948                        md = checkfield(md,'fieldname','spheremesh.phi','NaN',1,'size',[md.spheremesh.numberofvertices 1]);
    5049                        md = checkfield(md,'fieldname','spheremesh.elements','NaN',1,'>',0,'values',1:md.spheremesh.numberofvertices);
    51                         if(md.spheremesh.dimension==2),
    52                                 md = checkfield(md,'fieldname','spheremesh.elements','size',[md.spheremesh.numberofelements 3]);
    53                         else
    54                                 md = checkfield(md,'fieldname','spheremesh.elements','size',[md.spheremesh.numberofelements 6]);
    55                         end
     50                        md = checkfield(md,'fieldname','spheremesh.elements','size',[md.spheremesh.numberofelements 3]);
    5651                        if any(~ismember(1:md.spheremesh.numberofvertices,sort(unique(md.spheremesh.elements(:)))));
    5752                                md = checkmessage(md,'orphan nodes have been found. Check the spheremesh outline');
    5853                        end
    59                         md = checkfield(md,'fieldname','spheremesh.dimension','values',[2 3]);
    6054                        md = checkfield(md,'fieldname','spheremesh.numberoflayers','>=',0);
    6155                        md = checkfield(md,'fieldname','spheremesh.numberofelements','>',0);
    6256                        md = checkfield(md,'fieldname','spheremesh.numberofvertices','>',0);
    63                         if (md.spheremesh.dimension==2),
    64                                 md = checkfield(md,'fieldname','spheremesh.average_vertex_connectivity','>=',9,'message','''spheremesh.average_vertex_connectivity'' should be at least 9 in 2d');
    65                         else
    66                                 md = checkfield(md,'fieldname','spheremesh.average_vertex_connectivity','>=',24,'message','''spheremesh.average_vertex_connectivity'' should be at least 24 in 3d');
    67                         end
    6857                        md = checkfield(md,'fieldname','spheremesh.elementconnectivity','size',[md.spheremesh.numberofelements 3],'NaN',1);
    69 
    70                         %Solution specific checks
    71                         switch(solution),
    72                                 case MasstransportSolutionEnum(),
    73                                         if md.masstransport.stabilization==3,
    74                                                 md = checkfield(md,'fieldname','spheremesh.dimension','values',2,'message','Discontinuous Galerkin only supported for 2d spheremeshes');
    75                                         end
    76                                 case TransientSolutionEnum(),
    77                                         if md.transient.ismasstransport & md.masstransport.stabilization==3,
    78                                                 md = checkfield(md,'fieldname','spheremesh.dimension','values',2,'message','Discontinuous Galerkin only supported for 2d spheremeshes');
    79                                         end
    80                                 case ThermalSolutionEnum(),
    81                                         md = checkfield(md,'fieldname','spheremesh.dimension','values',3,'message','thermal solution only supported on 3d spheremeshes');
    82                         end
    8358                end % }}}
    8459                function disp(obj) % {{{
     
    9772
    9873                        disp(sprintf('\n      Properties:'));
    99                         fielddisplay(obj,'dimension','spheremesh dimension (2d or 3d)');
    10074                        fielddisplay(obj,'numberoflayers','number of extrusion layers');
    10175
     
    11387                        WriteData(fid,'object',obj,'fieldname','phi','format','DoubleMat','mattype',1);
    11488                        WriteData(fid,'object',obj,'fieldname','elements','format','DoubleMat','mattype',2);
    115                         WriteData(fid,'object',obj,'fieldname','dimension','format','Integer');
    11689                        WriteData(fid,'object',obj,'fieldname','numberoflayers','format','Integer');
    11790                        WriteData(fid,'object',obj,'fieldname','numberofelements','format','Integer');
  • issm/trunk-jpl/src/m/classes/thermal.m

    r16764 r17559  
    6464                        md = checkfield(md,'fieldname','thermal.stabilization','numel',[1],'values',[0 1 2]);
    6565                        md = checkfield(md,'fieldname','thermal.spctemperature','forcing',1);
    66                         if (ismember(EnthalpyAnalysisEnum(),analyses) & md.thermal.isenthalpy & md.mesh.dimension==3),
     66                        if (ismember(EnthalpyAnalysisEnum(),analyses) & md.thermal.isenthalpy & strcmp(meshtype(md.mesh),'3D')),
    6767                                pos=find(md.thermal.spctemperature(1:md.mesh.numberofvertices,:)~=NaN);
    6868                                replicate=repmat(md.geometry.surface-md.mesh.z,1,size(md.thermal.spctemperature,2));
  • issm/trunk-jpl/src/m/classes/thermal.py

    r17497 r17559  
    8181                md = checkfield(md,'fieldname','thermal.stabilization','numel',[1],'values',[0,1,2])
    8282                md = checkfield(md,'fieldname','thermal.spctemperature','forcing',1)
    83                 if EnthalpyAnalysisEnum() in analyses and md.thermal.isenthalpy and md.mesh.dimension==3:
     83                if EnthalpyAnalysisEnum() in analyses and md.thermal.isenthalpy and m.strcmp(md.mesh.meshtype(),'3D'):
    8484                        pos=numpy.nonzero(numpy.logical_not(numpy.isnan(md.thermal.spctemperature[0:md.mesh.numberofvertices])))
    8585                        replicate=numpy.tile(md.geometry.surface-md.mesh.z,(1,numpy.size(md.thermal.spctemperature,axis=1)))
  • issm/trunk-jpl/src/m/contrib/ecco/PropagateFlagsUntilDistance.m

    r13008 r17559  
    1010
    1111%make 3d work in 2d:
    12 if md.mesh.dimension==3,
     12if strcmp(meshtype(md.mesh),'3D'),
    1313        md.mesh.x=md.mesh.x2d;
    1414        md.mesh.y=md.mesh.y2d;
  • issm/trunk-jpl/src/m/contrib/hack/tres.m

    r15771 r17559  
    99
    1010if strcmpi(string,'stressbalance'),
    11         if md.mesh.dimension==2,
     11        if strcmp(meshtype(md.mesh),'2Dhorizontal'),
    1212                md.initialization.vx=md.results.StressbalanceSolution.Vx;
    1313                md.initialization.vy=md.results.StressbalanceSolution.Vy;
  • issm/trunk-jpl/src/m/contrib/massbalance/divergence.m

    r13007 r17559  
    55%      div=divergence(md,a,b)
    66
    7 if (md.mesh.dimension==2),
     7if (strcmp(meshtype(md.mesh),'2Dhorizontal')),
    88        numberofelements=md.mesh.numberofelements;
    99        numberofnodes=md.mesh.numberofvertices;
  • issm/trunk-jpl/src/m/contrib/massbalance/outflux.m

    r15039 r17559  
    1616
    1717if nargin==1,
    18         if md.mesh.dimension==3,
     18        if strcmp(meshtype(md.mesh),'3D'),
    1919                vxa=DepthAverage(md,md.initialization.vx);
    2020                vya=DepthAverage(md,md.initialization.vy);
     
    2828else
    2929        step=varargin{1};
    30         if md.mesh.dimension==3,
     30        if strcmp(meshtype(md.mesh),'3D'),
    3131                vxa=DepthAverage(md,md.results.TransientSolution(step).Vx);
    3232                vya=DepthAverage(md,md.results.TransientSolution(step).Vy);
  • issm/trunk-jpl/src/m/exp/contourlevelzero.m

    r16517 r17559  
    1010
    1111%process data
    12 if md.mesh.dimension==3,
     12if strcmp(meshtype(md.mesh),'3D'),
    1313        error('contourlevelzero error message: routine not supported for 3d meshes, project on a layer');
    1414end
  • issm/trunk-jpl/src/m/geometry/slope.m

    r14800 r17559  
    77
    88%load some variables (it is much faster if the variab;es are loaded from md once for all)
    9 if (md.mesh.dimension==2),
     9if (strcmp(meshtype(md.mesh),'2Dhorizontal')),
    1010        numberofelements=md.mesh.numberofelements;
    1111        numberofnodes=md.mesh.numberofvertices;
     
    3030s=sqrt(sx.^2+sy.^2);
    3131
    32 if md.mesh.dimension==3,
     32if strcmp(meshtype(md.mesh),'3D'),
    3333        sx=project3d(md,'vector',sx,'type','element');
    3434        sy=project3d(md,'vector',sy,'type','element');
  • issm/trunk-jpl/src/m/geometry/slope.py

    r16105 r17559  
    1212
    1313        #load some variables (it is much faster if the variables are loaded from md once for all)
    14         if md.mesh.dimension==2:
     14        if m.strcmp(md.mesh.meshtype(),'2Dhorizontal'):
    1515                numberofelements=md.mesh.numberofelements
    1616                numberofnodes=md.mesh.numberofvertices
     
    3939        s=npy.sqrt(sx**2+sy**2)
    4040
    41         if md.mesh.dimension==3:
     41        if m.strcmp(md.mesh.meshtype(),'3D'):
    4242                sx=project3d(md,'vector',sx,'type','element')
    4343                sy=project3d(md,'vector',sy,'type','element')
  • issm/trunk-jpl/src/m/interp/SectionValues.m

    r13646 r17559  
    2929        error('SectionValues error message: wrong resolution type. Resolution must be an array [horizontal_resolution vertical_resolution]')
    3030end
    31 if md.mesh.dimension==3
     31if strcmp(meshtype(md.mesh),'3D')
    3232        if (length(resolution)==2 & isnumeric(resolution(2)))
    3333                res_v=resolution(2);
     
    7878
    7979%New mesh and Data interpolation
    80 if (md.mesh.dimension==2)
     80if (strcmp(meshtype(md.mesh),'2Dhorizontal'))
    8181
    8282        %Interpolation of data on specified points
  • issm/trunk-jpl/src/m/interp/averaging.m

    r16055 r17559  
    2525        error('averaging error message: data not supported yet');
    2626end
    27 if md.mesh.dimension==3 & nargin==4,
     27if strcmp(meshtype(md.mesh),'3D') & nargin==4,
    2828        if varargin{1}<=0 | varargin{1}>md.mesh.numberoflayers,
    2929                error('layer should be between 1 and md.mesh.numberoflayers');
     
    5656%build some variables
    5757line=index(:);
    58 if md.mesh.dimension==3 & layer==0,
     58if strcmp(meshtype(md.mesh),'3D') & layer==0,
    5959        rep=6;
    6060        areas=GetAreas(index,md.mesh.x,md.mesh.y,md.mesh.z);
    61 elseif md.mesh.dimension==2,
     61elseif strcmp(meshtype(md.mesh),'2Dhorizontal'),
    6262        rep=3;
    6363        areas=GetAreas(index,md.mesh.x,md.mesh.y);
  • issm/trunk-jpl/src/m/interp/averaging.py

    r17551 r17559  
    2727        if len(data)!=md.mesh.numberofelements and len(data)!=md.mesh.numberofvertices:
    2828                raise StandardError('averaging error message: data not supported yet')
    29         if md.mesh.dimension==3 and layer!=0:
     29        if m.strcmp(md.mesh.meshtype(),'3D') and layer!=0:
    3030                if layer<=0 or layer>md.mesh.numberoflayers:
    3131                        raise ValueError('layer should be between 1 and md.mesh.numberoflayers')
     
    5353       
    5454        #build some variables
    55         if md.mesh.dimension==3 and layer==0:
     55        if m.strcmp(md.mesh.meshtype(),'3D') and layer==0:
    5656                rep=6
    5757                areas=GetAreas(index,md.mesh.x,md.mesh.y,md.mesh.z)
    58         elif md.mesh.dimension==2:
     58        elif m.strcmp(md.mesh.meshtype(),'2Dhorizontal'):
    5959                rep=3
    6060                areas=GetAreas(index,md.mesh.x,md.mesh.y)
  • issm/trunk-jpl/src/m/inversions/velocitymisfit.m

    r17147 r17559  
    99%
    1010
    11 if md.mesh.dimension==2,
     11if strcmp(meshtype(md.mesh),'2Dhorizontal'),
    1212        elements=md.mesh.elements;
    1313        x=md.mesh.x;
  • issm/trunk-jpl/src/m/mech/analyticaldamage.m

    r17389 r17559  
    4848        error(['md.results.strainrate is not present.  Calculate using md=mechanicalproperties(md,vx,vy)']);
    4949end
    50 if ~(md.mesh.dimension==2),
     50if ~(strcmp(meshtype(md.mesh),'2Dhorizontal')),
    5151        error('only 2d model supported currently');
    5252end
  • issm/trunk-jpl/src/m/mech/backstressfrominversion.m

    r16416 r17559  
    4141        error(['md.results.strainrate is not present.  Calculate using md=mechanicalproperties(md,vx,vy)']);
    4242end
    43 if ~(md.mesh.dimension==2),
     43if ~(strcmp(meshtype(md.mesh),'2Dhorizontal')),
    4444        error('only 2d model supported currently');
    4545end
  • issm/trunk-jpl/src/m/mech/damagefrominversion.m

    r16416 r17559  
    2121        error(['md.results.strainrate is not present.  Calculate using md=mechanicalproperties(md,vx,vy)']);
    2222end
    23 if ~(md.mesh.dimension==2),
     23if ~(strcmp(meshtype(md.mesh),'2Dhorizontal')),
    2424        error('only 2d model supported currently');
    2525end
  • issm/trunk-jpl/src/m/mech/mechanicalproperties.m

    r17390 r17559  
    1717        %error(['the input velocity should be of size ' num2str(md.mesh.numberofvertices) '!'])
    1818end
    19 if ~(md.mesh.dimension==2)
     19if ~(strcmp(meshtype(md.mesh),'2Dhorizontal'))
    2020        error('only 2d model supported yet');
    2121end
  • issm/trunk-jpl/src/m/mech/strainrateuncert.m

    r15830 r17559  
    3232        error(['the velocity error dvy should be of size ' num2str(md.mesh.numberofelements) ' or 1!'])
    3333end
    34 if ~(md.mesh.dimension==2)
     34if ~(strcmp(meshtype(md.mesh),'2Dhorizontal'))
    3535        error('only 2d model supported yet');
    3636end
  • issm/trunk-jpl/src/m/mech/thomasparams.m

    r17367 r17559  
    5151        error(['md.results.strainrate is not present.  Calculate using md=mechanicalproperties(md,vx,vy)'])
    5252end
    53 if ~(md.mesh.dimension==2)
     53if ~(strcmp(meshtype(md.mesh),'2Dhorizontal'))
    5454        error('only 2d model supported currently');
    5555end
  • issm/trunk-jpl/src/m/mesh/bamg.m

    r17558 r17559  
    284284%}}}
    285285% Bamg Mesh parameters {{{
    286 if (~exist(options,'domain') & md.mesh.numberofvertices~=0 & md.mesh.dimension==2),
     286if (~exist(options,'domain') & md.mesh.numberofvertices~=0 & strcmp(meshtype(md.mesh),'2Dhorizontal')),
    287287
    288288        if isstruct(md.private.bamg) & isfield(md.private.bamg,'mesh'),
  • issm/trunk-jpl/src/m/mesh/bamg.py

    r17558 r17559  
    272272        #}}}
    273273        # Bamg Mesh parameters {{{
    274         if not options.exist('domain') and md.mesh.numberofvertices and md.mesh.dimension==2:
     274        if not options.exist('domain') and md.mesh.numberofvertices and m.strcmp(md.mesh.meshtype(),'2Dhorizontal'):
    275275
    276276                if isinstance(md.private.bamg,dict) and 'mesh' in md.private.bamg:
  • issm/trunk-jpl/src/m/partition/AreaAverageOntoPartition.m

    r13646 r17559  
    99
    1010%some checks
    11 if md.mesh.dimension==3,
     11if strcmp(meshtype(md.mesh),'3D'),
    1212        if nargin~=3,
    1313                error('layer should be provided onto which Area Averaging occurs');
     
    5151
    5252%in 3D, restore 3D model:
    53 if md.mesh.dimension==3,
     53if strcmp(meshtype(md.mesh),'3D'),
    5454        md=md3d;
    5555end
  • issm/trunk-jpl/src/m/partition/partitioner.m

    r13646 r17559  
    3030recomputeadjacency=getfieldvalue(options,'recomputeadjacency');
    3131
    32 if(md.mesh.dimension==3),
     32if(strcmp(meshtype(md.mesh),'3D')),
    3333        %partitioning essentially happens in 2D. So partition in 2D, then
    3434        %extrude the partition vector vertically.
     
    6969
    7070        %  partition into nparts
    71         part=Chaco(md.qmu.adjacency,weights,[],md.mesh.x, md.mesh.y ,md.mesh.z,method,npart,[])'+1; %index partitions from 1 up. like metis.
     71        if isa(md.mesh,'mesh2d'),
     72                part=Chaco(md.qmu.adjacency,weights,[],md.mesh.x, md.mesh.y,zeros(md.mesh.numberofvertices,1),method,npart,[])'+1; %index partitions from 1 up. like metis.
     73        else
     74                part=Chaco(md.qmu.adjacency,weights,[],md.mesh.x, md.mesh.y,md.mesh.z,method,npart,[])'+1; %index partitions from 1 up. like metis.
     75        end
    7276
    7377elseif strcmpi(package,'scotch'),
     
    96100
    97101%extrude if we are in 3D:
    98 if md.mesh.dimension==3,
     102if strcmp(meshtype(md.mesh),'3D'),
    99103        md3d.qmu.vertex_weight=md.qmu.vertex_weight;
    100104        md3d.qmu.adjacency=md.qmu.adjacency;
  • issm/trunk-jpl/src/m/plot/plot_basaldrag.m

    r13730 r17559  
    99
    1010%check layer
    11 if md.mesh.dimension==3,
     11if strcmp(meshtype(md.mesh),'3D'),
    1212        if getfieldvalue(options,'layer',1)~=1;
    1313                disp('plot_basaldrag warning: basal drag is displayed in the lower layer')
  • issm/trunk-jpl/src/m/plot/plot_edges.m

    r13730 r17559  
    1717end
    1818
    19 if (md.mesh.dimension==2),
     19if (strcmp(meshtype(md.mesh),'2Dhorizontal')),
    2020        %plot mesh
    2121        A=elements(:,1); B=elements(:,2); C=elements(:,3);
  • issm/trunk-jpl/src/m/plot/plot_icefront.m

    r17262 r17559  
    1919elementzeroice=sum(zeroice(md.mesh.elements),2);
    2020
    21 if (md.mesh.dimension==2),
     21if (strcmp(meshtype(md.mesh),'2Dhorizontal')),
    2222        icefront=(elementice & elementnoice) & ~(elementice==2 & elementzeroice);
    2323
  • issm/trunk-jpl/src/m/plot/plot_penalties.m

    r15567 r17559  
    2121end
    2222
    23 if ~md.mesh.dimension==3,
     23if ~strcmp(meshtype(md.mesh),'3D'),
    2424        error('no penalties to plot for ''2d'' model');
    2525elseif isempty(md.penalties),
  • issm/trunk-jpl/src/m/plot/plot_qmu_mass_flux_segments.m

    r13730 r17559  
    1313allsegments=md.qmu.mass_flux_segments;
    1414
    15 if (md.mesh.dimension==2),
     15if (strcmp(meshtype(md.mesh),'2Dhorizontal')),
    1616
    1717        %recover segments
  • issm/trunk-jpl/src/m/plot/plot_referential.m

    r15771 r17559  
    2828Yhat=cross(Zhat,Xhat);
    2929
    30 if (md.mesh.dimension==2),
     30if (strcmp(meshtype(md.mesh),'2Dhorizontal')),
    3131
    3232        %plot mesh
  • issm/trunk-jpl/src/m/plot/plot_section.m

    r16953 r17559  
    203203%apply options
    204204options=addfielddefault(options,'title','Section value');
    205 if (md.mesh.dimension==2)
     205if (strcmp(meshtype(md.mesh),'2Dhorizontal'))
    206206        options=addfielddefault(options,'colorbar',0);
    207207end
    208 if ((md.mesh.dimension==2) | getfieldvalue(options,'view')==2 )
     208if ((strcmp(meshtype(md.mesh),'2Dhorizontal')) | getfieldvalue(options,'view')==2 )
    209209        options=addfielddefault(options,'xlabel','Curvilinear coordinate');
    210210        options=addfielddefault(options,'axis','auto');
    211211end
    212 if (md.mesh.dimension==3 & getfieldvalue(options,'view')==2 )
     212if (strcmp(meshtype(md.mesh),'3D') & getfieldvalue(options,'view')==2 )
    213213        options=addfielddefault(options,'ylabel','z');
    214214end
  • issm/trunk-jpl/src/m/plot/plot_segments.m

    r13730 r17559  
    1414segments=md.mesh.segments;
    1515
    16 if (md.mesh.dimension==2),
     16if (strcmp(meshtype(md.mesh),'2Dhorizontal')),
    1717        %plot mesh
    1818        A=elements(:,1); B=elements(:,2); C=elements(:,3);
  • issm/trunk-jpl/src/m/plot/plot_tensor_components.m

    r13730 r17559  
    1010upperplots=fix((i-1)/width);
    1111if upperplots==0, leftplots=i-1; else leftplots=i-width*upperplots-1; end
    12 if (md.mesh.dimension==2)%3 components -> 3 indexes
     12if (strcmp(meshtype(md.mesh),'2Dhorizontal'))%3 components -> 3 indexes
    1313        index1=4*width*upperplots+2*leftplots+1;
    1414        index2=index1+1;
    1515        index3=index1+width*2;
    16 elseif md.mesh.dimension==3%6 components -> 6 indexes
     16elseif strcmp(meshtype(md.mesh),'3D')%6 components -> 6 indexes
    1717        index1=3*3*width*upperplots+3*leftplots+1;
    1818        index2=index1+1;
     
    2828[tensor.yy datatype]=processdata(md,tensor.yy,options);
    2929[tensor.xy datatype]=processdata(md,tensor.xy,options);
    30 if  md.mesh.dimension==3
     30if  strcmp(meshtype(md.mesh),'3D')
    3131        [tensor.xz datatype]=processdata(md,tensor.xz,options);
    3232        [tensor.yz datatype]=processdata(md,tensor.yz,options);
     
    3434end
    3535
    36 if ((md.mesh.dimension==2)),
     36if ((strcmp(meshtype(md.mesh),'2Dhorizontal'))),
    3737        subplot(2*width,2*width,index1),
    3838        plot_unit(x,y,z,elements,tensor.xx,is2d,isplanet,datatype,options)
  • issm/trunk-jpl/src/m/plot/plot_tensor_principal.m

    r13730 r17559  
    1010upperplots=fix((i-1)/width);
    1111if upperplots==0, leftplots=i-1; else leftplots=i-width*upperplots-1; end
    12 if (md.mesh.dimension==2)%3 components -> 3 indexes
     12if (strcmp(meshtype(md.mesh),'2Dhorizontal'))%3 components -> 3 indexes
    1313        index1=4*width*upperplots+2*leftplots+1;
    1414        index2=index1+1;
     
    1616        index4=index3+1;
    1717        newwidth=2*width;
    18 elseif md.mesh.dimension==3%6 components -> 6 indexes
     18elseif strcmp(meshtype(md.mesh),'3D')%6 components -> 6 indexes
    1919        index1=3*3*width*upperplots+3*leftplots+1;
    2020        index2=index1+1;
     
    3131type2=[type 'axis2'];
    3232plot_tensor_principalaxis(md,options,newwidth,index2,tensor,type2,plot_options);
    33 if  md.mesh.dimension==3
     33if  strcmp(meshtype(md.mesh),'3D')
    3434        type3=[type 'axis3'];
    3535        plot_tensor_principalaxis(md,options,newwidth,index3,tensor,type3,plot_options);
     
    4040[tensor.principalvalue1 datatype]=processdata(md,tensor.principalvalue1,options);
    4141[tensor.principalvalue2 datatype]=processdata(md,tensor.principalvalue2,options);
    42 if  md.mesh.dimension==3
     42if  strcmp(meshtype(md.mesh),'3D')
    4343        [tensor.principalvalue3 datatype]=processdata(md,tensor.principalvalue3,options);
    4444end
    4545
    46 if ((md.mesh.dimension==2)),
     46if ((strcmp(meshtype(md.mesh),'2Dhorizontal'))),
    4747        subplot(2*width,2*width,index3)
    4848        plot_unit(x,y,z,elements,tensor.principalvalue1,is2d,isplanet,datatype,options)
  • issm/trunk-jpl/src/m/plot/plot_tensor_principalaxis.m

    r13730 r17559  
    1313[x y z elements is2d isplanet]=processmesh(md,[],options);
    1414
    15 if ((md.mesh.dimension==2)),
     15if ((strcmp(meshtype(md.mesh),'2Dhorizontal'))),
    1616        eval(['Vx=tensor.principalaxis' type(end) '(:,1); Vy=tensor.principalaxis' type(end) '(:,2);'])
    1717        eval(['value=tensor.principalvalue' type(end) ';']);
     
    3333
    3434%plot quivers
    35 if (md.mesh.dimension==2),
     35if (strcmp(meshtype(md.mesh),'2Dhorizontal')),
    3636
    3737        %density
  • issm/trunk-jpl/src/m/plot/plot_transient_results.m

    r13009 r17559  
    4141clear string;
    4242
    43 if md.mesh.dimension==3,
     43if strcmp(meshtype(md.mesh),'3D'),
    4444        string='plotmodel(md';
    4545        for i=1:length(md.results.transient),
     
    6767clear string;
    6868
    69 if md.mesh.dimension==3,
     69if strcmp(meshtype(md.mesh),'3D'),
    7070        string='plotmodel(md';
    7171        for i=2:length(md.results.transient),
  • issm/trunk-jpl/src/m/plot/processmesh.py

    r17230 r17559  
    4444
    4545                #is it a 2D plot?
    46                 if md.mesh.dimension==2:
     46                if m.strcmp(md.mesh.meshtype(),'2Dhorizontal'):
    4747                        is2d=1
    48                 elif md.mesh.dimension==3:
     48                elif m.strcmp(md.mesh.meshtype(),'3D'):
    4949                        if options.getfieldvalue('layer',0)>=1:
    5050                                is2d=1
     
    6666        else:
    6767                #Process mesh for plotting
    68                 if md.mesh.dimension==2:
     68                if m.strcmp(md.mesh.meshtype(),'2Dhorizontal'):
    6969                        is2d=1
    7070                else:
Note: See TracChangeset for help on using the changeset viewer.