コード例 #1
0
ファイル: TestFaultY.py プロジェクト: geodynamics/pylith
class TestFaultY(TestTri3):
  """
  Test suite for testing sense of slip.
  """

  def setUp(self):
    """
    Setup for test.
    """
    TestTri3.setUp(self)
    run_pylith(FaultYApp, GenDBFaultY, nprocs=7)
    self.mesh['nvertices'] += 17
    self.outputRoot = "faulty"

    self.soln = SolnFaultY()
    return


  def calcStateVar(self, name, vertices, cells):
    """
    Calculate state variable.
    """
    ncells = self.mesh['ncells']
    pts = numpy.zeros( (ncells, 3), dtype=numpy.float64)
    if name == "total_strain":
      stateVar = self.soln.strain(pts)
    elif name == "stress":
      stateVar = self.soln.stress(pts)
    else:
      raise ValueError("Unknown state variable '%s'." % name)

    return stateVar
コード例 #2
0
class TestFaultY(TestTri3):
    """
  Test suite for testing sense of slip.
  """
    def setUp(self):
        """
    Setup for test.
    """
        TestTri3.setUp(self)
        run_pylith(FaultYApp, GenDBFaultY, nprocs=7)
        self.mesh['nvertices'] += 17
        self.outputRoot = "faulty"

        self.soln = SolnFaultY()
        return

    def calcStateVar(self, name, vertices, cells):
        """
    Calculate state variable.
    """
        ncells = self.mesh['ncells']
        pts = numpy.zeros((ncells, 3), dtype=numpy.float64)
        if name == "total_strain":
            stateVar = self.soln.strain(pts)
        elif name == "stress":
            stateVar = self.soln.stress(pts)
        else:
            raise ValueError("Unknown state variable '%s'." % name)

        return stateVar
コード例 #3
0
    def setUp(self):
        """
    Setup for test.
    """
        TestTri3.setUp(self)
        run_pylith(FaultYApp, GenDBFaultY, nprocs=7)
        self.mesh['nvertices'] += 17
        self.outputRoot = "faulty"

        self.soln = SolnFaultY()
        return
コード例 #4
0
ファイル: genspatialdb.py プロジェクト: xiaoxiz/pylith
 def __init__(self):
     """
 Constructor.
 """
     from solution import SolnFaultY
     self.soln = SolnFaultY()
     self.filename = "faulty_disp.spatialdb"
     return
コード例 #5
0
ファイル: TestFaultY.py プロジェクト: geodynamics/pylith
  def setUp(self):
    """
    Setup for test.
    """
    TestTri3.setUp(self)
    run_pylith(FaultYApp, GenDBFaultY, nprocs=7)
    self.mesh['nvertices'] += 17
    self.outputRoot = "faulty"

    self.soln = SolnFaultY()
    return
コード例 #6
0
ファイル: TestFaultY.py プロジェクト: rishabhdutta/pylith
  def setUp(self):
    """
    Setup for test.
    """
    TestTri3.setUp(self)
    run_pylith()
    self.mesh['nvertices'] += 17
    self.outputRoot = "faulty"

    self.soln = AnalyticalSoln()
    return