Example #1
0
  def preinitialize(self, mesh):
    """
    Do pre-initialization setup.
    """
    from pylith.mpi.Communicator import mpi_comm_world
    comm = mpi_comm_world()

    if 0 == comm.rank:
      self._info.log("Pre-initializing fault '%s'." % self.label())
    FaultCohesive.preinitialize(self, mesh)
    Integrator.preinitialize(self, mesh)

    ModuleFaultCohesiveKin.quadrature(self, self.faultQuadrature)

    for eqsrc in self.eqsrcs.components():
      eqsrc.preinitialize()
    ModuleFaultCohesiveKin.eqsrcs(self, self.eqsrcs.inventory.facilityNames(),
                                  self.eqsrcs.components())

    for name in self.eqsrcs.inventory.facilityNames():
      self.availableFields['vertex']['info'] += ["final_slip_%s" % name]
      self.availableFields['vertex']['info'] += ["slip_time_%s" % name]

    if mesh.dimension() == 2:
      self.availableFields['vertex']['info'] += ["strike_dir"]
    elif mesh.dimension() == 3:
      self.availableFields['vertex']['info'] += ["strike_dir",
                                                 "dip_dir"]
    return
Example #2
0
  def preinitialize(self, mesh):
    """
    Do pre-initialization setup.
    """
    from pylith.mpi.Communicator import mpi_comm_world
    comm = mpi_comm_world()    

    if 0 == comm.rank:
      self._info.log("Pre-initializing fault '%s'." % self.label())
    FaultCohesive.preinitialize(self, mesh)
    Integrator.preinitialize(self, mesh)

    ModuleFaultCohesiveDyn.quadrature(self, self.faultQuadrature)

    if mesh.dimension() == 2:
      self.availableFields['vertex']['info'] += ["strike_dir"]
    elif mesh.dimension() == 3:
      self.availableFields['vertex']['info'] += ["strike_dir",
                                                 "dip_dir"]

    if not isinstance(self.tract, NullComponent):
      self.tract.preinitialize(mesh)
      self.availableFields['vertex']['info'] += self.tract.availableFields['vertex']['info']

    self.availableFields['vertex']['info'] += \
        self.friction.availableFields['vertex']['info']
    self.availableFields['vertex']['data'] += \
        self.friction.availableFields['vertex']['data']
    return
Example #3
0
    def preinitialize(self, mesh):
        """
    Do pre-initialization setup.
    """
        from pylith.mpi.Communicator import mpi_comm_world
        comm = mpi_comm_world()

        if 0 == comm.rank:
            self._info.log("Pre-initializing fault '%s'." % self.label())
        FaultCohesive.preinitialize(self, mesh)
        Integrator.preinitialize(self, mesh)

        ModuleFaultCohesiveKin.quadrature(self, self.faultQuadrature)

        for eqsrc in self.eqsrcs.components():
            eqsrc.preinitialize()
        ModuleFaultCohesiveKin.eqsrcs(self,
                                      self.eqsrcs.inventory.facilityNames(),
                                      self.eqsrcs.components())

        for name in self.eqsrcs.inventory.facilityNames():
            self.availableFields['vertex']['info'] += ["final_slip_%s" % name]
            self.availableFields['vertex']['info'] += ["slip_time_%s" % name]

        if mesh.dimension() == 2:
            self.availableFields['vertex']['info'] += ["strike_dir"]
        elif mesh.dimension() == 3:
            self.availableFields['vertex']['info'] += ["strike_dir", "dip_dir"]
        return
    def preinitialize(self, mesh):
        """
    Do pre-initialization setup.
    """
        from pylith.mpi.Communicator import mpi_comm_world
        comm = mpi_comm_world()

        if 0 == comm.rank:
            self._info.log("Pre-initializing fault '%s'." % self.label())
        FaultCohesive.preinitialize(self, mesh)
        Integrator.preinitialize(self, mesh)

        ModuleFaultCohesiveDyn.quadrature(self, self.faultQuadrature)

        if mesh.dimension() == 2:
            self.availableFields['vertex']['info'] += ["strike_dir"]
        elif mesh.dimension() == 3:
            self.availableFields['vertex']['info'] += ["strike_dir", "dip_dir"]

        if not isinstance(self.tract, NullComponent):
            self.tract.preinitialize(mesh)
            self.availableFields['vertex'][
                'info'] += self.tract.availableFields['vertex']['info']

        self.availableFields['vertex']['info'] += \
            self.friction.availableFields['vertex']['info']
        self.availableFields['vertex']['data'] += \
            self.friction.availableFields['vertex']['data']
        return
Example #5
0
 def _configure(self):
   """
   Setup members using inventory.
   """
   FaultCohesive._configure(self)
   self.eqsrcs = self.inventory.eqsrcs
   self.output = self.inventory.output
   return
Example #6
0
 def _configure(self):
     """
 Setup members using inventory.
 """
     FaultCohesive._configure(self)
     self.eqsrcs = self.inventory.eqsrcs
     self.output = self.inventory.output
     return
 def finalize(self):
   """
   Cleanup.
   """
   FaultCohesive.finalize(self)
   Integrator.finalize(self)
   self.output.close()
   self.output.finalize()
   return
 def finalize(self):
     """
 Cleanup.
 """
     FaultCohesive.finalize(self)
     Integrator.finalize(self)
     self.output.close()
     self.output.finalize()
     return
Example #9
0
 def finalize(self):
     """
 Cleanup.
 """
     for eqsrc in self.eqsrcs.components():
         eqsrc.finalize()
     FaultCohesive.finalize(self)
     Integrator.finalize(self)
     self.output.close()
     self.output.finalize()
     return
Example #10
0
 def finalize(self):
   """
   Cleanup.
   """
   for eqsrc in self.eqsrcs.components():
     eqsrc.finalize()
   FaultCohesive.finalize(self)
   Integrator.finalize(self)
   self.output.close()
   self.output.finalize()
   return
Example #11
0
  def poststep(self, t, dt, fields):
    """
    Hook for doing stuff after advancing time step.
    """
    logEvent = "%spoststep" % self._loggingPrefix
    self._eventLogger.eventBegin(logEvent)

    Integrator.poststep(self, t, dt, fields)
    FaultCohesive.poststep(self, t, dt, fields)

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

    Integrator.poststep(self, t, dt, fields)
    FaultCohesive.poststep(self, t, dt, fields)

    self._eventLogger.eventEnd(logEvent)
    return
Example #13
0
 def _configure(self):
   """
   Setup members using inventory.
   """
   FaultCohesive._configure(self)
   if not isinstance(self.inventory.tract, NullComponent):
     ModuleFaultCohesiveDyn.tractPerturbation(self, self.inventory.tract)
   ModuleFaultCohesiveDyn.frictionModel(self, self.inventory.friction)
   ModuleFaultCohesiveDyn.zeroTolerance(self, self.inventory.zeroTolerance)
   ModuleFaultCohesiveDyn.openFreeSurf(self, self.inventory.openFreeSurf)
   self.output = self.inventory.output
   return
    def verifyConfiguration(self):
        """
    Verify compatibility of configuration.
    """
        logEvent = "%sverify" % self._loggingPrefix
        self._eventLogger.eventBegin(logEvent)

        FaultCohesive.verifyConfiguration(self)
        Integrator.verifyConfiguration(self)
        ModuleFaultCohesiveDyn.verifyConfiguration(self, self.mesh())

        self._eventLogger.eventEnd(logEvent)
        return
  def verifyConfiguration(self):
    """
    Verify compatibility of configuration.
    """
    logEvent = "%sverify" % self._loggingPrefix
    self._eventLogger.eventBegin(logEvent)

    FaultCohesive.verifyConfiguration(self)
    Integrator.verifyConfiguration(self)
    ModuleFaultCohesiveImpulses.verifyConfiguration(self, self.mesh())

    self._eventLogger.eventEnd(logEvent)
    return
Example #16
0
  def _configure(self):
    """
    Setup members using inventory.
    """
    import numpy
    FaultCohesive._configure(self)
    self.output = self.inventory.output

    ModuleFaultCohesiveImpulses.threshold(self, self.inventory.threshold.value)
    impulseDOF = numpy.array(self.inventory.impulseDOF, dtype=numpy.int32)
    ModuleFaultCohesiveImpulses.impulseDOF(self, impulseDOF)
    ModuleFaultCohesiveImpulses.dbImpulseAmp(self, self.inventory.dbImpulseAmp)
    return
  def _configure(self):
    """
    Setup members using inventory.
    """
    import numpy
    FaultCohesive._configure(self)
    self.output = self.inventory.output

    ModuleFaultCohesiveImpulses.threshold(self, self.inventory.threshold.value)
    impulseDOF = numpy.array(self.inventory.impulseDOF, dtype=numpy.int32)
    ModuleFaultCohesiveImpulses.impulseDOF(self, impulseDOF)
    ModuleFaultCohesiveImpulses.dbImpulseAmp(self, self.inventory.dbImpulseAmp)
    return
Example #18
0
    def __init__(self, name="faultcohesiveimpulses"):
        """
    Initialize configuration.
    """
        FaultCohesive.__init__(self, name)
        Integrator.__init__(self)
        self._loggingPrefix = "CoIm "

        self.availableFields = {
            "vertex": {"info": ["normal_dir", "impulse_amplitude", "area"], "data": ["slip", "traction_change"]},
            "cell": {"info": ["partition"], "data": []},
        }
        return
Example #19
0
 def _configure(self):
   """
   Setup members using inventory.
   """
   FaultCohesive._configure(self)
   if not isinstance(self.inventory.tract, NullComponent):
     ModuleFaultCohesiveDyn.tractPerturbation(self, self.inventory.tract)
   ModuleFaultCohesiveDyn.frictionModel(self, self.inventory.friction)
   ModuleFaultCohesiveDyn.zeroTolerance(self, self.inventory.zeroTolerance)
   ModuleFaultCohesiveDyn.zeroToleranceNormal(self, self.inventory.zeroToleranceNormal)
   ModuleFaultCohesiveDyn.openFreeSurf(self, self.inventory.openFreeSurf)
   self.output = self.inventory.output
   return
Example #20
0
  def initialize(self, totalTime, numTimeSteps, normalizer):
    """
    Initialize cohesive elements.
    """
    logEvent = "%sinit" % self._loggingPrefix
    self._eventLogger.eventBegin(logEvent)
    self._info.log("Initializing fault '%s'." % self.label())

    Integrator.initialize(self, totalTime, numTimeSteps, normalizer)
    
    FaultCohesive.initialize(self, totalTime, numTimeSteps, normalizer)

    self._eventLogger.eventEnd(logEvent)
    return
Example #21
0
  def initialize(self, totalTime, numTimeSteps, normalizer):
    """
    Initialize cohesive elements.
    """
    logEvent = "%sinit" % self._loggingPrefix
    self._eventLogger.eventBegin(logEvent)
    self._info.log("Initializing fault '%s'." % self.label())

    Integrator.initialize(self, totalTime, numTimeSteps, normalizer)
    
    FaultCohesive.initialize(self, totalTime, numTimeSteps, normalizer)

    self._eventLogger.eventEnd(logEvent)
    return
Example #22
0
    def verifyConfiguration(self):
        """
    Verify compatibility of configuration.
    """
        logEvent = "%sverify" % self._loggingPrefix
        self._eventLogger.eventBegin(logEvent)

        FaultCohesive.verifyConfiguration(self)
        Integrator.verifyConfiguration(self)
        ModuleFaultCohesiveKin.verifyConfiguration(self, self.mesh())

        for eqsrc in self.eqsrcs.components():
            eqsrc.verifyConfiguration()

        self._eventLogger.eventEnd(logEvent)
        return
Example #23
0
  def verifyConfiguration(self):
    """
    Verify compatibility of configuration.
    """
    logEvent = "%sverify" % self._loggingPrefix
    self._eventLogger.eventBegin(logEvent)

    FaultCohesive.verifyConfiguration(self)
    Integrator.verifyConfiguration(self)
    ModuleFaultCohesiveKin.verifyConfiguration(self, self.mesh())

    for eqsrc in self.eqsrcs.components():
      eqsrc.verifyConfiguration()
    
    self._eventLogger.eventEnd(logEvent)
    return
Example #24
0
  def preinitialize(self, mesh):
    """
    Do pre-initialization setup.
    """
    self._info.log("Pre-initializing fault '%s'." % self.label())
    FaultCohesive.preinitialize(self, mesh)
    Integrator.preinitialize(self, mesh)

    ModuleFaultCohesiveTract.quadrature(self, self.faultQuadrature)

    if mesh.dimension() == 2:
      self.availableFields['cell']['info'] += ["strike_dir"]
    elif mesh.dimension() == 3:
      self.availableFields['cell']['info'] += ["strike_dir",
                                               "dip_dir"]

    return
Example #25
0
  def preinitialize(self, mesh):
    """
    Do pre-initialization setup.
    """
    self._info.log("Pre-initializing fault '%s'." % self.label())
    FaultCohesive.preinitialize(self, mesh)
    Integrator.preinitialize(self, mesh)

    ModuleFaultCohesiveTract.quadrature(self, self.faultQuadrature)

    if mesh.dimension() == 2:
      self.availableFields['cell']['info'] += ["strike_dir"]
    elif mesh.dimension() == 3:
      self.availableFields['cell']['info'] += ["strike_dir",
                                               "dip_dir"]

    return
  def initialize(self, totalTime, numTimeSteps, normalizer):
    """
    Initialize cohesive elements.
    """
    logEvent = "%sinit" % self._loggingPrefix
    self._eventLogger.eventBegin(logEvent)

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

    if 0 == comm.rank:
      self._info.log("Initializing fault '%s'." % self.label())

    Integrator.initialize(self, totalTime, numTimeSteps, normalizer)
    FaultCohesive.initialize(self, totalTime, numTimeSteps, normalizer)

    self._eventLogger.eventEnd(logEvent)
    return
Example #27
0
  def __init__(self, name="faultcohesivedyn"):
    """
    Initialize configuration.
    """
    FaultCohesive.__init__(self, name)
    Integrator.__init__(self)
    self._loggingPrefix = "CoTr "

    self.availableFields = \
        {'vertex': \
           {'info': [],
            'data': []},
         'cell': \
           {'info': ["normal_dir"],
            'data': ["slip",
                     "traction"]},
}
    return
    def initialize(self, totalTime, numTimeSteps, normalizer):
        """
    Initialize cohesive elements.
    """
        logEvent = "%sinit" % self._loggingPrefix
        self._eventLogger.eventBegin(logEvent)

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

        if 0 == comm.rank:
            self._info.log("Initializing fault '%s'." % self.label())

        Integrator.initialize(self, totalTime, numTimeSteps, normalizer)
        FaultCohesive.initialize(self, totalTime, numTimeSteps, normalizer)

        self._eventLogger.eventEnd(logEvent)
        return
    def __init__(self, name="faultcohesivedyn"):
        """
    Initialize configuration.
    """
        FaultCohesive.__init__(self, name)
        Integrator.__init__(self)
        self._loggingPrefix = "CoDy "

        self.availableFields = \
            {'vertex': \
               {'info': ["normal_dir"],
                'data': ["slip",
                         "slip_rate",
                         "traction"]},
             'cell': \
               {'info': ["partition"],
                'data': []}}
        return
  def __init__(self, name="faultcohesiveimpulses"):
    """
    Initialize configuration.
    """
    FaultCohesive.__init__(self, name)
    Integrator.__init__(self)
    self._loggingPrefix = "CoIm "

    self.availableFields = \
        {'vertex': \
           {'info': ["normal_dir",
                     "impulse_amplitude",
                     "area",],
            'data': ["slip",
                     "traction_change"]},
         'cell': \
           {'info': ["partition"],
            'data': []}}
    return
Example #31
0
  def __init__(self, name="faultcohesiveimpulses"):
    """
    Initialize configuration.
    """
    FaultCohesive.__init__(self, name)
    Integrator.__init__(self)
    self._loggingPrefix = "CoIm "

    self.availableFields = \
        {'vertex': \
           {'info': ["normal_dir",
                     "impulse_amplitude",
                     "area",],
            'data': ["slip",
                     "traction_change"]},
         'cell': \
           {'info': ["partition"],
            'data': []}}
    return
Example #32
0
  def __init__(self, name="faultcohesivekin"):
    """
    Initialize configuration.
    """
    FaultCohesive.__init__(self, name)
    Integrator.__init__(self)
    self._loggingPrefix = "CoKi "

    self.availableFields = \
        {'vertex': \
           {'info': ["normal_dir",
                     "final_slip",
                     "slip_time"],
            'data': ["slip",
                     "traction_change"]},
         'cell': \
           {'info': ["partition"],
            'data': []}}
    return
Example #33
0
  def preinitialize(self, mesh):
    """
    Do pre-initialization setup.
    """
    from pylith.mpi.Communicator import mpi_comm_world
    comm = mpi_comm_world()

    if 0 == comm.rank:
      self._info.log("Pre-initializing fault '%s'." % self.label())
    FaultCohesive.preinitialize(self, mesh)
    Integrator.preinitialize(self, mesh)

    ModuleFaultCohesiveImpulses.quadrature(self, self.faultQuadrature)

    if mesh.dimension() == 2:
      self.availableFields['vertex']['info'] += ["strike_dir"]
    elif mesh.dimension() == 3:
      self.availableFields['vertex']['info'] += ["strike_dir",
                                                 "dip_dir"]
    return
  def preinitialize(self, mesh):
    """
    Do pre-initialization setup.
    """
    from pylith.mpi.Communicator import mpi_comm_world
    comm = mpi_comm_world()

    if 0 == comm.rank:
      self._info.log("Pre-initializing fault '%s'." % self.label())
    FaultCohesive.preinitialize(self, mesh)
    Integrator.preinitialize(self, mesh)

    ModuleFaultCohesiveImpulses.quadrature(self, self.faultQuadrature)

    if mesh.dimension() == 2:
      self.availableFields['vertex']['info'] += ["strike_dir"]
    elif mesh.dimension() == 3:
      self.availableFields['vertex']['info'] += ["strike_dir",
                                                 "dip_dir"]
    return
Example #35
0
 def _configure(self):
   """
   Setup members using inventory.
   """
   FaultCohesive._configure(self)
   return
Example #36
0
 def _configure(self):
   """
   Setup members using inventory.
   """
   FaultCohesive._configure(self)
   return