Changeset 17687


Ignore:
Timestamp:
04/08/14 21:13:16 (11 years ago)
Author:
Mathieu Morlighem
Message:

CHG: replacing some meshtype by meshdimension

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

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/m/boundaryconditions/SetMarineIceSheetBC.m

    r17686 r17687  
    5252
    5353%First find segments that are not completely on the front
    54 if ~strcmp(md.mesh.domaintype(),'3D'),
     54if strcmp(elementtype(md.mesh),'Penta'),
     55        numbernodesfront=4;
     56elseif strcmp(elementtype(md.mesh),'Tria'),
    5557        numbernodesfront=2;
    56 else 
    57         numbernodesfront=4;
     58else
     59        error('mesh type not supported yet');
    5860end
    5961segmentsfront=md.mask.ice_levelset(md.mesh.segments(:,1:numbernodesfront))==0;
  • issm/trunk-jpl/src/m/boundaryconditions/SetMarineIceSheetBC.py

    r17686 r17687  
    5353
    5454        #First find segments that are not completely on the front
    55         if not m.strcmp(md.mesh.domaintype(),'3D'):
     55        if m.strcmp(md.mesh.elementtype(),'Penta'):
     56                numbernodesfront=4
     57        elif m.strcmp(md.mesh.elementtype(),'Tria'):
    5658                numbernodesfront=2
    5759        else:
    58                 numbernodesfront=4
     60                        raise StandardError("Mesh type not supported")
    5961        if any(md.mask.ice_levelset<=0):
    6062                values=md.mask.ice_levelset[md.mesh.segments[:,0:-1]-1]
  • issm/trunk-jpl/src/m/classes/model.m

    r17686 r17687  
    156156
    157157                        %Check that the model is really a 3d model
    158                         if ~strcmp(md.mesh.domaintype(),'3D'),
     158                        if ~strcmp(md.mesh.elementtype(),'Penta'),
    159159                                error('collapse error message: only 3d mesh can be collapsed')
    160160                        end
  • issm/trunk-jpl/src/m/contrib/ecco/PropagateFlagsUntilDistance.m

    r17686 r17687  
    1010
    1111%make 3d work in 2d:
    12 if strcmp(domaintype(md.mesh),'3D'),
     12if dimension(md.mesh)==3,
    1313        md.mesh.x=md.mesh.x2d;
    1414        md.mesh.y=md.mesh.y2d;
  • issm/trunk-jpl/src/m/extrusion/DepthAverage.m

    r17686 r17687  
    99
    1010%check that the model given in input is 3d
    11 if ~strcmp(md.mesh.domaintype,'3D');
     11if ~strcmp(md.mesh.elementtype(),'3D');
    1212        error('DepthAverage error message: the model given in input must be 3d')
    1313end
  • issm/trunk-jpl/src/m/parameterization/contourenvelope.m

    r17686 r17687  
    4242%get nodes inside profile
    4343mesh.elementconnectivity=md.mesh.elementconnectivity;
    44 if strcmp(md.mesh.domaintype(),'2Dhorizontal'),
     44if dimension(md.mesh)==2,
    4545        mesh.elements=md.mesh.elements;
    4646        mesh.x=md.mesh.x;
  • issm/trunk-jpl/src/m/parameterization/contourenvelope.py

    r17686 r17687  
    4747        #get nodes inside profile
    4848        elementconnectivity=copy.deepcopy(md.mesh.elementconnectivity)
    49         if m.strcmp(md.mesh.domaintype(),'2Dhorizontal'):
     49        if md.mesh.dimension()==2:
    5050                elements=copy.deepcopy(md.mesh.elements)
    5151                x=copy.deepcopy(md.mesh.x)
  • issm/trunk-jpl/src/m/plot/applyoptions.m

    r17686 r17687  
    4949
    5050%view
    51 if strcmp(domaintype(md.mesh),'3D') & ~exist(options,'layer'),
     51if dimension(md.mesh)==3 & ~exist(options,'layer'),
    5252        view(getfieldvalue(options,'view',3));
    5353else
     
    6060        eval(['axis ' getfieldvalue(options,'axis')]);
    6161else
    62         if strcmpi(domaintype(md.mesh),'2Dhorizontal') | exist(options,'layer'),
     62        if dimension(md.mesh)==2 | exist(options,'layer'),
    6363                axis tight equal;
    6464        else
  • issm/trunk-jpl/src/m/plot/plot_edges.m

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

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

    r17686 r17687  
    2121end
    2222
    23 if ~strcmp(domaintype(md.mesh),'3D'),
     23if dimension(md.mesh)~=3,
    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

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

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

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

    r17686 r17687  
    1010upperplots=fix((i-1)/width);
    1111if upperplots==0, leftplots=i-1; else leftplots=i-width*upperplots-1; end
    12 if (strcmp(domaintype(md.mesh),'2Dhorizontal'))%3 components -> 3 indexes
     12if dimension(md.mesh)==2 %3 components -> 3 indexes
    1313        index1=4*width*upperplots+2*leftplots+1;
    1414        index2=index1+1;
     
    3434end
    3535
    36 if ((strcmp(domaintype(md.mesh),'2Dhorizontal'))),
     36if dimension(md.mesh)==2,
    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_transient_results.m

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

    r17686 r17687  
    6565
    6666        %check number of columns, add zeros if necessary,
    67         if (strcmp(md.mesh.domaintype(),'3D'))
     67        if (dimension(md.mesh)==3)
    6868                if datasize(2)==2,
    6969                        data=[data, zeros(datasize(1),1)];
     
    8585
    8686%treat the case datasize(1)=nodes2d
    87 if (strcmp(md.mesh.domaintype(),'3D') & datasize(1)==numberofvertices2d),
     87if (dimension(md.mesh)==3 & datasize(1)==numberofvertices2d),
    8888        data=project3d(md,'vector',data,'type','node');
    8989        datasize(1)=md.mesh.numberofvertices;
     
    9292
    9393%treat the case datasize(1)=nodes2d
    94 if (strcmp(md.mesh.domaintype(),'3D') & datasize(1)==numberofelements2d),
     94if (dimension(md.mesh)==3 & datasize(1)==numberofelements2d),
    9595        data=project3d(md,'vector',data,'type','element');
    9696        datasize(1)=md.mesh.numberofelements;
  • issm/trunk-jpl/src/m/plot/processmesh.py

    r17686 r17687  
    4242
    4343                #is it a 2D plot?
    44                 if m.strcmp(md.mesh.domaintype(),'2Dhorizontal'):
     44                if md.mesh.dimension()==2:
    4545                        is2d=1
    46                 elif m.strcmp(md.mesh.domaintype(),'3D'):
     46                else:
    4747                        if options.getfieldvalue('layer',0)>=1:
    4848                                is2d=1
    4949                        else:
    5050                                is2d=0
    51                 else:
    52                         raise ValueError('processmesh error: dim = %d not supported' % md.mesh.dimension)
    5351
    5452                #layer projection?
     
    6462        else:
    6563                #Process mesh for plotting
    66                 if m.strcmp(md.mesh.domaintype(),'2Dhorizontal'):
     64                if md.mesh.dimension()==2:
    6765                        is2d=1
    6866                else:
Note: See TracChangeset for help on using the changeset viewer.