Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Adding log parts #3019

Open
wants to merge 256 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 237 commits
Commits
Show all changes
256 commits
Select commit Hold shift + click to select a range
677fdb6
add log to wellGeneratorBase
arng40 Feb 13, 2024
623b6ad
uncrustify + missing doc
arng40 Feb 13, 2024
37dc5dd
first review with correction
arng40 Feb 14, 2024
8678fc0
constness modification, doc/test updated
arng40 Feb 15, 2024
9475286
const declaration updated
arng40 Feb 15, 2024
1320651
doc + minor restructuring
arng40 Feb 19, 2024
f78bd83
doc + method for row from vector
arng40 Feb 20, 2024
294f075
clean code + doc + add test for rows from vector
arng40 Feb 21, 2024
36dd7a4
doc updated
arng40 Feb 22, 2024
8f74cfa
Merge commit 'c11ad8ecd2d0d0aba5cd0661eb6e72951252409d' into feature/…
arng40 Feb 22, 2024
ebb9fc0
Revert "Merge commit 'c11ad8ecd2d0d0aba5cd0661eb6e72951252409d' into …
arng40 Feb 22, 2024
cb41359
revert last merge and Merge remote-tracking branch 'origin/develop' i…
arng40 Feb 22, 2024
22659ec
Merge remote-tracking branch 'origin/feature/dudes/table-layout' into…
arng40 Feb 22, 2024
ff37ac9
begin pvt tables logs - add write in log bool
arng40 Feb 22, 2024
628f56b
duplication log & csv fixed
arng40 Feb 22, 2024
e11a2bf
CI correction ( uncrustify, missing doc )
arng40 Feb 23, 2024
a8f9271
optionnal added to datatype
arng40 Feb 23, 2024
9ff17b9
update doxygen for ci
arng40 Feb 27, 2024
d90c8b5
more logs added
arng40 Feb 27, 2024
958d542
remove static_assert + constness
arng40 Feb 28, 2024
550ca26
Merge remote-tracking branch 'origin/develop' into feature/dudes/tabl…
arng40 Feb 28, 2024
e4fea40
first version Section
arng40 Feb 29, 2024
f67e3d9
remove unused code
arng40 Feb 29, 2024
14920ef
function min width added
arng40 Feb 29, 2024
57d2fb5
setup testSection(empty for the moment)
arng40 Feb 29, 2024
3c928da
test section finished
arng40 Mar 1, 2024
5b8689a
factorisation log pvt
arng40 Mar 4, 2024
0fa76e3
doxygen added
arng40 Mar 4, 2024
36981d7
doc correction
arng40 Mar 4, 2024
bb1ee01
remove test parent name with constitutive
arng40 Mar 4, 2024
aa2f789
remove unused code + add drawtostring method
arng40 Mar 5, 2024
8ff95c2
uncrustify
arng40 Mar 5, 2024
957c7d7
refacto Table first part
arng40 Mar 8, 2024
70d0a01
refortor still going up (missing doc and some minor refacto)
arng40 Mar 11, 2024
f5251f5
uncrustify + perfo example addded
arng40 Mar 11, 2024
1bec18e
update test + margin correction
arng40 Mar 11, 2024
1e45501
Merge remote-tracking branch 'origin/develop' into feature/dudes/tabl…
arng40 Mar 11, 2024
288f79e
Merge remote-tracking branch 'origin/feature/dudes/table-layout' into…
arng40 Mar 12, 2024
2054bd4
added Formatter function, correction on TableData
arng40 Mar 12, 2024
37e18b4
Delete table..cpp/hpp
arng40 Mar 12, 2024
5ff7c68
small correction
arng40 Mar 12, 2024
b360a16
doc updated
arng40 Mar 13, 2024
dd5f42f
TableData2D small refacto + opti
arng40 Mar 13, 2024
16b4ded
first update for log in table function
arng40 Mar 13, 2024
e8e89c2
Merge remote-tracking branch 'origin/feature/dudes/table-layout' into…
arng40 Mar 13, 2024
769beab
uncrustify + small correction
arng40 Mar 13, 2024
5fa478c
csv format / function correction
arng40 Mar 13, 2024
85494c7
remove dataToString with 2D table parameter
arng40 Mar 13, 2024
46e8d23
code opti
arng40 Mar 13, 2024
c1ba824
add 2D table test
arng40 Mar 13, 2024
14ea4f5
uncrustify
arng40 Mar 13, 2024
1271875
Alignment::middle by center and compile time verifcation added
arng40 Mar 14, 2024
d39fa00
PR review
arng40 Mar 14, 2024
c58be1e
2nd wave of pr review
arng40 Mar 14, 2024
1d4bdb4
update compile time verification for table value
arng40 Mar 15, 2024
0bff847
some update
arng40 Mar 15, 2024
8553441
pvt_log updated
arng40 Mar 15, 2024
7005d57
Merge remote-tracking branch 'origin/feature/dudes/table-layout' into…
arng40 Mar 15, 2024
22b16e9
update pvt log
arng40 Mar 15, 2024
429920c
add missing doc + uncrustify
arng40 Mar 15, 2024
965a972
constness update + refacto on text formatter
arng40 Mar 18, 2024
6e49ebc
PR correction
arng40 Mar 18, 2024
c1fb3dd
move has_formatter to format.hpp, doc correction
arng40 Mar 19, 2024
e0c6ca2
log level correction
arng40 Mar 19, 2024
7221c0f
perfo log correctly displayed
arng40 Mar 20, 2024
82098d8
remove ; to scope bracket
arng40 Mar 21, 2024
75ed072
doc correction format.hpp
arng40 Mar 21, 2024
3469920
format.hpp doc
arng40 Mar 21, 2024
052f1fa
last correction
arng40 Mar 21, 2024
fae723e
Merge remote-tracking branch 'origin/develop' into feature/dudes/tabl…
arng40 Mar 21, 2024
838f36e
cmake fix
arng40 Mar 25, 2024
1139117
test return string
arng40 Mar 25, 2024
13a6d09
fix hpp
arng40 Mar 25, 2024
cfeec17
fix error with string_view
arng40 Mar 25, 2024
f735cd1
uncrustify
arng40 Mar 25, 2024
755805a
Correction melvin PR
arng40 Mar 26, 2024
6264d87
correction review PR
arng40 Mar 27, 2024
21021c7
setMargin private
arng40 Mar 27, 2024
3a34e27
uncrustify
arng40 Mar 27, 2024
76789ba
remove constructor vector string
arng40 Mar 28, 2024
2d1cded
Table Data logs
arng40 Mar 28, 2024
8fedfd8
move table to common + pr correction
arng40 Mar 29, 2024
e5d2d3a
Merge remote-tracking branch 'origin/feature/dudes/table-layout' into…
arng40 Mar 29, 2024
13f975a
correction from merging
arng40 Mar 29, 2024
664045f
Merge remote-tracking branch 'origin/feature/dudes/table-layout' into…
arng40 Mar 29, 2024
f7dbdcf
minor correction
arng40 Mar 29, 2024
e5365a0
merging correction
arng40 Mar 29, 2024
4f34fc2
gracefully breaking your code :)
MelReyCG Apr 2, 2024
1cb2cc0
improving proposal + added TODOs
MelReyCG Apr 2, 2024
615a16d
Refactor conversion TableData2 => TableData1D
arng40 Apr 3, 2024
0100b33
Merge remote-tracking branch 'origin/feature/rey/transmissibilityOutp…
arng40 Apr 4, 2024
e66074e
Merge remote-tracking branch 'origin/develop' into pvt-logs-cp
arng40 Apr 4, 2024
7375665
refactor method to convert 2Dtable => 1D table
arng40 Apr 4, 2024
d590513
CI correction
arng40 Apr 4, 2024
7f6b79b
move table to fileIO
arng40 Apr 4, 2024
73f8374
update some doc
arng40 Apr 4, 2024
ae4968b
first part test 2D table crash
arng40 Apr 4, 2024
92a1644
add test/warning for table conversion 2D => 1D and warning for fillin…
arng40 Apr 5, 2024
e6b2e6d
ci correction
arng40 Apr 8, 2024
18db533
test ci correction for c++ < 17
arng40 Apr 9, 2024
31126e1
test ci table2D example 1
arng40 Apr 9, 2024
d481454
test ci Table2D test 1 & 2
arng40 Apr 9, 2024
6a7bfe8
test ci Table2D test 1 & 2 & 3
arng40 Apr 9, 2024
e01523b
add virtual destructor TableFormatter + minor variable refacto
arng40 Apr 10, 2024
978674e
bug correction + missing doc + test small refacto
arng40 Apr 10, 2024
da95c91
missig doc ...
arng40 Apr 10, 2024
79acc00
start management logError in table + todo refacto functions in TableF…
arng40 Apr 11, 2024
24f92d9
TableFormatter refacto + clean up
arng40 Apr 12, 2024
5a70c33
uncrustify
arng40 Apr 12, 2024
95f3a9d
small doc update
arng40 Apr 15, 2024
77351b9
some error management update
arng40 Apr 15, 2024
da67c05
renaming & simplifying
arng40 Apr 17, 2024
a9612bb
add case for fill all column in case of table 2D
arng40 Apr 17, 2024
0f1bbe2
Merge remote-tracking branch 'origin/develop' into feature/dudes/tabl…
arng40 Apr 17, 2024
89f859a
simplification
arng40 Apr 17, 2024
ef5085c
code optimization
arng40 Apr 18, 2024
294db78
remove useless std::move
arng40 Apr 18, 2024
9f23f62
refacto build separator + reviews
arng40 Apr 19, 2024
9809699
final review correction
arng40 Apr 19, 2024
66895d6
Merge remote-tracking branch 'origin/feature/dudes/table-layout' into…
arng40 Apr 22, 2024
46a6abe
method display layout added
arng40 Apr 22, 2024
9de9d63
small correction after merge
arng40 Apr 22, 2024
fe80c59
review correction #1
arng40 May 13, 2024
769d84d
units test section refacto
arng40 May 15, 2024
c1dc1d0
Merge branch 'feature/dudes/section-log' of https://github.com/GEOS-D…
arng40 May 15, 2024
abb994e
variables renamed
arng40 May 17, 2024
c851b38
uncrustify + doc
arng40 May 23, 2024
0ae0c74
doc
arng40 May 23, 2024
86c0130
Merge remote-tracking branch 'origin/develop' into feature/dudes/tabl…
arng40 May 23, 2024
e9639ea
remove unused code
arng40 May 24, 2024
d55db27
update syntax
arng40 May 27, 2024
a48feb3
Merge remote-tracking branch 'origin/feature/dudes/table-layout' into…
arng40 May 27, 2024
924d955
syntax correction
arng40 May 27, 2024
5b530f0
Merge branch 'pvt-logs-cp' of https://github.com/GEOS-DEV/GEOS into p…
arng40 May 27, 2024
ac0cec8
variable correction
arng40 May 27, 2024
d6415a7
doc + code clarification
arng40 May 30, 2024
eaa8919
more code simplification
arng40 May 31, 2024
138541b
remove addErrorMsg function
arng40 Jun 3, 2024
3f74746
merge
arng40 Jun 3, 2024
d360dcf
Merge branch 'develop' into feature/dudes/table-layout
arng40 Jun 3, 2024
7aaf7b6
Merge remote-tracking branch 'origin/feature/dudes/table-layout' into…
arng40 Jun 3, 2024
1f24247
uncrustify
arng40 Jun 3, 2024
709c037
Merge remote-tracking branch 'origin/develop' into feature/dudes/pvt-…
arng40 Jun 5, 2024
fb795ba
Merge branch 'feature/dudes/pvt-output' of https://github.com/GEOS-DE…
arng40 Jun 5, 2024
b1ec0d0
begin refacto in table function for more clarity
arng40 Jun 5, 2024
b62161a
continue refato
arng40 Jun 5, 2024
98764af
refacto continuing ( commit works )
arng40 Jun 7, 2024
8091945
missing doxygen
arng40 Jun 7, 2024
1c8d7a9
correction fun name
arng40 Jun 7, 2024
2c17324
missing doc
arng40 Jun 10, 2024
0dddcf5
uncrustify + doc
arng40 Jun 10, 2024
7ee093b
Doxygen check
arng40 Jun 10, 2024
86fe90b
review correction + add pvtOptions struct
arng40 Jun 14, 2024
28b68f0
missing test correction
arng40 Jun 14, 2024
7f1b8ab
pvtOpt struct renaming + fct move to FlashModel
arng40 Jun 14, 2024
3da5e82
xsd/rst generation
arng40 Jun 14, 2024
fd605f7
review pavel
arng40 Jun 17, 2024
5cbaeec
renaming
arng40 Jun 18, 2024
684a405
review update
arng40 Jun 19, 2024
ae86942
revert a modif
arng40 Jun 19, 2024
c69fbee
uncrustify
arng40 Jun 19, 2024
49b52f3
Merge remote-tracking branch 'origin/develop' into feature/dudes/pvt-…
arng40 Jun 19, 2024
fa3218c
melvin review
arng40 Jun 26, 2024
5c808f8
fix
arng40 Jun 26, 2024
b39a84a
Merge remote-tracking branch 'origin/develop' into feature/dudes/pvt-…
arng40 Jun 27, 2024
76ee4dd
Merge remote-tracking branch 'origin/develop' into feature/dudes/pvt-…
arng40 Jul 2, 2024
8127f1a
Merge remote-tracking branch 'origin/develop' into feature/dudes/sect…
arng40 Jul 3, 2024
57c23b2
pr pavel correction
arng40 Jul 4, 2024
4c4a3b8
Merge remote-tracking branch 'origin/develop' into feature/dudes/pvt-…
arng40 Jul 4, 2024
3b2fd4b
debug first merge
arng40 Jul 4, 2024
b7f74b5
Merge remote-tracking branch 'origin/feature/dudes/pvt-output' into f…
arng40 Jul 4, 2024
83c80b2
missing doxygen
arng40 Jul 4, 2024
5e8d0af
remove unused code
arng40 Jul 4, 2024
e1a7959
IN PROGRESS: first path for dynamic section
arng40 Jul 4, 2024
7cf52dd
2path of refacto
arng40 Jul 5, 2024
2bd3e7d
int => integer
arng40 Jul 5, 2024
d81d7c4
string_view => string
arng40 Jul 5, 2024
5da394c
add line return
arng40 Jul 5, 2024
834bf7a
uncrustify
arng40 Jul 5, 2024
4f5fa5b
update doxygen / improve code
arng40 Jul 8, 2024
547bf9e
review melvin
arng40 Jul 8, 2024
37482aa
doxygen + uncrustify
arng40 Jul 8, 2024
7e7492d
revert space applied
arng40 Jul 8, 2024
d6c3a8a
uncrustify
arng40 Jul 8, 2024
48e2b7d
uncrustify
arng40 Jul 8, 2024
4dc3935
small rweaks
arng40 Jul 8, 2024
3caa16c
melvin review
arng40 Jul 10, 2024
ae1f98f
doxygen
arng40 Jul 10, 2024
61c27de
melvin review #2
arng40 Jul 12, 2024
c0c1d6b
nb character lines fix
arng40 Jul 12, 2024
ace4ce9
Merge remote-tracking branch 'origin/develop' into feature/dudes/pvt-…
arng40 Jul 12, 2024
44d3e8e
Merge branch 'develop' into feature/dudes/pvt-output
MelReyCG Jul 23, 2024
3c0997a
fix print screen level condition
arng40 Jul 25, 2024
45847cd
Merge branch 'feature/dudes/pvt-output' of https://github.com/GEOS-DE…
arng40 Jul 25, 2024
7278d9c
Merge remote-tracking branch 'origin/develop' into feature/dudes/pvt-…
arng40 Jul 25, 2024
003de35
Merge remote-tracking branch 'origin/develop' into feature/dudes/pvt-…
arng40 Aug 21, 2024
53d4ea0
small fix
arng40 Aug 21, 2024
49c939c
small change in path indaction
arng40 Aug 22, 2024
6d2995e
Merge remote-tracking branch 'origin/develop' into feature/dudes/pvt-…
arng40 Aug 28, 2024
7a4822b
Merge remote-tracking branch 'origin/develop' into feature/dudes/pvt-…
arng40 Aug 29, 2024
ca6188e
fix after merge
arng40 Aug 29, 2024
b9f4677
Merge remote-tracking branch 'origin/develop' into feature/dudes/sect…
arng40 Aug 29, 2024
e6b63ca
move outputPvt to tableFunction
arng40 Sep 4, 2024
f45679f
uppercase correction
arng40 Sep 4, 2024
4ea8034
removing dead code
arng40 Sep 5, 2024
3f35dc7
remove unused code
arng40 Sep 5, 2024
231bad7
missing import
arng40 Sep 5, 2024
8879152
Merge remote-tracking branch 'origin/develop' into feature/dudes/pvt-…
arng40 Sep 5, 2024
c069c2c
Merge branch 'develop' into feature/dudes/pvt-output
MelReyCG Sep 9, 2024
d9bd822
Merge remote-tracking branch 'origin/develop' into feature/dudes/pvt-…
arng40 Sep 9, 2024
fb7db66
Merge remote-tracking branch 'origin/develop' into feature/dudes/pvt-…
arng40 Sep 24, 2024
57f3a45
xsd
arng40 Sep 24, 2024
312fbd9
Merge remote-tracking branch 'origin/develop' into feature/dudes/sect…
arng40 Sep 24, 2024
a3ca01a
Merge branch 'feature/dudes/pvt-output' into feature/dudes/section-log
arng40 Sep 24, 2024
88cb219
add additionnal tests
arng40 Oct 2, 2024
b8870d6
1st pass refacto
arng40 Oct 2, 2024
ad4bc9a
xsd + missing code
arng40 Oct 2, 2024
ed4c723
refacto section with adding description at the end of section
arng40 Oct 7, 2024
26806da
doxygen
arng40 Oct 7, 2024
cb6d214
doxygen and type
arng40 Oct 8, 2024
7a9b2b9
firstPass renaming
arng40 Oct 10, 2024
e34f174
2nd pass of renaming
arng40 Oct 17, 2024
7d3eab6
Merge remote-tracking branch 'origin/develop' into feature/dudes/sect…
arng40 Oct 17, 2024
aada6fc
renaming, const value, ...
arng40 Oct 17, 2024
a6acda4
test fix + doxygen
arng40 Oct 17, 2024
a60e764
uncrustify
arng40 Oct 17, 2024
364cf17
Merge branch 'develop' into feature/dudes/section-log
MelReyCG Oct 18, 2024
27761a4
xsd
arng40 Oct 23, 2024
20bb6bc
Merge branch 'feature/dudes/section-log' of https://github.com/GEOS-D…
arng40 Oct 23, 2024
2ec377e
refacto
arng40 Oct 23, 2024
8b29687
Merge branch 'develop' into feature/dudes/section-log
MelReyCG Oct 31, 2024
29e046e
renaming and simpl
arng40 Nov 6, 2024
6440331
uncrustify
arng40 Nov 6, 2024
447aaf2
revert
arng40 Nov 7, 2024
38815d9
rename
arng40 Nov 19, 2024
5d3d677
rename
arng40 Dec 9, 2024
aea7a98
Merge remote-tracking branch 'origin/develop' into feature/dudes/sect…
arng40 Dec 9, 2024
ca632ff
struture update
arng40 Dec 10, 2024
669c92e
Merge remote-tracking branch 'origin/develop' into feature/dudes/sect…
arng40 Jan 10, 2025
fb35659
Merge remote-tracking branch 'origin/develop' into feature/dudes/sect…
arng40 Jan 21, 2025
11f1578
constness
arng40 Jan 22, 2025
32413aa
update logPart
arng40 Jan 22, 2025
319da20
uncrustify :)
arng40 Jan 22, 2025
30f9086
clean up
arng40 Jan 22, 2025
23950f7
doxygen
arng40 Jan 22, 2025
877c64e
first attempt to relocate log end timestep
arng40 Jan 24, 2025
143322f
🎄
arng40 Jan 27, 2025
192f28b
automatic lr, 1st pass
arng40 Jan 27, 2025
9f2c013
new version lr working & clean
arng40 Jan 29, 2025
b0485e5
fix some case
arng40 Jan 30, 2025
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
1 change: 0 additions & 1 deletion src/coreComponents/codingUtilities/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ geos_decorate_link_dependencies( LIST decoratedDependencies
DEPENDENCIES ${dependencyList} )
# Add gtest C++ based tests
foreach( test ${testSources} )

get_filename_component( test_name ${test} NAME_WE )
blt_add_executable( NAME ${test_name}
SOURCES ${test}
Expand Down
8 changes: 4 additions & 4 deletions src/coreComponents/common/format/table/TableFormatter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ string TableTextFormatter::toString< TableData >( TableData const & tableData )
fillTableColumnsFromRows( columns, tableDataRows );

outputLayout( tableOutput, columns, msgTableError, sectionSeparatingLine );
outputSectionRows( columns, sectionSeparatingLine, tableOutput, nbValuesRows, TableLayout::Section::values );
outputSectionRows( columns, sectionSeparatingLine, tableOutput, nbValuesRows, TableLayout::LogPart::values );
tableOutput << '\n';

return tableOutput.str();
Expand All @@ -198,7 +198,7 @@ void TableTextFormatter::outputLayout( std::ostringstream & tableOutput,
outputTopRows( tableOutput, msgTableError, topSeparator, TableLayout::Alignment::left );
tableOutput << GEOS_FMT( "{}\n", sectionSeparatingLine );

outputSectionRows( columns, sectionSeparatingLine, tableOutput, nbHeaderRows, TableLayout::Section::header );
outputSectionRows( columns, sectionSeparatingLine, tableOutput, nbHeaderRows, TableLayout::LogPart::header );
}

void TableTextFormatter::splitAndSetColumnNames( std::vector< TableLayout::Column > & columns,
Expand Down Expand Up @@ -369,7 +369,7 @@ void TableTextFormatter::outputSectionRows( std::vector< TableLayout::Column > c
string_view sectionSeparatingLine,
std::ostringstream & tableOutput,
integer const nbRows,
TableLayout::Section const section ) const
TableLayout::LogPart const section ) const
{
integer const columnMargin = m_tableLayout.getColumnMargin();
integer const borderMargin = m_tableLayout.getBorderMargin();
Expand All @@ -381,7 +381,7 @@ void TableTextFormatter::outputSectionRows( std::vector< TableLayout::Column > c
for( std::size_t idxColumn = 0; idxColumn < columns.size(); ++idxColumn )
{
TableLayout::Column const currentColumn = columns[idxColumn];
auto const & columnContent = section == TableLayout::Section::header ?
auto const & columnContent = section == TableLayout::LogPart::header ?
columns[idxColumn].m_parameter.splitColumnNameLines :
columns[idxColumn].m_columnValues;
string cell = columnContent.at( idxRow );
Expand Down
2 changes: 1 addition & 1 deletion src/coreComponents/common/format/table/TableFormatter.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ class TableTextFormatter : public TableFormatter
string_view sectionSeparatingLine,
std::ostringstream & rows,
integer const nbRows,
TableLayout::Section const section ) const;
TableLayout::LogPart const section ) const;
};

/**
Expand Down
2 changes: 1 addition & 1 deletion src/coreComponents/common/format/table/TableLayout.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class TableLayout
/**
* @brief Enumeration for table sections.
*/
enum Section { header, values };
enum LogPart { header, values };
MelReyCG marked this conversation as resolved.
Show resolved Hide resolved

/**
* @brief Structure to set up each colum parameters.
Expand Down
1 change: 1 addition & 0 deletions src/coreComponents/dataRepository/Group.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,7 @@ void Group::initialize_postMeshGeneration()

void Group::initialize()
{

initializePreSubGroups();

array1d< string > initOrder;
Expand Down
32 changes: 16 additions & 16 deletions src/coreComponents/events/EventManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,9 @@ bool EventManager::run( DomainPartition & domain )
m_dt = dt_global;
#endif
}

outputTime();
LogPart logPart( "TIMESTEP START" );
MelReyCG marked this conversation as resolved.
Show resolved Hide resolved
outputTime( logPart );
logPart.begin();

// Execute
for(; m_currentSubEvent<this->numSubGroups(); ++m_currentSubEvent )
Expand Down Expand Up @@ -208,6 +209,7 @@ bool EventManager::run( DomainPartition & domain )
}
}

logPart.end();
// Increment time/cycle, reset the subevent counter
m_time += m_dt;
++m_cycle;
Expand All @@ -225,7 +227,7 @@ bool EventManager::run( DomainPartition & domain )
return false;
}

void EventManager::outputTime() const
void EventManager::outputTime( LogPart & logPart ) const
{
const bool isTimeLimited = m_maxTime < std::numeric_limits< real64 >::max();
const bool isCycleLimited = m_maxCycle < std::numeric_limits< integer >::max();
Expand All @@ -245,19 +247,17 @@ void EventManager::outputTime() const
m_maxCycle, ( 100.0 * m_cycle ) / m_maxCycle );
};

// The formating here is a work in progress.
GEOS_LOG_RANK_0( "\n------------------------- TIMESTEP START -------------------------" );
GEOS_LOG_RANK_0( GEOS_FMT( " - Time: {}{}",
timeInfo.toUnfoldedString(),
isTimeLimited ? timeCompletionUnfoldedString() : "" ) );
GEOS_LOG_RANK_0( GEOS_FMT( " ({}{})",
timeInfo.toSecondsString(),
isTimeLimited ? timeCompletionSecondsString() : "" ) );
GEOS_LOG_RANK_0( GEOS_FMT( " - Delta Time: {}", units::TimeFormatInfo::fromSeconds( m_dt ) ) );
GEOS_LOG_RANK_0( GEOS_FMT( " - Cycle: {}{}",
m_cycle,
isCycleLimited ? cycleCompletionString() : "" ) );
GEOS_LOG_RANK_0( "--------------------------------------------------------------------\n" );
string const timeCompletionUnfolded = isTimeLimited ? timeCompletionUnfoldedString() : "";
string const timeCompletionSecond = isTimeLimited ? timeCompletionSecondsString() : "";
string const cycleLimited = isCycleLimited ? cycleCompletionString() : "";

string const timeInfosUnfolded = timeInfo.toUnfoldedString() + timeCompletionUnfolded;
string const timeCompletionSeconds = timeInfo.toSecondsString() + timeCompletionSecond;

logPart.addDescription( "Time", timeInfosUnfolded, timeCompletionSeconds );
logPart.addDescription( "Delta Time", units::TimeFormatInfo::fromSeconds( m_dt ).toString() );
logPart.addDescription( "Cycle", m_cycle, cycleLimited );
logPart.setMinWidth( 70 );

// We are keeping the old outputs to keep compatibility with current log reading scripts.
if( m_timeOutputFormat==TimeOutputFormat::full )
Expand Down
3 changes: 2 additions & 1 deletion src/coreComponents/events/EventManager.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

#include "dataRepository/Group.hpp"
#include "EventBase.hpp"
#include "fileIO/logPart/LogPart.hpp"

namespace geos
{
Expand Down Expand Up @@ -134,7 +135,7 @@ class EventManager : public dataRepository::Group
* @brief ouput time information to the log
*
*/
void outputTime() const;
void outputTime( LogPart & section ) const;

/// Min time for a simulation
real64 m_minTime;
Expand Down
6 changes: 6 additions & 0 deletions src/coreComponents/fileIO/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ set( fileIO_headers
Outputs/OutputUtilities.hpp
Outputs/PythonOutput.hpp
Outputs/RestartOutput.hpp
logPart/LogPart.hpp
Outputs/TimeHistoryOutput.hpp
timeHistory/HDFFile.hpp
timeHistory/HistoryCollectionBase.hpp
Expand All @@ -22,6 +23,7 @@ set( fileIO_sources
Outputs/OutputUtilities.cpp
Outputs/PythonOutput.cpp
Outputs/RestartOutput.cpp
logPart/LogPart.cpp
Outputs/TimeHistoryOutput.cpp
timeHistory/HDFFile.cpp
timeHistory/HistoryCollectionBase.cpp
Expand Down Expand Up @@ -95,5 +97,9 @@ target_include_directories( fileIO PUBLIC ${CMAKE_SOURCE_DIR}/coreComponents )

install( TARGETS fileIO LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}/lib )

if( GEOS_ENABLE_TESTS )
add_subdirectory( logPart/unitTests )
endif( )



121 changes: 121 additions & 0 deletions src/coreComponents/fileIO/logPart/LogPart.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
/*
* ------------------------------------------------------------------------------------------------------------
* SPDX-License-Identifier: LGPL-2.1-only
*
* Copyright (c) 2018-2020 Lawrence Livermore National Security LLC
* Copyright (c) 2018-2020 The Board of Trustees of the Leland Stanford Junior University
* Copyright (c) 2018-2020 TotalEnergies
* Copyright (c) 2019- GEOSX Contributors
* All rights reserved
*
* See top level LICENSE, COPYRIGHT, CONTRIBUTORS, NOTICE, and ACKNOWLEDGEMENTS files for details.
* ------------------------------------------------------------------------------------------------------------
*/

/**
* @file LogPart.cpp
*/

#include "LogPart.hpp"
#include <algorithm>

namespace geos
{

LogPart::LogPart( string_view sectionTitle ):
m_sectionTitle( string( sectionTitle ) ),
m_sectionWidth( sectionTitle.length() )
{
m_footerTitle = GEOS_FMT( "End : {}", m_sectionTitle );
MelReyCG marked this conversation as resolved.
Show resolved Hide resolved
}

void LogPart::addDescription( string_view description )
{
m_descriptions.push_back( string( description ) );
}

void LogPart::addEndDescription( string_view description )
{
m_endLogMessages.push_back( string( description ) );
}

void LogPart::setMinWidth( integer const & minWidth )
{
m_rowMinWidth = minWidth;
}

void LogPart::formatAndInsertDescriptions( std::vector< string > & descriptionContainer,
string_view name,
std::vector< string > const & values )
{
string const nameFormatted = GEOS_FMT( "- {}: ", string( name ));
MelReyCG marked this conversation as resolved.
Show resolved Hide resolved
string const descriptionFormatted = GEOS_FMT( "{}{}", nameFormatted, values[0] );
integer const spacesFromBorder = m_marginBorder * 2 + m_nbBorderChar * 2;
integer const completeDescriptionLength = descriptionFormatted.length() + spacesFromBorder;
descriptionContainer.push_back( descriptionFormatted );

m_sectionWidth = std::max( completeDescriptionLength, m_sectionWidth );

for( size_t idxValue = 1; idxValue < values.size(); idxValue++ )
{
size_t const spaces = values[idxValue].length() + nameFormatted.length();
descriptionContainer.push_back( GEOS_FMT( "{:>{}}", values[idxValue], spaces ) );
}
}

string LogPart::buildDescriptionPart( std::vector< string > const & descriptions ) const
{
std::ostringstream oss;
for( auto const & description : descriptions )
{
integer const remainingLength = m_sectionWidth - m_nbBorderChar * 2 - m_marginBorder;
string const borderCharacters = GEOS_FMT( "{:#<{}}", "", m_nbBorderChar );
oss << borderCharacters;
oss << GEOS_FMT( "{:<{}}{:<{}}", " ", m_marginBorder, description, remainingLength );
oss << borderCharacters << '\n';
}
return oss.str();
}

string LogPart::buildTitlePart( string_view title ) const
{
std::ostringstream oss;
integer const titleRowLength = m_sectionWidth - m_nbBorderChar * 2;
string const borderCharacters = GEOS_FMT( "{:#<{}}", "", m_nbBorderChar );
oss << GEOS_FMT( "{}{:^{}}{}\n",
borderCharacters,
title,
titleRowLength,
borderCharacters );
return oss.str();
}

void LogPart::begin( std::ostream & os )
{
m_sectionWidth = std::max( m_sectionWidth, m_rowMinWidth );

string bottomPart;
if( !m_descriptions.empty())
{
bottomPart = buildDescriptionPart( m_descriptions );
}

m_horizontalBorder = GEOS_FMT( "{:#>{}}\n", "", m_sectionWidth );
string topPart = GEOS_FMT( "{}{}{}", m_horizontalBorder,
buildTitlePart( m_sectionTitle ),
m_horizontalBorder );
os << GEOS_FMT( "\n{}{}\n", topPart, bottomPart );
}

void LogPart::end( std::ostream & os ) const
{
string topPart;
if( !m_endLogMessages.empty() )
{
topPart = GEOS_FMT( "{}{}", buildDescriptionPart( m_endLogMessages ), m_horizontalBorder );
}
string bottomPart = GEOS_FMT( "{}{}", buildTitlePart( m_footerTitle ), m_horizontalBorder );
os << GEOS_FMT( "\n{}{}\n", topPart, bottomPart );
}

}
Loading
Loading