Exemple #1
0
class TestFaultX(TestTri3):
    """
  Test suite for testing sense of slip.
  """
    def setUp(self):
        """
    Setup for test.
    """
        TestTri3.setUp(self)
        run_pylith(FaultXApp, GenDBFaultX, nprocs=5)
        self.mesh['nvertices'] += 17
        self.outputRoot = "faultx"

        self.soln = SolnFaultX()
        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
Exemple #2
0
class TestFaultX(TestTri3):
  """
  Test suite for testing sense of slip.
  """

  def setUp(self):
    """
    Setup for test.
    """
    TestTri3.setUp(self)
    run_pylith(FaultXApp, GenDBFaultX, nprocs=5)
    self.mesh['nvertices'] += 17
    self.outputRoot = "faultx"

    self.soln = SolnFaultX()
    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
Exemple #3
0
    def setUp(self):
        """
    Setup for test.
    """
        TestTri3.setUp(self)
        run_pylith(FaultXApp, GenDBFaultX, nprocs=5)
        self.mesh['nvertices'] += 17
        self.outputRoot = "faultx"

        self.soln = SolnFaultX()
        return
Exemple #4
0
 def __init__(self):
     """
 Constructor.
 """
     from solution import SolnFaultX
     self.soln = SolnFaultX()
     self.filename = "faultx_disp.spatialdb"
     return
Exemple #5
0
  def setUp(self):
    """
    Setup for test.
    """
    TestTri3.setUp(self)
    run_pylith(FaultXApp, GenDBFaultX, nprocs=5)
    self.mesh['nvertices'] += 17
    self.outputRoot = "faultx"

    self.soln = SolnFaultX()
    return
Exemple #6
0
  def setUp(self):
    """
    Setup for test.
    """
    TestTri3.setUp(self)
    run_pylith()
    self.mesh['nvertices'] += 17
    self.outputRoot = "faultx"

    self.soln = AnalyticalSoln()
    return