Changeset 23231 for issm/trunk-jpl/src/m/partition/partitioner.py
- Timestamp:
- 09/08/18 13:03:10 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/m/partition/partitioner.py
r23095 r23231 3 3 import MatlabFuncs as m 4 4 from adjacency import * 5 #from Chaco import *5 from Chaco import * 6 6 #from Scotch import * 7 #from MeshPartition import *7 from MeshPartition import * 8 8 from project3d import * 9 from mesh2d import * 9 10 10 11 def partitioner(md,*varargin): … … 60 61 61 62 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') 63 64 64 65 # 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) 68 69 69 70 #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) 71 72 72 73 #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]=176 #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=[] 78 79 80 method = method.reshape(-1,1) # transpose to 1x10 instead of 10 81 79 82 # 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. 85 87 86 88 elif m.strcmpi(package,'scotch'):
Note:
See TracChangeset
for help on using the changeset viewer.