示例#1
0
    def __str__(self):
        output = super(FrictionJob, self).__str__()
        output += "\n  Source model: %s" % self.source_path
        output += "\n  Friction Regions:"
        for (n,
             region) in enumerate(self.rundata.friction_data.friction_regions):
            output += "\n    Region %s: %s" % (n, region)
        return output


if __name__ == '__main__':
    path = os.path.join(os.getcwd(), 'new_quad.txt')
    if len(sys.argv) > 1:
        path = sys.argv[1]

    source_path = '$SRC/tohoku2011-paper1/sources/Ammon.txydz'
    # source_path = os.path.abspath(os.path.join(os.getcwd(),'saito.xyzt'))

    # Read in friction test values
    friction_values = numpy.loadtxt(path)

    # Create all jobs
    jobs = []
    for n in xrange(friction_values.shape[0]):
        jobs.append(FrictionJob(n, friction_values[n, :], source_path))

    controller = batch.BatchController(jobs)
    print controller
    controller.run()
示例#2
0

# Defintion of tests defined here
tests = []
tests.append(PlaneWaveTest())
tests.append(PlaneWaveTest(numpy.pi / 4.0, numpy.pi / 4.0))
tests.append(PlaneWaveTest(numpy.pi / 4.0, 0.0))
tests.append(PlaneWaveTest(0.0, numpy.pi / 4.0))
tests.append(PlaneWaveTest(numpy.pi / 8.0, 0.0))
tests.append(PlaneWaveTest(numpy.pi / 4.0, numpy.pi / 8.0))
for method in [1, 2, 3, 4]:
    tests.append(BubbleTest(eigen_method=method))

if __name__ == "__main__":

    if len(sys.argv) > 1:
        if sys.argv[1].lower() == 'all':
            tests_to_run = tests
        else:
            tests_to_run = []
            for test in sys.argv[1:]:
                tests_to_run.append(tests[int(test)])

        controller = batch.BatchController(tests_to_run)
        print controller
        controller.run()

    else:
        controller = batch.BatchController(tests)
        print controller
示例#3
0
def test_failed_job():
    job = TestJob(1)

    job_controller = batch.BatchController([job])

    job_controller.run()
示例#4
0
            7, 7, 0.0, 60e0, -99.463937141374046, -98.485815563597853,
            16.622495995962375, 17.490586994378546
        ])

    def __str__(self):
        output = super(FaultJob, self).__str__()
        if self.deformation_file == "okada.xyzt":
            output += "\n  Fault parameters: %s" % str(self.fault_params)
        else:
            output += "\n  Deformation File: %s" % self.deformation_file
        return output


if __name__ == '__main__':

    deformation_files = [
        "./bathy/rot_gapSzvT.xyzt", "./bathy/rot_gapSvr1zvT.xyzt",
        "./bathy/rot_gapSvr2zvT.xyzt", "./bathy/rot_west_gapSzvT.xyzt",
        "./bathy/rot_west_gapSvr1zvT.xyzt", "./bathy/rot_west_gapSvr2zvT.xyzt",
        "./bathy/okada_1957_du165.tt3", "./bathy/okada_1957_du200.tt3"
    ]

    tests = []
    for deformation_file in deformation_files:
        tests.append(FaultJob(deformation_file))

    controller = batch.BatchController(tests)
    print controller
    controller.tar = True
    controller.run()