Changeset 13455


Ignore:
Timestamp:
09/26/12 17:02:08 (12 years ago)
Author:
mikep
Message:

t cases 201, 3001..3010. Conversion of SquareShelf.par to .py. Creation of matlab script -> python script conversion tool {/scripts/mToPy.py}. Modification of modules/python/Makefile.am to support use of ContourToMesh[cpp]. Utilization of deep copy when marshaling flowequation data. Add support of ice-front-file specification [as param] to SetIceShelfBC.

Location:
issm/trunk-jpl
Files:
14 added
3 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified issm/trunk-jpl/src/m/boundaryconditions/SetIceShelfBC.py

    r13076 r13455  
    11import os
    22import numpy
     3from ContourToMesh import ContourToMesh
    34
    45def SetIceShelfBC(md,icefrontfile=''):
     
    2425                if not os.path.exists(icefrontfile):
    2526                        raise IOError("SetIceShelfBC error message: ice front file '%s' not found." % icefrontfile)
    26                 nodeinsideicefront=ContourToMesh(md.mesh.elements,md.mesh.x,md.mesh.y,icefrontfile,'node',2)
    27                 nodeonicefront=double(md.mesh.vertexonboundary and nodeinsideicefront)
     27                nodeinsideicefront=ContourToMesh((md.mesh.elements).reshape(-1,1),(md.mesh.x).reshape(-1,1),(md.mesh.y).reshape(-1,1),icefrontfile,'node',2)
     28                nodeonicefront= numpy.bitwise_and( map(int,md.mesh.vertexonboundary), map(int,nodeinsideicefront[0].ravel()) )
    2829        else:
    2930                nodeonicefront=numpy.zeros(md.mesh.numberofvertices)
  • TabularUnified issm/trunk-jpl/src/m/classes/flowequation.py

    r13171 r13455  
    11#module imports
     2import copy
    23import numpy
    34from fielddisplay import fielddisplay
     
    8182
    8283        def marshall(self,fid):    # {{{
     84                #print "marshalling flowequation-1"
     85                #print self.vertex_equation
    8386                WriteData(fid,'object',self,'fieldname','ismacayealpattyn','format','Boolean')
    8487                WriteData(fid,'object',self,'fieldname','ishutter','format','Boolean')
     
    8992                WriteData(fid,'object',self,'fieldname','borderstokes','format','DoubleMat','mattype',1)
    9093                #convert approximations to enums
    91                 data=self.vertex_equation
     94                ## data=list(self.vertex_equation)
     95                data=copy.deepcopy(self.vertex_equation)
    9296                data[numpy.nonzero(data==0)]=NoneApproximationEnum()
    9397                data[numpy.nonzero(data==1)]=HutterApproximationEnum()
     
    100104                data[numpy.nonzero(data==8)]=L1L2ApproximationEnum()
    101105                WriteData(fid,'data',data,'enum',FlowequationVertexEquationEnum(),'format','DoubleMat','mattype',1)
    102                 data=self.element_equation
     106                ########data=self.element_equation
     107                data=copy.deepcopy(self.element_equation)
    103108                data[numpy.nonzero(data==0)]=NoneApproximationEnum()
    104109                data[numpy.nonzero(data==1)]=HutterApproximationEnum()
     
    111116                data[numpy.nonzero(data==8)]=L1L2ApproximationEnum()
    112117                WriteData(fid,'data',data,'enum',FlowequationElementEquationEnum(),'format','DoubleMat','mattype',2)
     118                #print "marshalling flowequation-4"
     119                #print self.vertex_equation
    113120        # }}}
    114121
  • TabularUnified issm/trunk-jpl/src/modules/python/Makefile.am

    r13441 r13455  
    1414                                                NodeConnectivity.la\
    1515                                                StringToEnum.la\
     16                                                ContourToMesh.la\
    1617                                                TriMesh.la
    1718endif
     
    9495StringToEnum_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB)
    9596
     97ContourToMesh_la_SOURCES = ../ContourToMesh/ContourToMesh.cpp\
     98                                                                  ../ContourToMesh/ContourToMesh.h
     99ContourToMesh_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB)
     100
    96101TriMesh_la_SOURCES = ../TriMesh/TriMesh.cpp\
    97102                                                        ../TriMesh/TriMesh.h
Note: See TracChangeset for help on using the changeset viewer.