Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
310 commits
Select commit Hold shift + click to select a range
343b830
Renaming ContextInfo in ErrorContext + minor correction on the format…
amandinehry Jun 12, 2025
e22e538
Minor modifications on the GEOS_THROW_IF_GT_MSG message
amandinehry Jun 12, 2025
8de9060
Using GEOS_LOG_RANK instead of GEOS_LOG
amandinehry Jun 12, 2025
6c762e7
Add an enumeration to secure the keys that can be entered for the map…
amandinehry Jun 12, 2025
d288490
Improved code comments
amandinehry Jun 13, 2025
99d9b5b
reverse the change from GEOS_LOG to GEOS_LOG_RANK +empty the object a…
amandinehry Jun 13, 2025
f929f97
minor changes syntax + remove isValidStackTrace() method and replace …
amandinehry Jun 13, 2025
709d8a4
Minor changes: string to string_view when it was possible + add an ad…
amandinehry Jun 16, 2025
051e85b
Remove try/catch in the createFile() and the flushCurrentErrorMsg() m…
amandinehry Jun 16, 2025
517782b
Renaming: flushCurrentErrorMsg() into flushErrorMsg()
amandinehry Jun 16, 2025
2e0e396
Change GEOS_LOG() to GEOS_LOG_RANK()
amandinehry Jun 18, 2025
a83a3a1
initialize the error message line by default
amandinehry Jun 19, 2025
9fe289a
Doxygen comments
amandinehry Jun 24, 2025
da7dc82
Comments added
amandinehry Jun 24, 2025
260133e
Sort contextual information by decreasing priority
amandinehry Jun 24, 2025
e0c876f
Simplification of the for loop which write context information
amandinehry Jun 24, 2025
e1a2128
Changes following comments received on my PR
amandinehry Jun 25, 2025
4811b6c
Unit test implemented
amandinehry Jun 25, 2025
4a8ea5b
evaluate MSG only one time in macros
amandinehry Jul 4, 2025
2b38577
Merge commit '7e85e747ec65cd498ba0e9e4730f79d2692ed0bd' into feature/…
MelReyCG Jul 8, 2025
127f38e
Merge branch 'feature/amandinehry/create-yaml-file-and-structure' of …
amandinehry Jul 21, 2025
e9508f5
Merge remote-tracking branch 'upstream/develop' into feature/amandine…
amandinehry Jul 21, 2025
7fc0ced
🔊 warn the deveveloppers that a yamlFile should not be written if not…
MelReyCG Jul 21, 2025
35f7686
🐛 ⏪ set the --errorsOutput mandatory because of bug + revert optionpa…
MelReyCG Jul 23, 2025
31842a5
✏️ typo
MelReyCG Jul 25, 2025
a1105e4
🎨 uncrustify
MelReyCG Aug 1, 2025
c118dd4
🎨 docs alignement
MelReyCG Aug 1, 2025
4215fad
🎨 format
MelReyCG Aug 1, 2025
507ac66
builder pattern for addContextInfo
MelReyCG Aug 1, 2025
7b4ec52
♻️ refactor of the test: keeping only necessary testing, separated te…
MelReyCG Aug 1, 2025
a01d8ac
🐛 bugfix for test, wrong global instance impacting
MelReyCG Aug 1, 2025
d4c465b
🎨 format
MelReyCG Aug 1, 2025
1e32d65
Merge remote-tracking branch 'origin/develop' into feature/amandinehr…
MelReyCG Aug 1, 2025
6d10e3a
⏪ restored "Rank N:" if error messages
MelReyCG Aug 1, 2025
e9cd64c
test
amandinehry Aug 7, 2025
c7031bf
Merge branch 'feature/amandinehry/create-yaml-file-and-structure' of …
amandinehry Aug 7, 2025
e07d0b7
uncomment the rmoveFile() function
amandinehry Aug 21, 2025
785636b
stack trace management
amandinehry Aug 21, 2025
dd3b844
Merge remote-tracking branch 'amandinehryFork/develop' into feature/a…
MelReyCG Aug 26, 2025
e0bad67
♻️ ✅ New GEOS_ERROR macros with context included + new unit macro uni…
MelReyCG Sep 15, 2025
ab40edc
✅ ♻️ Simplifying + testing macros (GEOS_ERROR_* and GEOS_ASSERT_*) + …
MelReyCG Sep 18, 2025
faa84fa
📝 adding macro docs
MelReyCG Sep 18, 2025
dd97f0e
✨ ✅ adding error cause in unit test
MelReyCG Sep 18, 2025
d708cac
♻️ reordered error & throw macro to group them
MelReyCG Sep 18, 2025
66ab5cb
♻️ ✅ uniformized warning macros
MelReyCG Sep 19, 2025
e6135b1
✅ 🐛 ⚡️ bugfix when callstack is empty + disable callstack for perfs
MelReyCG Sep 19, 2025
589fcfe
♻️ ✅ uniformized throw macros
MelReyCG Sep 19, 2025
6fc4b30
✅ removing _CTX macros from unit test
MelReyCG Sep 22, 2025
77f9fcb
🐛 use streamed cause string to support mpi pointers formatting (not s…
MelReyCG Sep 22, 2025
5747e7f
🐛 last mistake?
MelReyCG Sep 22, 2025
10eb969
♻️ removing all GEOS_*_CTX macros (as GEOS_ERROR, GEOS_WARNING, GEOS_…
MelReyCG Sep 22, 2025
2c5c5f5
🎨 UNCRUSTIFY
MelReyCG Sep 23, 2025
d1642e6
Merge remote-tracking branch 'origin/develop' into feature/amandinehr…
MelReyCG Sep 23, 2025
b3cbb99
Merge remote-tracking branch 'origin/develop' into feature/amandinehr…
MelReyCG Sep 23, 2025
5781a78
✨ allowing to re-throw with GEOS_THROW* macros
MelReyCG Sep 23, 2025
db75e45
📦 shema
MelReyCG Sep 23, 2025
e07ab72
♻️ removing unintended BASE::
MelReyCG Sep 23, 2025
cd67768
change validation for region statistics for by resvol constraint
tjb-ltk Sep 23, 2025
5ced2b7
rel mode compile fix
tjb-ltk Sep 23, 2025
b2cbc13
check if reference region defined
tjb-ltk Sep 23, 2025
754ed03
Merge remote-tracking branch 'origin/develop' into refactor/dudes/err…
arng40 Sep 24, 2025
83d0c0f
xsd
arng40 Sep 24, 2025
d5d8615
Merge remote-tracking branch 'origin/feature/amandinehry/create-yaml-…
arng40 Sep 24, 2025
1913059
🎨 uncrustify
MelReyCG Sep 25, 2025
6692dd2
🐛 fix stream reset
MelReyCG Sep 25, 2025
29f6fbe
⚰️ unused variable
MelReyCG Sep 25, 2025
d17972f
✨ removing last LVARRAY_* error logging macros
MelReyCG Sep 25, 2025
759e9bb
Merge remote-tracking branch 'origin/develop' into feature/amandinehr…
MelReyCG Sep 25, 2025
1b755b5
✨ removing last LVARRAY_* error logging macros
MelReyCG Sep 25, 2025
3786db4
✅ adapting test with error cause addition
MelReyCG Sep 25, 2025
efa89d8
🐛 GPU Macros Support
MelReyCG Sep 25, 2025
7915205
🎨 uncrustify
MelReyCG Sep 26, 2025
14eefee
Merge branch 'develop' into feature/amandinehry/create-yaml-file-and-…
MelReyCG Sep 26, 2025
c0f8148
Merge remote-tracking branch 'origin/fix/byer3/resvolconstraint_valid…
MelReyCG Sep 26, 2025
500bbfd
🐛 GPU forgotten instruction
MelReyCG Sep 26, 2025
fa8fa54
🐛 added pragmas to manual shadow global logger instance
MelReyCG Sep 26, 2025
a29510b
Merge branch 'feature/amandinehry/create-yaml-file-and-structure-2' o…
MelReyCG Sep 26, 2025
c501a0f
🐛 wrong conversion on GPU
MelReyCG Sep 29, 2025
a07810f
Merge branch 'develop' into feature/amandinehry/create-yaml-file-and-…
MelReyCG Sep 29, 2025
cbb5322
centralize error output
arng40 Sep 29, 2025
c743e15
remvove deplucated log
arng40 Sep 30, 2025
dc13b33
Merge remote-tracking branch 'origin/feature/amandinehry/create-yaml-…
arng40 Sep 30, 2025
355e765
remove rank from arg
arng40 Oct 7, 2025
276606c
Merge remote-tracking branch 'origin/develop' into refactor/dudes/err…
arng40 Nov 5, 2025
3253a0b
fix after merge
arng40 Nov 5, 2025
cf0afc5
doc & fix
arng40 Nov 5, 2025
efcc52d
fix test
arng40 Nov 7, 2025
79b9791
test error
arng40 Nov 12, 2025
d951a16
initialize m_time
arng40 Nov 12, 2025
29dec26
add main for testUnits
arng40 Nov 12, 2025
6be688c
missing std::cout
arng40 Nov 13, 2025
62fa7ec
Merge remote-tracking branch 'origin/develop' into refactor/dudes/err…
arng40 Nov 13, 2025
5f9c74c
Merge remote-tracking branch 'origin/develop' into refactor/dudes/err…
arng40 Nov 20, 2025
95f631e
uncrust
arng40 Nov 21, 2025
df926d5
remove unecessary var
arng40 Nov 21, 2025
07b649a
doxygen
arng40 Nov 21, 2025
2fee6bf
clean
arng40 Nov 21, 2025
93594af
output only once
arng40 Nov 24, 2025
e430ae8
add "__" prefix
arng40 Nov 24, 2025
d5408c9
doxygen
arng40 Nov 24, 2025
17a394a
remove var duplication
arng40 Nov 24, 2025
061f502
fix format
arng40 Nov 24, 2025
450c3b0
add line number
arng40 Nov 24, 2025
d0ff49d
add stream to errorlogger + rename macro in logger
arng40 Nov 25, 2025
628e49c
reove debug log
arng40 Nov 25, 2025
f09d45f
fix test & cleanup
arng40 Nov 25, 2025
ec1feab
remove unecassery dep
arng40 Nov 25, 2025
419ba18
Merge branch 'develop' into refactor/dudes/error-context
arng40 Nov 26, 2025
9d5db85
fix test
arng40 Nov 27, 2025
2c9d6ce
Merge branch 'refactor/dudes/error-context' of https://github.com/GEO…
arng40 Nov 27, 2025
8708f2d
add geos::exception + refacto flushErrorMsg
arng40 Nov 28, 2025
3842caa
update exception inGEOS_THROW to geos::Exception
arng40 Nov 28, 2025
ae0b73c
update what() method
arng40 Nov 28, 2025
96bab37
remove unecessary cond
arng40 Dec 1, 2025
f47e62e
renaming and remove try catch from main
arng40 Dec 1, 2025
9289b82
add GeosExceptions
arng40 Dec 1, 2025
694e64e
clean up
arng40 Dec 1, 2025
b083853
remove unecessary include + some doc
arng40 Dec 1, 2025
b13149d
Merge remote-tracking branch 'origin/develop' into refactor/dudes/err…
arng40 Dec 1, 2025
e1b45f4
missong doc for GeosException
arng40 Dec 1, 2025
7771fbe
🚧 wip 1
MelReyCG Dec 2, 2025
37d75e5
🚧wip 2
MelReyCG Dec 2, 2025
202b6fc
Merge remote-tracking branch 'origin/develop' into bugfix/rey/split-s…
MelReyCG Dec 2, 2025
239ff24
🚧 applying merge change to task component
MelReyCG Dec 2, 2025
976aab5
include error
arng40 Dec 4, 2025
42c53b9
doxygen
arng40 Dec 4, 2025
16c9e77
update doxy
arng40 Dec 4, 2025
30baf23
remove include, + some clean
arng40 Dec 5, 2025
0aeddcf
fix cuda compil
arng40 Dec 8, 2025
ae60c25
move writeToAscii to cpp
arng40 Dec 8, 2025
5a52a75
doxygen
arng40 Dec 8, 2025
9ff68f4
♻️ uncoupling regions and statistics data storage (WIP, data could be…
MelReyCG Dec 9, 2025
15369ed
🐛 map alloc bugfix
MelReyCG Dec 9, 2025
c48c52d
add log test
arng40 Dec 10, 2025
bbb72ff
fix log wrong formatting
arng40 Dec 10, 2025
855cf80
update log formatting & output
arng40 Dec 10, 2025
daec006
fix test
arng40 Dec 10, 2025
ab9895b
Uncrustify
arng40 Dec 10, 2025
60a1f3a
Merge branch 'develop' into refactor/dudes/error-context
arng40 Dec 10, 2025
4e74b00
Merge branch 'develop' into refactor/dudes/error-context
arng40 Dec 17, 2025
08973a3
reorder function + add constructor to ErrorContext
arng40 Dec 19, 2025
cee0059
uncrustify & doxygen
arng40 Dec 19, 2025
2a639a7
Merge branch 'develop' into refactor/dudes/error-context
arng40 Dec 19, 2025
a2b31d1
Merge branch 'develop' into refactor/dudes/error-context
arng40 Dec 22, 2025
d4db78b
improve writeToAscii
arng40 Dec 22, 2025
7df78ff
add context to std::exception
arng40 Dec 22, 2025
abc6d2a
fix encapsulation in ErrorLogger by adding BuilderPattern + improve c…
arng40 Dec 24, 2025
ec7ddc1
uncrustify
arng40 Dec 24, 2025
4a5b4fe
remove redundant lmsg in case of multiple rank
arng40 Dec 24, 2025
35d8707
missing const
arng40 Dec 24, 2025
38023c2
delete ErrorMsg method & remove unecessary method in Builder
arng40 Jan 5, 2026
f5affb5
🚧different data structures plan
MelReyCG Jan 5, 2026
c257445
🚧choosing the plan that seem like the best one
MelReyCG Jan 5, 2026
62fcf31
extract inerclass & refacto ErrorBuilder
arng40 Jan 7, 2026
856a6c7
♻️moved stat so each aggregator has its own data in the data reposito…
MelReyCG Jan 7, 2026
1495a68
rename ErrorMsg & adapt errorLogger function called in catch
arng40 Jan 7, 2026
1c4b603
♻️impact new aggregator on stats task + bugfixes on formatting & output
MelReyCG Jan 7, 2026
a4e69cd
modify yaml & renaming & fix
arng40 Jan 8, 2026
16057c1
remove debug log
arng40 Jan 8, 2026
3ed52be
update prepareWhat
arng40 Jan 9, 2026
e40167f
update builder
arng40 Jan 9, 2026
b529d7a
rename get method & sort errorContext
arng40 Jan 9, 2026
ec4703c
remove debug
arng40 Jan 9, 2026
fbed3ed
update format
arng40 Jan 9, 2026
69dfad7
🔊 better messages & naming
MelReyCG Jan 12, 2026
55c0eeb
♻️continue refactorings before solvers usages
MelReyCG Jan 12, 2026
ccfede6
📝 a bit of docs
MelReyCG Jan 12, 2026
f92b9f7
🚧 draft of application on well solvers
MelReyCG Jan 12, 2026
c295ff7
♻️element manager -> meshlevel in parameters
MelReyCG Jan 12, 2026
8fdf42c
✨ implement statistics aggregator call from wellcontrols
MelReyCG Jan 13, 2026
3102971
Merge remote-tracking branch 'origin/develop' into bugfix/rey/split-s…
MelReyCG Jan 13, 2026
ae978a2
🐛compil fixes
MelReyCG Jan 14, 2026
e8682c7
add signal test
arng40 Jan 14, 2026
cf1c00f
update initCurrentExcep + add GeosExcp msg + update test
arng40 Jan 14, 2026
4ce27d2
⚰️ pruning headers
MelReyCG Jan 15, 2026
3288270
🐛bugfix bad type detection
MelReyCG Jan 15, 2026
753d32b
🐛 flash pressure computing bugfix
MelReyCG Jan 15, 2026
aa9d539
add signal test + last remarks
arng40 Jan 15, 2026
6adbae1
Merge remote-tracking branch 'origin/develop' into refactor/dudes/err…
arng40 Jan 15, 2026
b351784
doxygen
arng40 Jan 15, 2026
588084d
uncristify
arng40 Jan 15, 2026
c2bc1aa
📦schemamehcs
MelReyCG Jan 15, 2026
535e87f
small refacto
arng40 Jan 15, 2026
ff2f3fa
alignment
arng40 Jan 15, 2026
359f256
fix review
arng40 Jan 15, 2026
a942101
relocation
arng40 Jan 15, 2026
b528427
fix signal test
arng40 Jan 15, 2026
5eb71ce
format
arng40 Jan 15, 2026
0a5af00
add mutex
arng40 Jan 16, 2026
1b7fab5
♻️centralize flowSolver access
MelReyCG Jan 19, 2026
ea56eb8
doxygen
arng40 Jan 19, 2026
da560e1
🎨 formating consistency
MelReyCG Jan 19, 2026
456e767
add yaml mutex
arng40 Jan 20, 2026
44a54d8
doxygen
arng40 Jan 20, 2026
6f444d6
thread_local put back + renaming
arng40 Jan 20, 2026
7015589
renaming
arng40 Jan 20, 2026
ffbfe25
🐛 better last-time validation (div/0 avoided?)
MelReyCG Jan 21, 2026
0394da8
🐛 accessing the right region data structure + added validations + bet…
MelReyCG Jan 21, 2026
d7c3ab0
💄better stats table (TODO justify titles left)
MelReyCG Jan 21, 2026
44e3c3e
🐛 initialized reference reservoir pressure stats at implicitStepSetup…
MelReyCG Jan 23, 2026
18abaed
🐛 attempt to manage stats dirtyness for recomputation for timestep cuts
MelReyCG Jan 23, 2026
c886b9e
Merge branch 'develop' into refactor/dudes/error-context
MelReyCG Jan 26, 2026
9022c87
Merge remote-tracking branch 'origin/refactor/dudes/error-context' in…
MelReyCG Jan 26, 2026
99849aa
🐛simple compil fix
MelReyCG Jan 26, 2026
dd11209
💄adding forgotten space line at end of message
MelReyCG Jan 26, 2026
365affa
Merge remote-tracking branch 'origin/refactor/dudes/error-context' in…
MelReyCG Jan 26, 2026
f3c4bc7
💄small layout proposal
MelReyCG Jan 26, 2026
6318a57
Merge remote-tracking branch 'origin/refactor/dudes/error-context' in…
MelReyCG Jan 26, 2026
1cda08b
Merge branch 'develop' into refactor/dudes/error-context
arng40 Jan 27, 2026
d8ef456
uncrustify
arng40 Jan 27, 2026
d6f00ac
Merge branch 'refactor/dudes/error-context' of https://github.com/GEO…
arng40 Jan 27, 2026
3a1983b
Merge branch 'develop' into refactor/dudes/error-context
arng40 Jan 28, 2026
59ad659
attempt clang bug
arng40 Jan 28, 2026
4298b30
uncr
arng40 Jan 28, 2026
a87eb1a
Merge branch 'develop' into refactor/dudes/error-context
arng40 Feb 2, 2026
fb86478
Merge branch 'develop' into refactor/dudes/error-context
arng40 Feb 3, 2026
e576151
update doxygen
arng40 Feb 4, 2026
22b4ae9
update some doxygen on errorhandling
arng40 Feb 4, 2026
ddffc5f
add FE_ALL_EXCEPT
arng40 Feb 5, 2026
56956c4
🔇 remove debug logs
MelReyCG Feb 5, 2026
d57dc3a
Merge remote-tracking branch 'origin/refactor/dudes/error-context' in…
MelReyCG Feb 5, 2026
ba56689
remove line break
arng40 Feb 5, 2026
a29a873
Merge remote-tracking branch 'origin/refactor/dudes/error-context' in…
MelReyCG Feb 5, 2026
7569391
🐛
MelReyCG Feb 6, 2026
152b215
🐛 solve warning bug
MelReyCG Feb 6, 2026
e801605
🔇 remove logs
MelReyCG Feb 6, 2026
e39c7e5
🔇 less logs when no ref region is set
MelReyCG Feb 11, 2026
90ec8e8
Merge remote-tracking branch 'origin/develop' into bugfix/rey/split-s…
MelReyCG Feb 11, 2026
9891041
Merge remote-tracking branch 'origin/develop' into bugfix/rey/split-s…
MelReyCG Feb 18, 2026
cd0bd92
⏪revert wrong file modif
MelReyCG Feb 18, 2026
30eebad
🚧wrongly removed the !useSurfaceCondition?
MelReyCG Feb 25, 2026
30c667c
♻️ renamed flashConditions -> refConditions
MelReyCG Feb 25, 2026
5c0fb3a
Abstracting statistics aggregator with CRTP
MelReyCG Feb 26, 2026
4961b0c
⚰️useless header
MelReyCG Feb 26, 2026
afabaf8
⚰️ useless usings
MelReyCG Feb 26, 2026
64bf05d
⚰️ old commented / useless code
MelReyCG Feb 26, 2026
7b36093
🚨 forgotten headers in cmakelists
MelReyCG Feb 27, 2026
419ec9d
⚰️useless includes
MelReyCG Feb 27, 2026
53a3971
🔊better error logging
MelReyCG Feb 27, 2026
6f6215d
reduce allocations
MelReyCG Feb 27, 2026
7005835
📝side note
MelReyCG Feb 27, 2026
4a26191
✨ generalizing aggregator call to singlephase cases
MelReyCG Feb 27, 2026
64b3798
🔊log the real view key
MelReyCG Feb 27, 2026
cedbac7
🐛fix single phase flow unit test
MelReyCG Mar 2, 2026
94e07ed
✅consolidated flow unit test by also testing total mass balance of co…
MelReyCG Mar 2, 2026
6a9fbb1
file docs
MelReyCG Mar 2, 2026
27f1e47
🎨clearer output : full discretization before each regions + adapted l…
MelReyCG Mar 2, 2026
071b65a
Merge branch 'develop' into bugfix/rey/split-statistics-components
MelReyCG Mar 2, 2026
db37bf0
⚰️ removal of uml schemas
MelReyCG Mar 3, 2026
7aea764
Merge remote-tracking branch 'origin/develop' into bugfix/rey/split-s…
MelReyCG Mar 3, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/coreComponents/common/format/table/TableFormatter.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,12 @@ class TableFormatter
TableErrorListing & getErrorsList() const
{ return *m_errors; }

/**
* @return The prepared table layout
*/
PreparedTableLayout const & getLayout() const
{ return m_tableLayout; }

protected:

/// Layout for a table
Expand Down
2 changes: 1 addition & 1 deletion src/coreComponents/common/format/table/TableTypes.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ class TableErrorListing
* @brief Append a vector of string to the errors vector.
* @param errors A vector of string to append
*/
void appendErrors( std::vector< string > & errors )
void appendErrors( std::vector< string > const & errors )
{ m_errorList.insert( m_errorList.end(), errors.begin(), errors.end() );}

/**
Expand Down
6 changes: 3 additions & 3 deletions src/coreComponents/dataRepository/DataContext.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ class DataContext
/**
* @return Get the target object name
*/
string getTargetName() const
string const & getTargetName() const
{ return m_targetName; }
/**
* @brief Insert contextual information in the provided stream.
Expand Down Expand Up @@ -179,13 +179,13 @@ class DataFileContext final : public DataContext
/**
* @return the type name in the source file (XML node tag name / attribute name).
*/
string getTypeName() const
string const & getTypeName() const
{ return m_typeName; }

/**
* @return the source file path where the target object has been declared.
*/
string getFilePath() const
string const & getFilePath() const
{ return m_filePath; }

/**
Expand Down
2 changes: 2 additions & 0 deletions src/coreComponents/physicsSolvers/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ set( physicsSolversBase_headers
PhysicsSolverBase.hpp
PhysicsSolverBaseKernels.hpp
SolverStatistics.hpp
StatisticsAggregatorBase.hpp
StatisticsAggregatorBaseHelpers.hpp
FieldStatisticsBase.hpp )
#
# Specify solver sources
Expand Down
32 changes: 17 additions & 15 deletions src/coreComponents/physicsSolvers/FieldStatisticsBase.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,7 @@ class FieldStatisticsBase : public TaskBase
m_outputDir( joinPath( OutputBase::getOutputDirectory(), name ) )
{

string const key = SOLVER::coupledSolverAttributePrefix() + "SolverName";
registerWrapper( key, &m_solverName ).
registerWrapper( getSolverWrapperKey(), &m_solverName ).
setRTTypeName( rtTypes::CustomTypes::groupNameRef ).
setInputFlag( dataRepository::InputFlags::REQUIRED ).
setDescription( "Name of the " + SOLVER::coupledSolverAttributePrefix() + " solver" );
Expand Down Expand Up @@ -80,6 +79,20 @@ class FieldStatisticsBase : public TaskBase

protected:

struct viewKeyStruct
{
static constexpr char const * writeCSVFlagString() { return "writeCSV"; }
};

/// Pointer to the physics solver
SOLVER * m_solver;

// Output directory
string const m_outputDir;

// Flag to enable writing CSV output
integer m_writeCSV;

void postInputInitialization() override
{
Group & problemManager = this->getGroupByPath( "/Problem" );
Expand All @@ -103,19 +116,8 @@ class FieldStatisticsBase : public TaskBase
}
}

struct viewKeyStruct
{
static constexpr char const * writeCSVFlagString() { return "writeCSV"; }
};

/// Pointer to the physics solver
SOLVER * m_solver;

// Output directory
string const m_outputDir;

// Flag to enable writing CSV output
integer m_writeCSV;
string getSolverWrapperKey() const
{ return SOLVER::coupledSolverAttributePrefix() + "SolverName"; }

private:

Expand Down
266 changes: 266 additions & 0 deletions src/coreComponents/physicsSolvers/StatisticsAggregatorBase.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,266 @@
/*
* ------------------------------------------------------------------------------------------------------------
* SPDX-License-Identifier: LGPL-2.1-only
*
* Copyright (c) 2016-2024 Lawrence Livermore National Security LLC
* Copyright (c) 2018-2024 TotalEnergies
* Copyright (c) 2018-2024 The Board of Trustees of the Leland Stanford Junior University
* Copyright (c) 2023-2024 Chevron
* Copyright (c) 2019- GEOS/GEOSX Contributors
* All rights reserved
*
* See top level LICENSE, COPYRIGHT, CONTRIBUTORS, NOTICE, and ACKNOWLEDGEMENTS files for details.
* ------------------------------------------------------------------------------------------------------------
*/

/**
* @file CompositionalMultiphaseStatisticsAggregator.hpp
*/

#ifndef SRC_CORECOMPONENTS_PHYSICSSOLVERS_STATISTICSAGGREGATOR_HPP_
#define SRC_CORECOMPONENTS_PHYSICSSOLVERS_STATISTICSAGGREGATOR_HPP_

#include "common/DataTypes.hpp"
#include "dataRepository/DataContext.hpp"
#include "dataRepository/Group.hpp"
#include "mesh/CellElementRegion.hpp"
#include "mesh/MeshBody.hpp"
#include "mesh/MeshLevel.hpp"

namespace geos
{

/**
* @brief Output data group to contain the result of a given stat aggregator on the dataRepository.
* Attributes are public since the class is a POD.
* @todo repair 1D HDF5 outputs to enable stats HDF5 outputs
*/
class RegionStatisticsBase : public dataRepository::Group
{
public:

/// Time of statistics computation
real64 m_time;

/**
* @brief Construct a new Region Statistics Base object
* @param targetName name of the data-repository object that is targeted by the statistics
* (mesh level / region / sub-region).
* @param parent the instance parent in data-repository
*/
RegionStatisticsBase( string const & targetName, dataRepository::Group * const parent );

/**
* @return the name of the data-repository object that is targeted by the statistics
* (mesh level / region / sub-region).
*/
string_view getTargetName() const
{ return getName(); }

};

template< typename T >
struct StatsAggregatorTraits;

/**
* @brief Reponsible of computing physical statistics over the grid, registering the result in the
* data repository, but not storing / outputing it by itself. It does not have mutable state
* except the encountered issues.
* @todo repair 1D HDF5 outputs to enable stats HDF5 outputs
* @tparam Impl the derived type of the statistics aggregator which contains all necessary implementations (CRTP)
*/
template< typename Impl >
class StatsAggregatorBase
{
public:

using SolverType = typename StatsAggregatorTraits< Impl >::SolverType;

using StatsGroupType = typename StatsAggregatorTraits< Impl >::StatsGroupType;

/**
* @brief Standard function signature for any functor that applies on statistics group instances (StatsGroupType)
* - param 0: OwnerType &, the group instance containing the data for which we want to aggregate the statistics (MeshLevel,
* CellElementRegion...)
* - param 1: StatsAggregateGroupType &, the statistics aggregate Group where to store the data
* @tparam OwnerType the concrete type of the OwnerType param
*/
template< typename OwnerType >
using RegionStatsFunc = std::function< void ( OwnerType &,
StatsGroupType & ) >;

/**
* @brief TODO Document
*/
using RegionStatsRegisterFunc = std::function< StatsGroupType & ( dataRepository::Group &,
string const & ) >;

/**
* @brief the associated view keys
*/
struct ViewKeys
{
/// String for the discretization statistics group
constexpr static char const * statisticsString() { return "statistics"; }
/// String for the region statistics group
constexpr static char const * regionsStatisticsString() { return "regionsStatistics"; }
};

/**
* @brief Construct a new Stats Aggregator object
* @param ownerName the unique name of the entity requesting the statistics.
* An error is thrown if not unique in this context.
*/
StatsAggregatorBase( dataRepository::DataContext const & ownerDataContext );

/**
* @brief Enable the computation of any statistics, initialize data structure to collect them.
* Register the resulting data wrappers so they will be targeted by TimeHistory output
* @param solver flow solver object to retrieve:
- the simulated regions,
- fields for statistics computation.
* @param meshBodies The Group containing the MeshBody objects
*/
void initStatisticsAggregation( dataRepository::Group & meshBodies,
SolverType & solver );

/**
* @brief Enable the computation of region statistics, initialize data structure to collect them.
* Register the resulting data wrappers so they will be targeted by TimeHistory output
* @note Must be called in or after the "registerDataOnMesh" initialization phase
* @param registerStatsFunc The functor which register each statistics group whithin the regions hierarchy
*/
void enableRegionStatisticsAggregation( RegionStatsRegisterFunc && registerStatsFunc );

void forRegionStatistics( RegionStatsFunc< MeshLevel > const & functor ) const;

void forRegionStatistics( MeshLevel & mesh,
StatsGroupType & meshRegionsStatistics,
RegionStatsFunc< CellElementRegion > const & functor ) const;

void forRegionStatistics( CellElementRegion & region,
StatsGroupType & regionStatistics,
RegionStatsFunc< CellElementSubRegion > const & functor ) const;

/**
* @param[in] timeRequest The time for which we want to know if the statistics are computed.
* @param[in] stats the statistics data structure we want to know if it has been computed
* @return true if the statistics have been computed.
*/
bool isComputed( real64 const timeRequest, StatsGroupType const & stats );

/**
* @brief set the statistics as dirty, ensuring isComputed() will be false until the next computation.
*/
void setDirty();

/**
* @brief Compute statistics on the mesh discretizations (average field pressure, etc)
* Results are reduced on rank 0, and broadcasted over all ranks.
* @param[in] timeRequest The time for which we want to compute the statistics.
* @return false if there was a problem that prevented the statistics to be computed correctly.
*/
bool computeRegionsStatistics( real64 const timeRequest );

/**
* @return the name of the entity that needs the statistics.
*/
string const & getOwnerName() const
{ return m_ownerDataContext.getTargetName(); }

/**
* @return the instance of the solver, providing the discretisation method for collecting the values for the statistics
*/
SolverType const * getSolver() const
{ return m_solver; }

/**
* @return The encountered issues during the last computing method call.
*/
stdVector< string > const & getWarnings() const
{ return m_warnings; }

dataRepository::Group & getInstanceStatisticsGroup( MeshLevel & mesh ) const;

StatsGroupType & getMeshRegionsStatistics( MeshLevel & mesh ) const;

/**
* @brief TODO
* @throw InputError if no statistics data is found for the given region name.
* @param mesh TODO
* @param regionNname TODO
* @return TODO
*/
StatsGroupType & getRegionStatistics( MeshLevel & mesh, string_view regionName ) const;

protected:

struct StatsState
{
bool m_isEnabled = false;
bool m_isDirty = false;
};

/// @see getOwnerName()
dataRepository::DataContext const & m_ownerDataContext;

/// The
SolverType * m_solver = nullptr;

dataRepository::Group * m_meshBodies = nullptr;

/// @see getWarnings()
stdVector< string > m_warnings;

/// The current state of the region statistics
StatsState m_regionStatsState;

/**
* @brief Initialize all statistics values to aggregable default values,
* before any computation / reduction for the current timestep.
* @param stats the statistics instance
* @param time start time of the current timestep (s)
* @note Must be implemented for each type that implements this template (CRTP).
*/
void initStats( StatsGroupType & stats, real64 time ) const
{ static_cast< Impl const * >(this)->initStats( stats, time ); }

/**
* @brief Compute the rank-local stats for the given sub-region and store the results in the given stats group.
* @param subRegion
* @param subRegionStats the stats group instance for the subregion
* @note Must be implemented for each type that implements this template (CRTP).
*/
void computeSubRegionRankStats( CellElementSubRegion & subRegion, StatsGroupType & subRegionStats ) const
{ static_cast< Impl const * >(this)->computeSubRegionRankStats( subRegion, subRegionStats ); }

/**
* @brief Aggregate all instance statistics with those of another instance on the current rank.
* @param stats the statistics instance
* @param other the other instance to aggregate with.
* @note Must be implemented for each type that implements this template (CRTP).
*/
void aggregateStats( StatsGroupType & stats, StatsGroupType const & other ) const
{ static_cast< Impl const * >(this)->aggregateStats( stats, other ); }

/**
* @brief Aggregate all instance statistics with those of other ranks.
* @param stats the statistics instance
* @note Must be implemented for each type that implements this template (CRTP).
*/
void mpiAggregateStats( StatsGroupType & stats ) const
{ static_cast< Impl const * >(this)->mpiAggregateStats( stats ); }

/**
* @brief Do the final computations for the statistics. Must be called after computations & aggregations.
* @param stats the statistics instance
* @note Must be implemented for each type that implements this template (CRTP).
*/
void postAggregateStats( StatsGroupType & stats )
{ static_cast< Impl * >(this)->postAggregateStats( stats ); }

};

} /* namespace geos */

#endif /* SRC_CORECOMPONENTS_PHYSICSSOLVERS_STATISTICSAGGREGATOR_HPP_ */
Loading
Loading