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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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'):
Note: See TracChangeset for help on using the changeset viewer.