Changeset 17562


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

BUG: spctemperature were not set correctly because 2d meshes do not have vertexonsurface anymore

Location:
issm/trunk-jpl/src/m/classes
Files:
8 edited

Legend:

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

    r17300 r17562  
    7676                end % }}}
    7777                function disp(obj) % {{{
    78                         disp(sprintf('   2d Mesh:'));
     78                        disp(sprintf('   2D tria Mesh (horizontal):'));
    7979
    8080                        disp(sprintf('\n      Elements and vertices:'));
  • issm/trunk-jpl/src/m/classes/mesh2d.py

    r17558 r17562  
    4242                #}}}
    4343        def __repr__(self): # {{{
    44                 string="   2d Mesh:"
     44                string="   2D tria Mesh (horizontal):"
    4545
    4646                string="%s\n%s"%(string,"\n      Elements and vertices:")
  • issm/trunk-jpl/src/m/classes/mesh2dvertical.m

    r16764 r17562  
    7777                end % }}}
    7878                function disp(obj) % {{{
    79                         disp(sprintf('   2d vertical Mesh:'));
     79                        disp(sprintf('   2D tria Mesh (vertical):'));
    8080
    8181                        disp(sprintf('\n      Elements and vertices:'));
  • issm/trunk-jpl/src/m/classes/mesh3dprisms.m

    r17558 r17562  
    9292                end % }}}
    9393                function disp(obj) % {{{
    94                         disp(sprintf('   Mesh:'));
     94                        disp(sprintf('   3D prism Mesh:'));
    9595
    9696                        disp(sprintf('\n      Elements and vertices of the original 2d mesh:'));
  • issm/trunk-jpl/src/m/classes/mesh3dprisms.py

    r17558 r17562  
    5555                #}}}
    5656        def __repr__(self): # {{{
    57                 string="   Mesh 3D prisms:"
     57                string="   3D prism Mesh:"
    5858
    5959                string="%s\n%s"%(string,"\n      Elements and vertices of the original 2d mesh3dprisms:")
  • issm/trunk-jpl/src/m/classes/mesh3dtetras.m

    r17483 r17562  
    8888                end % }}}
    8989                function disp(obj) % {{{
    90                         disp(sprintf('   Mesh:'));
     90                        disp(sprintf('   3D tetra Mesh:'));
    9191
    9292                        disp(sprintf('\n      Elements and vertices of the original 2d mesh:'));
  • issm/trunk-jpl/src/m/classes/model.m

    r17559 r17562  
    741741                        md.stressbalance.spcvz=project3d(md,'vector',md.stressbalance.spcvz,'type','node');
    742742                        md.thermal.spctemperature=project3d(md,'vector',md.thermal.spctemperature,'type','node','layer',md.mesh.numberoflayers,'padding',NaN);
     743                        if (length(md.initialization.temperature)==md.mesh.numberofvertices),
     744                                md.thermal.spctemperature=NaN*ones(md.mesh.numberofvertices,1);
     745                                if isprop(md.mesh,'vertexonsurface'),
     746                                        pos=find(md.mesh.vertexonsurface);
     747                                        md.thermal.spctemperature(pos)=md.initialization.temperature(pos); %impose observed temperature on surface
     748                                end
     749                        end
    743750                        md.masstransport.spcthickness=project3d(md,'vector',md.masstransport.spcthickness,'type','node');
    744751                        md.masstransport.calvingrate=project3d(md,'vector',md.masstransport.calvingrate,'type','node');
  • issm/trunk-jpl/src/m/classes/model.py

    r17558 r17562  
    640640                md.stressbalance.spcvz=project3d(md,'vector',md.stressbalance.spcvz,'type','node')
    641641                md.thermal.spctemperature=project3d(md,'vector',md.thermal.spctemperature,'type','node','layer',md.mesh.numberoflayers,'padding',float('NaN'))
     642                if isinstance(md.initialization.temperature,numpy.ndarray) and numpy.size(md.initialization.temperature,axis=0)==md.mesh.numberofvertices:
     643                        md.thermal.spctemperature=float('nan')*numpy.ones((md.mesh.numberofvertices,1))
     644                        if hasattr(md.mesh,'vertexonsurface'):
     645                                pos=numpy.nonzero(md.mesh.vertexonsurface)[0]
     646                                md.thermal.spctemperature[pos]=md.initialization.temperature[pos]    #impose observed temperature on surface
    642647                md.masstransport.spcthickness=project3d(md,'vector',md.masstransport.spcthickness,'type','node')
    643648                md.balancethickness.spcthickness=project3d(md,'vector',md.balancethickness.spcthickness,'type','node')
Note: See TracChangeset for help on using the changeset viewer.