Changeset 23440


Ignore:
Timestamp:
10/30/18 17:59:04 (6 years ago)
Author:
schlegel
Message:

BUG: Python partitioning for 3D meshes had not been tested

File:
1 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/m/partition/partitioner.py

    r23231 r23440  
    11import numpy as np
     2import copy
    23from pairoptions import *
    34import MatlabFuncs as m
     
    4142        recomputeadjacency=options.getfieldvalue('recomputeadjacency')
    4243
    43         if(np.ndim(md.mesh)==3):
     44        if(md.mesh.dimension()==3):
    4445                #partitioning essentially happens in 2D. So partition in 2D, then
    4546                #extrude the partition vector vertically.
    46                 md3d=md #save  for later
     47                md3d = copy.deepcopy(md)
    4748                md.mesh.elements=md.mesh.elements2d
    4849                md.mesh.x=md.mesh.x2d
     
    116117
    117118        #extrude if we are in 3D:
    118         if np.ndim(md.mesh)==3:
     119        if md.mesh.dimension()==3:
    119120                md3d.qmu.vertex_weight=md.qmu.vertex_weight
    120121                md3d.qmu.adjacency=md.qmu.adjacency
    121122                md=md3d
    122                 part=project3d(md,'vector',part.T,'type','node')
     123                part=project3d(md,'vector',np.squeeze(part),'type','node')
    123124
    124125        md.qmu.partition=part
Note: See TracChangeset for help on using the changeset viewer.