Changeset 23231 for issm/trunk-jpl/src/m


Ignore:
Timestamp:
09/08/18 13:03:10 (7 years ago)
Author:
kruegern
Message:

NEW: added Dakota/QMU Chaco tests (234,235,413,414,417,444), minor bug fixes, left out 418 due to unresolved memory issues

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

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/m/modules/Chaco.py

    r23095 r23231  
    55
    66   Usage:
    7       [assgn] = Chaco(A,vwgts,ewgts,x,y,z,options,nparts,goal);
     7      assgn = Chaco(A,vwgts,ewgts,x,y,z,options,nparts,goal);
    88
    99   A:                   Input adjacency matrix
  • issm/trunk-jpl/src/m/modules/Scotch.py

    r23095 r23231  
    22
    33def Scotch(*varargin):
    4 '''SCOTCH - Scotch partitioner
     4        '''SCOTCH - Scotch partitioner
    55
    66   Usage:
  • issm/trunk-jpl/src/m/partition/partitioner.py

    r23095 r23231  
    33import MatlabFuncs as m
    44from adjacency import *
    5 #from Chaco import *
     5from Chaco import *
    66#from Scotch import *
    7 #from MeshPartition import *
     7from MeshPartition import *
    88from project3d import *
     9from mesh2d import *
    910
    1011def partitioner(md,*varargin):
     
    6061
    6162        if m.strcmpi(package,'chaco'):
    62                 raise RuntimeError('Chaco is not currently supported for this function')
     63                #raise RuntimeError('Chaco is not currently supported for this function')
    6364
    6465                #  default method (from chaco.m)
    65                 #method=np.array([1,1,0,0,1,1,50,0,.001,7654321]).reshape(-1,1)
    66                 #method[0]=3    #  global method (3=inertial (geometric))
    67                 #method[2]=0    #  vertex weights (0=off, 1=on)
     66                method=np.array([1,1,0,0,1,1,50,0,.001,7654321])
     67                method[0]=3    #  global method (3=inertial (geometric))
     68                method[2]=0    #  vertex weights (0=off, 1=on)
    6869
    6970                #specify bisection
    70                 #method[5]=options.getfieldvalue('section')#  ndims (1=bisection, 2=quadrisection, 3=octasection)
     71                method[5]=options.getfieldvalue('section')#  ndims (1=bisection, 2=quadrisection, 3=octasection)
    7172
    7273                #are we using weights?
    73                 #if m.strcmpi(options.getfieldvalue('weighting'),'on'):
    74                         #weights=np.floor(md.qmu.vertex_weight/min(md.qmu.vertex_weight))
    75                         #method[2]=1
    76                 #else:
    77                         #weights=[]
     74                if m.strcmpi(options.getfieldvalue('weighting'),'on'):
     75                        weights=np.floor(md.qmu.vertex_weight/min(md.qmu.vertex_weight))
     76                        method[2]=1
     77                else:
     78                        weights=[]
    7879       
     80                method = method.reshape(-1,1)   # transpose to 1x10 instead of 10
     81
    7982                #  partition into nparts
    80                 #if isinstance(md.mesh,mesh2d):
    81                         #part=Chaco(md.qmu.adjacency,weights,[],md.mesh.x, md.mesh.y,np.zeros((md.mesh.numberofvertices,)),method,npart,[]).T+1 #index partitions from 1 up. like metis.
    82                 #else:
    83                         #part=Chaco(md.qmu.adjacency,weights,[],md.mesh.x, md.mesh.y,md.mesh.z,method,npart,[]).T+1 #index partitions from 1 up. like metis.
    84        
     83                if isinstance(md.mesh,mesh2d):
     84                        part=np.array(Chaco(md.qmu.adjacency,weights,np.array([]),md.mesh.x, md.mesh.y,np.zeros((md.mesh.numberofvertices,)),method,npart,np.array([]))).T+1 #index partitions from 1 up. like metis.
     85                else:
     86                        part=np.array(Chaco(md.qmu.adjacency,weights,np.array([]),md.mesh.x, md.mesh.y,md.mesh.z,method,npart,np.array([]))).T+1 #index partitions from 1 up. like metis.
    8587       
    8688        elif m.strcmpi(package,'scotch'):
  • issm/trunk-jpl/src/m/qmu/dakota_in_write.py

    r23095 r23231  
    6262        filei2=fullfile(pathstr,name+ext)
    6363
    64         print 'Opening Dakota input file \''+filei2 + '\''
     64        print 'Opening Dakota input file \''+filei2 + '\'.'
    6565        try:
    6666                with open(filei2,'w+') as fidi:
  • issm/trunk-jpl/src/m/qmu/dakota_out_parse.py

    r23095 r23231  
    241241        dmax95 =prctile_issm(data,95,0)
    242242
     243        # Note: the following line may cause the following warning
     244        #       (should not crash or invalidate results) when one of
     245        #       the inputs does not change with respect to the
     246        #       other/s causing an internal divide-by-zero error
     247
     248        #/usr/local/lib/python2.7/dist-packages/numpy/lib/function_base.py:3163:
     249        #       RuntimeWarning: invalid value encountered in true_divide
     250        #       c /= stddev[:,None]
     251
     252        #       (and/or the same but with "c /= stddev[None, :]")
     253
    243254        dcorrel=np.corrcoef(data.T)
    244255
  • issm/trunk-jpl/src/m/qmu/process_qmu_response_data.m

    r23095 r23231  
    4343        %ok, process the domains named in qmu_mass_flux_profiles,  to build a list of segments (MatArray)
    4444        md.qmu.mass_flux_segments=cell(num_mass_flux,1);
    45         md.qmu.mass_flux_segments
    4645        for i=1:num_mass_flux,
    4746                md.qmu.mass_flux_segments{i}=MeshProfileIntersection(md.mesh.elements,md.mesh.x,md.mesh.y,[md.qmu.mass_flux_profile_directory '/' md.qmu.mass_flux_profiles{i}]);
    4847        end
    49         md.qmu.mass_flux_segments
    5048end
Note: See TracChangeset for help on using the changeset viewer.