From d793f8481f478cc0238a839e90a82957954a45e0 Mon Sep 17 00:00:00 2001
From: hanchuan <whc.shmily@gmail.com>
Date: Fri, 21 Apr 2023 11:11:32 +0200
Subject: [PATCH] [example] Fix cmake file to prevent the plot in ctest causing
 time out

---
 examples/porenetwork_upscaling/CMakeLists.txt | 2 +-
 examples/porenetwork_upscaling/doc/main.md    | 3 ++-
 examples/porenetwork_upscaling/main.cc        | 3 ++-
 3 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/examples/porenetwork_upscaling/CMakeLists.txt b/examples/porenetwork_upscaling/CMakeLists.txt
index e3f482d500..1e56c81517 100644
--- a/examples/porenetwork_upscaling/CMakeLists.txt
+++ b/examples/porenetwork_upscaling/CMakeLists.txt
@@ -13,7 +13,7 @@ dumux_add_test(NAME example_pnm1p_upscaling
                                       ${CMAKE_CURRENT_BINARY_DIR}/X-dir-PermeabilityratioVsForchheimerNumber.dat
                                       ${CMAKE_SOURCE_DIR}/test/references/example_porenetwork_upscaling_noncreeping_flow_X-dir_InversePrmeabilityVsInertiaToViscousRatio.dat
                                       ${CMAKE_CURRENT_BINARY_DIR}/X-dir-InversePrmeabilityVsInertiaToViscousRatio.dat
-                              --command "${CMAKE_CURRENT_BINARY_DIR}/example_pnm1p_upscaling params.input -Problem.AssumeCreepingFlow false -Problem.Directions 0")
+                              --command "${CMAKE_CURRENT_BINARY_DIR}/example_pnm1p_upscaling params.input -Problem.AssumeCreepingFlow false -Problem.Directions 0 -Output.PlotConductivity false")
 
 dumux_add_test(NAME example_pnm1p_creeping_flow_upscaling
                TARGET example_pnm1p_upscaling
diff --git a/examples/porenetwork_upscaling/doc/main.md b/examples/porenetwork_upscaling/doc/main.md
index ae0fc98df7..644ed99c6d 100644
--- a/examples/porenetwork_upscaling/doc/main.md
+++ b/examples/porenetwork_upscaling/doc/main.md
@@ -234,7 +234,8 @@ and finally determine the the upscaled properties.
 
     // plot the results just for non-creeping flow
     // creeping flow would just result in a straight line (permeability is independent of the pressure gradient)
-    if (!isCreepingFlow)
+    bool plotConductivity = getParam<bool>("Output.PlotConductivity", true);
+    if (!isCreepingFlow && plotConductivity)
         upscalingHelper.plot();
 };
 
diff --git a/examples/porenetwork_upscaling/main.cc b/examples/porenetwork_upscaling/main.cc
index 59fd740da5..8700416a4e 100644
--- a/examples/porenetwork_upscaling/main.cc
+++ b/examples/porenetwork_upscaling/main.cc
@@ -197,7 +197,8 @@ void runExample()
 
     // plot the results just for non-creeping flow
     // creeping flow would just result in a straight line (permeability is independent of the pressure gradient)
-    if (!isCreepingFlow)
+    bool plotConductivity = getParam<bool>("Output.PlotConductivity", true);
+    if (!isCreepingFlow && plotConductivity)
         upscalingHelper.plot();
 };
 
-- 
GitLab