コード例 #1
0
def test_failing_comparison(dir):
    assert (compare_vtk(dir + "vtu.vtu", dir + "vtu1.vtu") == 1)
    assert (compare_vtk(dir + "vtu_binary.vtu", dir + "vtu1_binary.vtu") == 1)
    assert (compare_vtk(dir + "vtu_binary.vtu", dir + "vtu1.vtu") == 1)
コード例 #2
0
def test_close_to_zero_difference(dir):
    assert (compare_vtk(dir + "vtu5.vtu", dir + "vtu6.vtu") == 1)
コード例 #3
0
def test_close_to_zero_difference_zerothreshold2(dir):
    assert (compare_vtk(dir + "vtu5.vtu",
                        dir + "vtu6.vtu",
                        zeroValueThreshold={"small": 1e-19}) == 0)
コード例 #4
0
def test_neglegible_difference(dir):
    assert (compare_vtk(dir + "vtu.vtu", dir + "vtu4.vtu") == 0)
コード例 #5
0
def test_different_grid_order_ug_alu(dir):
    assert (compare_vtk(dir + "vtuug.vtu", dir + "vtualu.vtu") == 0)
コード例 #6
0
def test_different_grid_order(dir):
    assert (compare_vtk(dir + "vtu.vtu", dir + "vtu3.vtu") == 0)
コード例 #7
0
def test_different_parameter_order(dir):
    assert (compare_vtk(dir + "vtu.vtu", dir + "vtu2.vtu") == 0)
    assert (compare_vtk(dir + "vtu_binary.vtu", dir + "vtu2.vtu") == 0)
コード例 #8
0
            sys.stdout.write(
                "The test wrapper vtkcompare assumes keys wrapper.vtkcompare.name \
                              and wrapper.vtkcompare.reference to be existent in the inifile"
            )

        # loop over all vtk comparisons
        for n, e, r in zip(names, exts, references):
            # if we have multiple vtks search in the subgroup prefixed with the vtk-name for options
            prefix = "" if len(names) == 1 else n + "."

            # check for specific options for this comparison
            relative = float(
                ini.get("wrapper.vtkcompare." + prefix + "relative", 1e-2))
            absolute = float(
                ini.get("wrapper.vtkcompare." + prefix + "absolute", 1.2e-7))
            zeroThreshold = ini.get(
                "wrapper.vtkcompare." + prefix + "zeroThreshold", {})

            ret = compare_vtk(vtk1=n + timestep + "." + e,
                              vtk2=args["source"] + "/" + r + "." + e,
                              absolute=absolute,
                              relative=relative,
                              zeroValueThreshold=zeroThreshold,
                              verbose=True)

            # early exit if one vtk comparison fails
            if ret is not 0:
                sys.exit(ret)

    sys.exit(ret)