From 253680cd6462e73bd36a3b0f19ffc2321c57af9b Mon Sep 17 00:00:00 2001 From: Timofey Mukha Date: Thu, 4 Jun 2026 11:06:32 +0300 Subject: [PATCH 1/2] Add optional mesh file argument to extract_subdomain script --- pysemtools/cli/extract_subdomain.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/pysemtools/cli/extract_subdomain.py b/pysemtools/cli/extract_subdomain.py index 0ef4d3b..fd9ede2 100644 --- a/pysemtools/cli/extract_subdomain.py +++ b/pysemtools/cli/extract_subdomain.py @@ -32,6 +32,9 @@ def main(): parser.add_argument( "--input_file", type=str, required=True, help="Path to the field file" ) + parser.add_argument( + "--mesh_file", type=str, required=False, help="Path to the mesh file" + ) parser.add_argument( "--output_file", type=str, @@ -42,7 +45,7 @@ def main(): "--bounds", type=parse_bounds, required=True, - help="Comma-separated list of 6 floats", + help="Comma-separated list of 6 floats, use format --bounds=-1.0,2.0,-1,1,0,0.1", ) parser.add_argument( "--fields", @@ -61,7 +64,12 @@ def main(): fld = FieldRegistry(comm) # Read - pynekread(args.input_file, comm, data_dtype=np.single, msh=mesh, fld=fld) + if not args.mesh_file: + pynekread(args.input_file, comm, data_dtype=np.single, msh=mesh, fld=fld) + else: + pynekread(args.mesh_file, comm, data_dtype=np.single, msh=mesh) + pynekread(args.input_file, comm, data_dtype=np.single, fld=fld) + fields = args.fields if not fields: From d3e0a3c286ed1254fa474017bf231c424a4d63f5 Mon Sep 17 00:00:00 2001 From: Timofey Mukha Date: Thu, 4 Jun 2026 11:17:06 +0300 Subject: [PATCH 2/2] Merge develop --- pysemtools/cli/extract_subdomain.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pysemtools/cli/extract_subdomain.py b/pysemtools/cli/extract_subdomain.py index f282011..a0caeb2 100644 --- a/pysemtools/cli/extract_subdomain.py +++ b/pysemtools/cli/extract_subdomain.py @@ -42,7 +42,7 @@ def main(): -------- To use this script, run it with MPI using the following command: - >>> mpirun -n python pysemtools_extract_subdomain --input_file --output_file --bounds= [--fields=] + >>> mpirun -n python pysemtools_extract_subdomain --input_file --output_file --bounds= [--fields=] [--mesh_file=] Replacing the placeholders with actual values. Observe that you have to remove the angle brackets. '''