Example #1
0
 def initialize(self):
     """Initialize PETSc.
     """
     import sys
     args = [sys.executable]
     options = self._getOptions()
     if len(options) > 0:
         for arg in options:
             args.append(arg)
     petsc.initialize(args)
     from pylith.mpi.Communicator import petsc_comm_world
     comm = petsc_comm_world()
     if 0 == comm.rank:
         self._info.log("Initialized PETSc.")
     return
Example #2
0
 def initialize(self):
   """
   Initialize PETSc.
   """
   import sys
   args = [sys.executable]
   options = self._getOptions()
   if len(options) > 0:
     for arg in options:
       args.append(arg)
   petsc.initialize(args)
   from pylith.mpi.Communicator import petsc_comm_world
   comm = petsc_comm_world()
   if 0 == comm.rank:
     self._info.log("Initialized PETSc.")
   return
Example #3
0
#!/usr/bin/env nemesis

import sys

if len(sys.argv) != 2:
    raise ValueError("usage: exotoascii.py EXODUS_MESH")
filenameEXO = sys.argv[1]
filenameASCII = filenameEXO.replace(".exo", ".mesh")

from pylith.meshio.MeshIOAscii import MeshIOAscii
from pylith.meshio.MeshIOCubit import MeshIOCubit
import pylith.utils.petsc as petsc

petsc.initialize(sys.argv)

cubit = MeshIOCubit()
cubit.inventory.filename = filenameEXO
cubit._configure()

mesh = cubit.read(debug=False, interpolate=True)

ascii = MeshIOAscii()
ascii.inventory.filename = filenameASCII
ascii._configure()
ascii.write(mesh)

del cubit
del ascii
del mesh

petsc.finalize()