def _setupLogging(self): """ Setup event logging. """ if not "_loggingPrefix" in dir(self): self._loggingPrefix = "" from pylith.utils.EventLogger import EventLogger logger = EventLogger() logger.className("PDE Formulation") logger.initialize() events = ["preinit", "verify", "init", "timestep", "prestep", "step", "poststep", "write", "finalize"] for event in events: logger.registerEvent("%s%s" % (self._loggingPrefix, event)) stages = ["Reform Jacobian", "Reform Residual", "Solve"] for stage in stages: logger.registerStage(stage) self._eventLogger = logger return
def _setupLogging(self): """ Setup event logging. """ if None == self._loggingPrefix: self._loggingPrefix = "" from pylith.utils.EventLogger import EventLogger logger = EventLogger() logger.className("FE Constraint") logger.initialize() events = ["verify", "init", "setSizes", "constraints", "setField", "poststep", "write", "finalize"] for event in events: logger.registerEvent("%s%s" % (self._loggingPrefix, event)) self._eventLogger = logger return
def _setupLogging(self): """Setup event logging. """ self._loggingPrefix = "Refin " from pylith.utils.EventLogger import EventLogger logger = EventLogger() logger.setClassName("FE Refinement") logger.initialize() events = ["refine"] for event in events: logger.registerEvent("%s%s" % (self._loggingPrefix, event)) self._eventLogger = logger return
def _setupLogging(self): """ Setup event logging. """ self._loggingPrefix = "Dist " from pylith.utils.EventLogger import EventLogger logger = EventLogger() logger.className("FE Distribution") logger.initialize() events = ["distribute"] for event in events: logger.registerEvent("%s%s" % (self._loggingPrefix, event)) self._eventLogger = logger return
def _setupLogging(self): """ Setup event logging. """ if not "_loggingPrefix" in dir(self): self._loggingPrefix = "" from pylith.utils.EventLogger import EventLogger logger = EventLogger() logger.className("Mesh Generator") logger.initialize() events = ["create", "adjTopo"] for event in events: logger.registerEvent("%s%s" % (self._loggingPrefix, event)) self._eventLogger = logger return
def _setupLogging(self): """ Setup event logging. """ if None == self._loggingPrefix: self._loggingPrefix = "" from pylith.utils.EventLogger import EventLogger logger = EventLogger() logger.className("FE FrictionModel") logger.initialize() events = [] for event in events: logger.registerEvent("%s%s" % (self._loggingPrefix, event)) self._eventLogger = logger return
def _setupLogging(self): """ Setup event logging. """ if not "_loggingPrefix" in dir(self): self._loggingPrefix = "" from pylith.utils.EventLogger import EventLogger logger = EventLogger() logger.className("FE Integrator") logger.initialize() events = ["preinit", "verify", "init", "poststep", "write", "finalize"] for event in events: logger.registerEvent("%s%s" % (self._loggingPrefix, event)) self._eventLogger = logger return
def _setupLogging(self): """ Setup event logging. """ if not "_loggingPrefix" in dir(self): self._loggingPrefix = "" from pylith.utils.EventLogger import EventLogger logger = EventLogger() logger.className("Slip Time Function") logger.initialize() events = ["verify", "init"] for event in events: logger.registerEvent("%s%s" % (self._loggingPrefix, event)) self._eventLogger = logger return
def _setupLogging(self): """ Setup event logging. """ if not "_loggingPrefix" in dir(self): self._loggingPrefix = "" from pylith.utils.EventLogger import EventLogger logger = EventLogger() logger.className("Kinematic Earthquake Source") logger.initialize() events = ["verify", "init"] for event in events: logger.registerEvent("%s%s" % (self._loggingPrefix, event)) self._eventLogger = logger return
def test_eventLogging(self): from pylith.utils.EventLogger import EventLogger logger = EventLogger() logger.setClassName("logging A") logger.initialize() events = ["event 1", "event 2", "event 3"] for event in events: logger.registerEvent(event) logger.eventBegin("event 2") logger.eventEnd("event 2") logger.eventBegin("event 1") logger.eventEnd("event 1") logger.eventBegin("event 3") logger.eventBegin("event 1") logger.eventEnd("event 1") logger.eventEnd("event 3") return
def _setupLogging(self): """ Setup event logging. """ if not "_loggingPrefix" in dir(self): self._loggingPrefix = "" from pylith.utils.EventLogger import EventLogger logger = EventLogger() logger.className("FE Output") logger.initialize() events = [ "init", "open", "close", "openStep", "closeStep", "writeInfo", "writeData" ] for event in events: logger.registerEvent("%s%s" % (self._loggingPrefix, event)) self._eventLogger = logger return
def test_registerEvent(self): from pylith.utils.EventLogger import EventLogger logger = EventLogger() logger.setClassName("logging A") logger.initialize() events = ["event 1", "event 2", "event 3"] id = {} for event in events: id[event] = logger.registerEvent(event) for event in events: self.assertEqual(id[event], logger.getEventId(event)) return
def test_eventLogging(self): """ Test eventBegin() and eventEnd(). """ from pylith.utils.EventLogger import EventLogger logger = EventLogger() logger.className("logging A") logger.initialize() events = ["event 1" , "event 2" , "event 3"] for event in events: logger.registerEvent(event) logger.eventBegin("event 2") logger.eventEnd("event 2") logger.eventBegin("event 1") logger.eventEnd("event 1") logger.eventBegin("event 3") logger.eventBegin("event 1") logger.eventEnd("event 1") logger.eventEnd("event 3") return
def _setupLogging(self): """ Setup event logging. """ if not "_loggingPrefix" in dir(self): self._loggingPrefix = "" from pylith.utils.EventLogger import EventLogger logger = EventLogger() logger.className("FE Output") logger.initialize() events = ["init", "open", "close", "openStep", "closeStep", "writeInfo", "writeData"] for event in events: logger.registerEvent("%s%s" % (self._loggingPrefix, event)) self._eventLogger = logger return
def test_registerEvent(self): """ Test registerEvent(). """ from pylith.utils.EventLogger import EventLogger logger = EventLogger() logger.className("logging A") logger.initialize() events = ["event 1" , "event 2" , "event 3"] id = {} for event in events: id[event] = logger.registerEvent(event) for event in events: self.assertEqual(id[event], logger.eventId(event)) return