Commit 650273dd authored by Lars Bilke's avatar Lars Bilke
Browse files

Merge branch 'snakemake-vtkdiff-followup' into 'master'

[T] Rule output to stdout in Snakemake.

See merge request ogs/ogs!3488
parents 9da7dc6b 92e636e6
......@@ -22,7 +22,7 @@ rule extract_boundary:
input:
rules.generate_square_mesh.output
output:
"square_{size}_{lx}x{ly}_{type}_boundary.vtu"
"{mesh_name_prefix}_{size}_{lx}x{ly}_{type}_boundary.vtu"
shell:
"ExtractBoundary -i {input} -o {output}"
......@@ -31,7 +31,7 @@ rule vtkdiff:
a = rules.extract_boundary.output,
b = f"{config['Data_SOURCE_DIR']}/{output_path}/{rules.extract_boundary.output}"
output:
"square_{size}_{lx}x{ly}_{type}_boundary_diff.out"
"{mesh_name_prefix}_{size}_{lx}x{ly}_{type}_boundary_diff.out"
params:
check_mesh = True,
fields = [
......
......@@ -29,7 +29,7 @@ rule vtkdiff_grid_geometry:
output:
f"{out_dir}/AREHS_test_diff_geometry.out"
shell:
"vtkdiff -m {input.out} {input.ref} > {output}"
"vtkdiff -m {input.out} {input.ref} 2>&1 | tee {output}"
rule add_fault_to_grid:
input:
......@@ -67,4 +67,4 @@ rule vtkdiff_grid_iso_geometry:
output:
f"{out_dir}/AREHS_test_iso_diff_geometry.out"
shell:
"vtkdiff -m {input.out} {input.ref} > {output}"
"vtkdiff -m {input.out} {input.ref} 2>&1 | tee {output}"
rule generate_square_mesh:
output:
"square_{size}_{lx}x{ly}_{type}.vtu"
"{mesh_name_prefix,\w+}_{size,\d+}_{lx,\d+}x{ly,\d+}_{type}.vtu"
shell:
"""
generateStructuredMesh -e {wildcards.type} \
......
......@@ -26,6 +26,6 @@ for field in snakemake.params.fields:
"""
vtkdiff {snakemake.input.a} {snakemake.input.b} \
-a {field_a} -b {field_b} \
--abs {abs_tol} --rel {rel_tol} >> {snakemake.output[0]}
--abs {abs_tol} --rel {rel_tol} 2>&1 | tee -a {snakemake.output[0]}
"""
)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment