Skip to content

Commit b8854e8

Browse files
committed
Add stopping criterion support for imported surface integral
1 parent 3f9a115 commit b8854e8

File tree

2 files changed

+28
-3
lines changed

2 files changed

+28
-3
lines changed

flow360/component/simulation/translator/solver_translator.py

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1459,7 +1459,19 @@ def check_external_postprocessing_existence(params: SimulationParams):
14591459
for output in params.outputs:
14601460
if not isinstance(output, get_args(get_args(MonitorOutputType)[0])):
14611461
continue
1462-
if not isinstance(output, ForceOutput) and output.moving_statistic is None:
1462+
if (
1463+
isinstance(output, (ProbeOutput, SurfaceProbeOutput))
1464+
and output.moving_statistic is None
1465+
):
1466+
continue
1467+
if (
1468+
isinstance(output, SurfaceIntegralOutput)
1469+
and output.moving_statistic is None
1470+
and all(
1471+
not isinstance(surface, ImportedSurface)
1472+
for surface in output.entities.stored_entities
1473+
)
1474+
):
14631475
continue
14641476
return True
14651477
return False
@@ -1984,7 +1996,19 @@ def get_columnar_data_processor_json(
19841996
for output in input_params.outputs:
19851997
if not isinstance(output, get_args(get_args(MonitorOutputType)[0])):
19861998
continue
1987-
if not isinstance(output, ForceOutput) and output.moving_statistic is None:
1999+
if (
2000+
isinstance(output, (ProbeOutput, SurfaceProbeOutput))
2001+
and output.moving_statistic is None
2002+
):
2003+
continue
2004+
if (
2005+
isinstance(output, SurfaceIntegralOutput)
2006+
and output.moving_statistic is None
2007+
and all(
2008+
not isinstance(surface, ImportedSurface)
2009+
for surface in output.entities.stored_entities
2010+
)
2011+
):
19882012
continue
19892013
output_dict = output.model_dump(
19902014
exclude_none=True,

tests/simulation/translator/ref/Flow360_user_variable.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -369,6 +369,7 @@
369369
}
370370
},
371371
"runControl": {
372-
"externalProcessMonitorOutput": false
372+
"externalProcessMonitorOutput": true,
373+
"monitorProcessorHash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
373374
}
374375
}

0 commit comments

Comments
 (0)