GEOS-DEV / GEOS

GEOS Simulation Framework
GNU Lesser General Public License v2.1
203 stars 80 forks source link

Fix #3146 - Error in stat reduction for Function triggered `PeriodicEvent` #3147

Closed jafranc closed 1 week ago

jafranc commented 1 month ago

Fix #3146 - Error in stat reduction for Function triggered PeriodicEvent

Using such a XML block as

    <PeriodicEvent
      name="ConditionalDump"
            logLevel="2"
      maxEventDt="0.1"
            function="sg"
            threshold="0.1"
            object="/Problem/.../mesh/.../c2"
            stat="0"
            target="/Outputs/vtkOutput"/>

Attempting to use function attribute of Periodic event and its related attribute stat to trigger periodic event if min (0 is for min, 1 is for average, 2 is for max) of the function is above threshold was not working properly:

indeed,

Moreover, for partitions not intersecting (N=0 in FunctionBase.cpp) with object the workflow was returning 1e10 for min and -1e10 for max in parallel reductions.

paveltomin commented 1 month ago

@jafranc can you explain a little bit what was the issue and how you got it fixed?

jafranc commented 1 month ago

@jafranc can you explain a little bit what was the issue and how you got it fixed?

I updated the description above. I am reporting Oleg experience and fix there.

codecov[bot] commented 1 month ago

Codecov Report

Attention: Patch coverage is 0% with 14 lines in your changes missing coverage. Please review.

Project coverage is 55.88%. Comparing base (399ec9d) to head (1d488d8).

Files Patch % Lines
src/coreComponents/events/PeriodicEvent.cpp 0.00% 13 Missing :warning:
src/coreComponents/functions/FunctionBase.cpp 0.00% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## develop #3147 +/- ## =========================================== - Coverage 55.89% 55.88% -0.01% =========================================== Files 1037 1037 Lines 88148 88159 +11 =========================================== - Hits 49271 49269 -2 - Misses 38877 38890 +13 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.