Exemplo n.º 1
0
  def test_distribute(self):
    """
    Test distribute()
    """
    generator = MeshGenSimple()
    generator.interpolate = True
    generator.setBoundary(generator.createCubeBoundary())
    mesh = generator.create()

    from pylith.meshio.OutputManager import OutputManager
    io = OutputManager()
    io._configure()
    io.writer._configure()
    io.writer.filename = 'mesh.vtk'
    from spatialdata.geocoords.CSCart import CSCart
    io.coordsys = CSCart()
    mesh.coordsys = CSCart()
    self.mesh = mesh

    from pyre.units.time import s
    io.preinitialize(self)
    io.initialize()
    io.writeInfo()

    from pylith.topology.Distributor import Distributor
    distributor = Distributor()
    distributor.partitioner = "chaco"
    newMesh = distributor.distribute(mesh)
    self.mesh = newMesh
    io.writer.filename = 'newMesh.vtk'
    io.writeInfo()
    return