예제 #1
0
  def _runTest(self, filenameIn, filenameOut, filenameOutE, faultGroup=None):

    from spatialdata.geocoords.CSCart import CSCart
    cs = CSCart()
    cs._configure()

    from pylith.meshio.MeshIOAscii import MeshIOAscii
    io = MeshIOAscii()
    io.inventory.filename = filenameIn
    io.inventory.coordsys = cs
    io._configure()
    
    mesh = io.read(debug=False, interpolate=True)

    if not faultGroup is None:
      from pylith.faults.FaultCohesiveKin import FaultCohesiveKin
      fault = FaultCohesiveKin()
      fault.inventory.matId = 10
      fault.inventory.faultLabel = faultGroup
      fault._configure()

      nvertices = fault.numVerticesNoMesh(mesh)
      firstFaultVertex = 0
      firstLagrangeVertex = nvertices
      firstFaultCell      = 2*nvertices
      fault.adjustTopology(mesh, 
                           firstFaultVertex, 
                           firstLagrangeVertex,
                           firstFaultCell)

    from pylith.topology.RefineUniform import RefineUniform
    refiner = RefineUniform()
    meshRefined = refiner.refine(mesh)

    return
예제 #2
0
    def _runTest(self, filenameIn, filenameOut, filenameOutE, faultGroup=None):

        from spatialdata.geocoords.CSCart import CSCart
        cs = CSCart()
        cs._configure()

        from pylith.meshio.MeshIOAscii import MeshIOAscii
        io = MeshIOAscii()
        io.inventory.filename = filenameIn
        io.inventory.coordsys = cs
        io._configure()

        mesh = io.read(debug=False, interpolate=True)

        if not faultGroup is None:
            from pylith.faults.FaultCohesiveKin import FaultCohesiveKin
            fault = FaultCohesiveKin()
            fault.inventory.matId = 10
            fault.inventory.faultLabel = faultGroup
            fault._configure()

            nvertices = fault.numVerticesNoMesh(mesh)
            firstFaultVertex = 0
            firstLagrangeVertex = nvertices
            firstFaultCell = 2 * nvertices
            fault.adjustTopology(mesh, firstFaultVertex, firstLagrangeVertex,
                                 firstFaultCell)

        from pylith.topology.RefineUniform import RefineUniform
        refiner = RefineUniform()
        meshRefined = refiner.refine(mesh)

        return
예제 #3
0
  def test_adjustTopology(self):
    """
    Test adjustTopology().

    WARNING: This is not a rigorous test of adjustTopology() because we
    neither set the input fields or verify the results.
    """
    cs = CSCart()
    cs.inventory.spaceDim = 2
    cs._configure()
    
    from spatialdata.units.Nondimensional import Nondimensional
    normalizer = Nondimensional()
    normalizer._configure()

    from pylith.meshio.MeshIOAscii import MeshIOAscii
    importer = MeshIOAscii()
    importer.inventory.filename = "data/tri3.mesh"
    importer.inventory.coordsys = cs
    importer._configure()
    mesh = importer.read(debug=False, interpolate=False)

    fault = FaultCohesiveKin()
    fault.inventory.matId = 10
    fault.inventory.faultLabel = "fault"
    fault.inventory.faultEdge = "fault_edge"
    fault._configure()

    nvertices = fault.numVerticesNoMesh(mesh)
    firstFaultVertex = 0
    firstLagrangeVertex = nvertices
    firstFaultCell      = 2*nvertices
    fault.adjustTopology(mesh, firstFaultVertex, firstLagrangeVertex,
                         firstFaultCell)

    # We should really add something here to check to make sure things
    # actually initialized correctly    
    return
예제 #4
0
  def test_adjustTopology(self):
    """
    Test adjustTopology().

    WARNING: This is not a rigorous test of adjustTopology() because we
    neither set the input fields or verify the results.
    """
    cs = CSCart()
    cs.inventory.spaceDim = 2
    cs._configure()
    
    from spatialdata.units.Nondimensional import Nondimensional
    normalizer = Nondimensional()
    normalizer._configure()

    from pylith.meshio.MeshIOAscii import MeshIOAscii
    importer = MeshIOAscii()
    importer.inventory.filename = "data/tri3.mesh"
    importer.inventory.coordsys = cs
    importer._configure()
    mesh = importer.read(debug=False, interpolate=False)

    fault = FaultCohesiveKin()
    fault.inventory.matId = 10
    fault.inventory.faultLabel = "fault"
    fault.inventory.faultEdge = "fault_edge"
    fault._configure()

    nvertices = fault.numVerticesNoMesh(mesh)
    firstFaultVertex = 0
    firstLagrangeVertex = nvertices
    firstFaultCell      = 2*nvertices
    fault.adjustTopology(mesh, firstFaultVertex, firstLagrangeVertex,
                         firstFaultCell)

    # We should really add something here to check to make sure things
    # actually initialized correctly    
    return