def refine(self, mesh): """ Refine mesh. """ self._setupLogging() logEvent = "%srefine" % self._loggingPrefix self._eventLogger.eventBegin(logEvent) from pylith.mpi.Communicator import petsc_comm_world comm = petsc_comm_world() if 0 == comm.rank: self._info.log("Refining mesh using uniform refinement.") from Mesh import Mesh newMesh = Mesh() newMesh.debug(mesh.debug()) newMesh.coordsys(mesh.coordsys()) ModuleRefineUniform.refine(self, newMesh, mesh, self.levels) mesh.cleanup() self._eventLogger.eventEnd(logEvent) return newMesh
def refine(self, mesh): """ Refine mesh. """ self._setupLogging() logEvent = "%srefine" % self._loggingPrefix self._eventLogger.eventBegin(logEvent) newMesh = mesh from Mesh import Mesh newMesh = Mesh(dim=mesh.dimension(), comm=mesh.comm()) newMesh.debug(mesh.debug()) newMesh.coordsys(mesh.coordsys()) ModuleRefineUniform.refine(self, newMesh, mesh, self.levels) if not newMesh == mesh: #from pylith.utils.petsc import MemoryLogger #memoryLogger = MemoryLogger.singleton() #memoryLogger.stagePush(mesh.memLoggingStage) mesh.cleanup() #memoryLogger.stagePop() self._eventLogger.eventEnd(logEvent) return newMesh
def _createModuleObj(self): """ Create handle to C++ object. """ ModuleRefineUniform.__init__(self) return