示例#1
0
  def poststep(self, t, dt):
    """
    Hook for doing stuff after advancing time step.
    """
    logEvent = "%spoststep" % self._loggingPrefix
    self._eventLogger.eventBegin(logEvent)
    
    from pylith.mpi.Communicator import mpi_comm_world
    comm = mpi_comm_world()

    # The velocity and acceleration at time t depends on the
    # displacement at time t+dt, we want to output BEFORE updating the
    # displacement fields so that the displacement, velocity, and
    # acceleration files are all at time t.
    if 0 == comm.rank:
      self._info.log("Writing solution fields.")
    for output in self.output.components():
      output.writeData(t, self.fields)
    self._writeData(t)

    # Update displacement field from time t to time t+dt.
    dispIncr = self.fields.get("dispIncr(t->t+dt)")
    dispT = self.fields.get("disp(t)")
    dispTmdt = self.fields.get("disp(t-dt)")

    dispTmdt.copy(dispT)
    dispT.add(dispIncr)
    dispIncr.zeroAll()

    # Complete post-step processing.
    Formulation.poststep(self, t, dt)

    self._eventLogger.eventEnd(logEvent)    
    return
示例#2
0
    def poststep(self, t, dt):
        """
    Hook for doing stuff after advancing time step.
    """
        logEvent = "%spoststep" % self._loggingPrefix
        self._eventLogger.eventBegin(logEvent)

        from pylith.mpi.Communicator import mpi_comm_world
        comm = mpi_comm_world()

        # The velocity and acceleration at time t depends on the
        # displacement at time t+dt, we want to output BEFORE updating the
        # displacement fields so that the displacement, velocity, and
        # acceleration files are all at time t.
        if 0 == comm.rank:
            self._info.log("Writing solution fields.")
        for output in self.output.components():
            output.writeData(t, self.fields)
        self._writeData(t)

        # Update displacement field from time t to time t+dt.
        dispIncr = self.fields.get("dispIncr(t->t+dt)")
        dispT = self.fields.get("disp(t)")
        dispTmdt = self.fields.get("disp(t-dt)")

        dispTmdt.copy(dispT)
        dispT.add(dispIncr)
        dispIncr.zeroAll()

        # Complete post-step processing.
        Formulation.poststep(self, t, dt)

        self._eventLogger.eventEnd(logEvent)
        return
示例#3
0
  def poststep(self, t, dt):
    """
    Hook for doing stuff after advancing time step.
    """
    from pylith.mpi.Communicator import mpi_comm_world
    comm = mpi_comm_world()

    # Update displacement field from time t to time t+dt.
    dispIncr = self.fields.get("dispIncr(t->t+dt)")
    disp = self.fields.get("disp(t)")
    disp.add(dispIncr)
    dispIncr.zeroAll()

    # Complete post-step processing, then write data.
    Formulation.poststep(self, t, dt)

    # Write data. Velocity at time t will be based upon displacement
    # at time t-dt and t.
    if 0 == comm.rank:
      self._info.log("Writing solution fields.")
    for output in self.output.components():
      output.writeData(t+dt, self.fields)
    self._writeData(t+dt)

    return
示例#4
0
  def poststep(self, t, dt):
    """
    Hook for doing stuff after advancing time step.
    """
    comm = self.mesh().comm()

    # Update displacement field from time t to time t+dt.
    dispIncr = self.fields.get("dispIncr(t->t+dt)")
    disp = self.fields.get("disp(t)")
    disp.add(dispIncr)
    dispIncr.zeroAll()

    # Complete post-step processing, then write data.
    Formulation.poststep(self, t, dt)

    # Write data. Velocity at time t will be based upon displacement
    # at time t-dt and t.
    if 0 == comm.rank:
      self._info.log("Writing solution fields.")
    for output in self.output.components():
      output.writeData(t+dt, self.fields)
    self._writeData(t+dt)

    return