コード例 #1
0
ファイル: Formulation.py プロジェクト: youngsolar/pylith
  def _setupInterfaces(self, interfaceConditions):
    """
    Setup interfaces as integrators or constraints.
    """
    from pylith.feassemble.Integrator import implementsIntegrator
    from pylith.feassemble.Constraint import implementsConstraint

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

    if 0 == comm.rank:
      self._info.log("Pre-initializing interior interfaces.")
    for ic in interfaceConditions.components():
      ic.preinitialize(self.mesh())
      foundType = False
      if implementsIntegrator(ic):
        foundType = True
        self.integrators.append(ic)
        if 0 == comm.rank:
          self._info.log("Added interface condition '%s' as an integrator." % \
                           ic.label())
      if implementsConstraint(ic):
        foundType = True
        self.constraints.append(ic)
        if 0 == comm.rank:
          self._info.log("Added interface condition '%s' as a constraint." % \
                           ic.label())
      if not foundType:
        raise TypeError, \
              "Could not determine whether interface condition '%s' is an " \
              "integrator or a constraint." % ic.name
    self._debug.log(resourceUsageString())    
    return
コード例 #2
0
ファイル: Formulation.py プロジェクト: youngsolar/pylith
  def _setupBC(self, boundaryConditions):
    """
    Setup boundary conditions as integrators or constraints.
    """
    from pylith.feassemble.Integrator import implementsIntegrator
    from pylith.feassemble.Constraint import implementsConstraint
    from pylith.bc.PointForce import PointForce

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

    if 0 == comm.rank:
      self._info.log("Pre-initializing boundary conditions.")
    self._debug.log(resourceUsageString())
    for bc in boundaryConditions.components():
      bc.preinitialize(self.mesh())
      foundType = False
      if implementsIntegrator(bc):
        foundType = True
        self.integrators.append(bc)
        if 0 == comm.rank:
          self._info.log("Added boundary condition '%s' as an integrator." % \
                           bc.label())
      if implementsConstraint(bc):
        foundType = True
        self.constraints.append(bc)
        if 0 == comm.rank:
          self._info.log("Added boundary condition '%s' as a constraint." % \
                           bc.label())
      if not foundType:
        raise TypeError, \
              "Could not determine whether boundary condition '%s' is an " \
              "integrator or a constraint." % bc.name
    self._debug.log(resourceUsageString())    
    return
コード例 #3
0
ファイル: Formulation.py プロジェクト: youngsolar/pylith
  def _setupMaterials(self, materials):
    """
    Setup materials as integrators.
    """
    from pylith.feassemble.Integrator import implementsIntegrator
    
    from pylith.mpi.Communicator import mpi_comm_world
    comm = mpi_comm_world()

    if 0 == comm.rank:
      self._info.log("Pre-initializing materials.")
    self._debug.log(resourceUsageString())
    for material in materials.components():
      integrator = self.elasticityIntegrator()
      if not implementsIntegrator(integrator):
        raise TypeError, \
              "Could not use '%s' as an integrator for material '%s'. " \
              "Functionality missing." % (integrator.name, material.label())
      integrator.preinitialize(self.mesh(), material)
      self.integrators.append(integrator)
      self._debug.log(resourceUsageString())

      if 0 == comm.rank:
        self._info.log("Added elasticity integrator for material '%s'." % material.label())
    return
コード例 #4
0
ファイル: Formulation.py プロジェクト: xiaoxiz/pylith
  def _setupInterfaces(self, interfaceConditions):
    """
    Setup interfaces as integrators or constraints.
    """
    from pylith.feassemble.Integrator import implementsIntegrator
    from pylith.feassemble.Constraint import implementsConstraint

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

    if 0 == comm.rank:
      self._info.log("Pre-initializing interior interfaces.")
    for ic in interfaceConditions.components():
      ic.preinitialize(self.mesh())
      foundType = False
      if implementsIntegrator(ic):
        foundType = True
        self.integrators.append(ic)
        if 0 == comm.rank:
          self._info.log("Added interface condition '%s' as an integrator." % \
                           ic.label())
      if implementsConstraint(ic):
        foundType = True
        self.constraints.append(ic)
        if 0 == comm.rank:
          self._info.log("Added interface condition '%s' as a constraint." % \
                           ic.label())
      if not foundType:
        raise TypeError, \
              "Could not determine whether interface condition '%s' is an " \
              "integrator or a constraint." % ic.name
    self._debug.log(resourceUsageString())    
    return
コード例 #5
0
ファイル: Formulation.py プロジェクト: xiaoxiz/pylith
  def _setupBC(self, boundaryConditions):
    """
    Setup boundary conditions as integrators or constraints.
    """
    from pylith.feassemble.Integrator import implementsIntegrator
    from pylith.feassemble.Constraint import implementsConstraint
    from pylith.bc.PointForce import PointForce

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

    if 0 == comm.rank:
      self._info.log("Pre-initializing boundary conditions.")
    self._debug.log(resourceUsageString())
    for bc in boundaryConditions.components():
      bc.preinitialize(self.mesh())
      foundType = False
      if implementsIntegrator(bc):
        foundType = True
        self.integrators.append(bc)
        if 0 == comm.rank:
          self._info.log("Added boundary condition '%s' as an integrator." % \
                           bc.label())
      if implementsConstraint(bc):
        foundType = True
        self.constraints.append(bc)
        if 0 == comm.rank:
          self._info.log("Added boundary condition '%s' as a constraint." % \
                           bc.label())
      if not foundType:
        raise TypeError, \
              "Could not determine whether boundary condition '%s' is an " \
              "integrator or a constraint." % bc.name
    self._debug.log(resourceUsageString())    
    return
コード例 #6
0
ファイル: Formulation.py プロジェクト: xiaoxiz/pylith
  def _setupMaterials(self, materials):
    """
    Setup materials as integrators.
    """
    from pylith.feassemble.Integrator import implementsIntegrator
    
    from pylith.mpi.Communicator import mpi_comm_world
    comm = mpi_comm_world()

    if 0 == comm.rank:
      self._info.log("Pre-initializing materials.")
    self._debug.log(resourceUsageString())
    for material in materials.components():
      integrator = self.elasticityIntegrator()
      if not implementsIntegrator(integrator):
        raise TypeError, \
              "Could not use '%s' as an integrator for material '%s'. " \
              "Functionality missing." % (integrator.name, material.label())
      integrator.preinitialize(self.mesh(), material)
      self.integrators.append(integrator)
      self._debug.log(resourceUsageString())

      if 0 == comm.rank:
        self._info.log("Added elasticity integrator for material '%s'." % material.label())
    return
コード例 #7
0
 def test_implementsIntegrator(self):
   """
   Test to make sure ElasticityImplicitLgDeform satisfies integrator requirements.
   """
   integrator = ElasticityImplicitLgDeform()
   from pylith.feassemble.Integrator import implementsIntegrator
   self.failUnless(implementsIntegrator(integrator))
   return
コード例 #8
0
 def test_implementsIntegrator(self):
   """
   Test to make sure AbsorbingDampers satisfies integrator requirements.
   """
   bc = AbsorbingDampers()
   from pylith.feassemble.Integrator import implementsIntegrator
   self.failUnless(implementsIntegrator(bc))
   return
コード例 #9
0
 def test_implementsIntegrator(self):
   """
   Test to make sure FaultCohesiveDyn satisfies integrator requirements.
   """
   fault = FaultCohesiveDyn()
   from pylith.feassemble.Integrator import implementsIntegrator
   self.failUnless(implementsIntegrator(fault))
   return
コード例 #10
0
 def test_implementsIntegrator(self):
     """
 Test to make sure ElasticityImplicitLgDeform satisfies integrator requirements.
 """
     integrator = ElasticityImplicitLgDeform()
     from pylith.feassemble.Integrator import implementsIntegrator
     self.failUnless(implementsIntegrator(integrator))
     return
コード例 #11
0
 def test_implementsIntegrator(self):
   """
   Test to make sure FaultCohesiveImpulses satisfies integrator requirements.
   """
   fault = FaultCohesiveImpulses()
   from pylith.feassemble.Integrator import implementsIntegrator
   self.failUnless(implementsIntegrator(fault))
   return
コード例 #12
0
 def test_implementsIntegrator(self):
     """
 Test to make sure AbsorbingDampers satisfies integrator requirements.
 """
     bc = AbsorbingDampers()
     from pylith.feassemble.Integrator import implementsIntegrator
     self.failUnless(implementsIntegrator(bc))
     return
コード例 #13
0
ファイル: TestNeumann.py プロジェクト: rishabhdutta/pylith
 def test_implementsIntegrator(self):
   """
   Test to make sure Neumann satisfies constraint requirements.
   """
   bc = Neumann()
   from pylith.feassemble.Integrator import implementsIntegrator
   self.failUnless(implementsIntegrator(bc))
   return