Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
84 commits
Select commit Hold shift + click to select a range
76f4644
💩 first attempt at outputing wrong cells in multiphase cases... work …
MelReyCG May 7, 2025
8d158fc
✨ added the IdReporter classes to facilitate outputing ids & their co…
MelReyCG May 16, 2025
1434bd3
♻️ removing unnecessary template
MelReyCG May 16, 2025
cb0ae03
♻️ proper cpp/hpp file repartition
MelReyCG May 16, 2025
96cd0a8
✨ activation de l'output des valeurs problématique en f° d'un nouveau…
MelReyCG May 16, 2025
5cf6814
💄 slight msg change / fix
MelReyCG May 19, 2025
4ebe330
💄 slight msg change / fix 2
MelReyCG May 19, 2025
14a546f
💄 adding msg precisions
MelReyCG May 19, 2025
18703e3
♻️ refactors to prevent computing mpi reduction twice + constness + n…
MelReyCG May 20, 2025
056ac9c
✨ implementation of neg pressure ids output on other models
MelReyCG May 20, 2025
6766e7e
Merge remote-tracking branch 'origin/develop' into feature/rey/negati…
MelReyCG May 20, 2025
3f97e2b
🐛 fix for a CUDA target: explicit constructor call
MelReyCG May 20, 2025
e0b104d
💄 msg slight rewriting
MelReyCG May 20, 2025
d29db45
🐛 adding one more barrier to not get the msg cut by other msgs.
MelReyCG May 20, 2025
0803a92
🐛 CUDA crash fix + bug fix (data not moved from device)
MelReyCG May 22, 2025
de506c6
✨ adding table formatting to allow for showing more data
MelReyCG May 23, 2025
47f5c5c
✨ adding table indentation
MelReyCG May 23, 2025
5fc7ea6
✨ adding support for no column titled table layout
MelReyCG May 23, 2025
3eb2293
♻️ removing double assessor + exposing non-const version
MelReyCG May 26, 2025
58d1dce
♻️ refactoring TableFormatter: give control to inheriting classes
MelReyCG May 26, 2025
5744a2a
Merge remote-tracking branch 'origin/develop' into feature/rey/negati…
MelReyCG May 26, 2025
8f68eb5
♻️ refactoring TableFormatter: give control to inheriting classes
MelReyCG May 26, 2025
3fd0c12
♻️ 🐛 simplifying & fixing visible columns counting
MelReyCG May 26, 2025
e7f73cf
✨ offering control on alignement when using columns-free table layouts
MelReyCG May 26, 2025
da89daf
💄 new table format
MelReyCG May 27, 2025
00d8c57
⚰️ dead code
MelReyCG May 28, 2025
4a9f780
✨extending reported data to pressure/density (IdReporter -> ElementRe…
MelReyCG May 28, 2025
66f2d72
✨ adding info to warn the user to increase a logLevel to get the report
MelReyCG May 28, 2025
854dc3e
♻️ minor refactor of TableFormatter.cpp
MelReyCG May 28, 2025
6487d6c
✨ 🧪 first attempt at creating MPI tables
MelReyCG Jun 2, 2025
6a43cb9
✨ finishing MPI tables with a different approach (log output on rank0…
MelReyCG Jun 3, 2025
5ab8421
✨ adding ranks separator titles
MelReyCG Jun 4, 2025
9b6cd4d
Merge remote-tracking branch 'origin/develop' into feature/rey/negati…
MelReyCG Jun 4, 2025
390e451
♻️ Adding missing signatures
MelReyCG Jun 6, 2025
72e8ecd
💄 transposing table layout for clarity (user review)
MelReyCG Jun 6, 2025
0475436
⚰️ unused variables
MelReyCG Jul 1, 2025
b086a4f
🐛 fixing scarce crash when mpi-tables are constructed from more than …
MelReyCG Jul 1, 2025
112be17
📝 updating documentation
MelReyCG Jul 1, 2025
e5ae68e
✅ adding mpi tables unit test
MelReyCG Jul 1, 2025
411636d
📝 Adding las docs
MelReyCG Jul 2, 2025
8eb526b
🎨 uncrustify
MelReyCG Jul 2, 2025
de75861
Merge branch 'develop' into feature/rey/negative-pressure-cells
MelReyCG Jul 2, 2025
5af2601
📝 missing last docs
MelReyCG Jul 2, 2025
61c4199
📝 doc fix
MelReyCG Jul 4, 2025
ef29d77
ranksStrsDisps -> ranksStrsOffsets
MelReyCG Jul 4, 2025
89fe094
Merge remote-tracking branch 'origin/develop' into feature/rey/negati…
MelReyCG Jul 8, 2025
8d50b4c
♻️ set constant params const
MelReyCG Jul 16, 2025
63fe7e7
Merge branch 'develop' into feature/rey/negative-pressure-cells
MelReyCG Jul 16, 2025
92e9abb
🧪 adding a (failing) test to highlight a bug
MelReyCG Jul 16, 2025
4b46f19
🐛 solve a bug where the last line of the table was cut
MelReyCG Jul 16, 2025
aeb8ea0
📦 schema
MelReyCG Jul 16, 2025
937c446
⚰️ removed dead code
MelReyCG Jul 17, 2025
409f461
📝 documentation updates
MelReyCG Jul 18, 2025
2e4193c
📝 previous commit fix
MelReyCG Jul 18, 2025
7a83961
📝 added an idea
MelReyCG Jul 18, 2025
96ffe23
Merge remote-tracking branch 'origin/develop' into feature/rey/negati…
MelReyCG Jul 21, 2025
8bf3470
🐛 compil fix
MelReyCG Jul 21, 2025
a32f7d7
Merge branch 'develop' into feature/rey/negative-pressure-cells
paveltomin Aug 6, 2025
de56d0d
code style
Aug 6, 2025
f18cb8e
Merge branch 'develop' into feature/rey/negative-pressure-cells
paveltomin Aug 7, 2025
7812f75
Merge branch 'develop' into feature/rey/negative-pressure-cells
MelReyCG Aug 26, 2025
e443151
♻️ renamings (after Pavel review)
MelReyCG Aug 26, 2025
2a45e98
Merge remote-tracking branch 'origin/develop' into feature/rey/negati…
MelReyCG Oct 28, 2025
79e1b11
🐛 typo
MelReyCG Oct 28, 2025
b78a3d7
📝 small precision on loginfo
MelReyCG Oct 27, 2025
9cf5abe
🐛 typo 2
MelReyCG Oct 28, 2025
c46879b
Merge remote-tracking branch 'origin/develop' into feature/rey/negati…
MelReyCG Oct 29, 2025
69cd64c
⚰️ merge missing variable
MelReyCG Oct 29, 2025
b3bfe1a
🎨 copilot code checks
MelReyCG Nov 4, 2025
b5d66be
🎨 📝 code style & docs
MelReyCG Nov 4, 2025
89c5505
📝 doc fix
MelReyCG Nov 4, 2025
370da84
🐛 unit test merge fix
MelReyCG Nov 4, 2025
b3094e4
Merge branch 'develop' into feature/rey/negative-pressure-cells
MelReyCG Nov 5, 2025
168bd0c
Merge branch 'develop' into feature/rey/negative-pressure-cells
MelReyCG Nov 18, 2025
fe60222
🔊 pressures/densities equal to 0.0 are also reported (not only negati…
MelReyCG Feb 9, 2026
9be8d0b
Merge branch 'develop' into feature/rey/negative-pressure-cells
MelReyCG Feb 11, 2026
28643c9
Merge branch 'develop' into feature/rey/negative-pressure-cells
MelReyCG Feb 12, 2026
82269bc
Merge branch 'develop' into feature/rey/negative-pressure-cells
castelletto1 Feb 13, 2026
7c6e4b1
⚡️thanks dudes-guy for com optimisation
MelReyCG Feb 13, 2026
d566805
♻️ std::vector->stdVector
MelReyCG Feb 13, 2026
0a903af
🎨 formatting
MelReyCG Feb 13, 2026
a30d259
♻️output total density the same way
MelReyCG Feb 13, 2026
f67f639
🐛bugfix table footer
MelReyCG Feb 16, 2026
c3891ad
🐛various compil fixes for total density output
MelReyCG Feb 16, 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
10 changes: 6 additions & 4 deletions src/coreComponents/common/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,10 @@ Also provides commonly used components for such as logging, formatting, memory a
#
set( common_headers
${CMAKE_BINARY_DIR}/include/common/GeosxConfig.hpp
format/table/TableLayout.hpp
format/table/TableFormatter.hpp
format/table/TableData.hpp
format/table/TableFormatter.hpp
format/table/TableLayout.hpp
format/table/TableMpiComponents.hpp
format/EnumStrings.hpp
format/LogPart.hpp
format/Format.hpp
Expand Down Expand Up @@ -71,9 +72,10 @@ endif( )
# Specify all sources
#
set( common_sources
format/table/TableLayout.cpp
format/table/TableFormatter.cpp
format/table/TableData.cpp
format/table/TableFormatter.cpp
format/table/TableLayout.cpp
format/table/TableMpiComponents.cpp
format/LogPart.cpp
format/StringUtilities.cpp
logger/GeosExceptions.cpp
Expand Down
10 changes: 0 additions & 10 deletions src/coreComponents/common/format/table/TableData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,16 +89,6 @@ void TableData::clear()
getErrorsList().clear();
}

stdVector< stdVector< TableData::CellData > > const & TableData::getTableDataRows() const
{
return m_rows;
}

stdVector< stdVector< TableData::CellData > > & TableData::getTableDataRows()
{
return m_rows;
}

void TableData2D::collectTableValues( arrayView1d< real64 const > dim0AxisCoordinates,
arrayView1d< real64 const > dim1AxisCoordinates,
arrayView1d< real64 const > values,
Expand Down
21 changes: 7 additions & 14 deletions src/coreComponents/common/format/table/TableData.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,16 +111,6 @@ class TableData
void clearErrors()
{ m_errors->clear(); }

/**
* @return The const rows of the table
*/
stdVector< stdVector< CellData > > const & getTableDataRows() const;

/**
* @return The rows of the table
*/
stdVector< stdVector< CellData > > & getTableDataRows();

/**
* @brief Get all error messages
* @return The vector of error messages
Expand All @@ -133,16 +123,19 @@ class TableData
DataRows const & getCellsData() const
{ return m_rows; }

/**
* @return The const table data rows
*/
DataRows & getCellsData()
{ return m_rows; }

/**
* @brief Comparison operator for data rows
* @param comparingTable The tableData values to compare
* @return The comparison result
*/
inline bool operator==( TableData const & comparingTable ) const
{

return getCellsData() == comparingTable.getCellsData();
}
{ return getCellsData() == comparingTable.getCellsData(); }

/**
* @brief Get all error messages
Expand Down
65 changes: 41 additions & 24 deletions src/coreComponents/common/format/table/TableFormatter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@
* @file TableFormatter.cpp
*/

#include "TableFormatter.hpp"
#include <numeric>
#include "common/format/StringUtilities.hpp"
#include "common/logger/Logger.hpp"
#include "TableFormatter.hpp"

namespace geos
{
Expand Down Expand Up @@ -157,7 +157,7 @@ string TableCSVFormatter::headerToString() const

string TableCSVFormatter::dataToString( TableData const & tableData ) const
{
RowsCellInput const rowsValues( tableData.getTableDataRows() );
RowsCellInput const rowsValues( tableData.getCellsData() );
string result;
size_t total_size = 0;
for( auto const & row : rowsValues )
Expand Down Expand Up @@ -232,12 +232,13 @@ string TableTextFormatter::toString< TableData >( TableData const & tableData )

initalizeTableGrids( m_tableLayout, tableData,
headerCellsLayout, dataCellsLayout, errorCellsLayout,
tableTotalWidth );
outputTable( m_tableLayout, tableOutput,
headerCellsLayout, dataCellsLayout, errorCellsLayout,
tableTotalWidth );
tableTotalWidth, nullptr );

string const sepLine = string( tableTotalWidth, m_horizontalLine );
outputTableHeader( tableOutput, m_tableLayout, headerCellsLayout, sepLine );
outputTableData( tableOutput, m_tableLayout, dataCellsLayout );
outputTableFooter( tableOutput, m_tableLayout, errorCellsLayout, sepLine, !dataCellsLayout.empty() );

getErrorsList().clear();
return tableOutput.str();
}

Expand All @@ -246,10 +247,11 @@ void TableTextFormatter::initalizeTableGrids( PreparedTableLayout const & tableL
CellLayoutRows & headerCellsLayout,
CellLayoutRows & dataCellsLayout,
CellLayoutRows & errorCellsLayout,
size_t & tableTotalWidth ) const
size_t & tableTotalWidth,
ColumnWidthModifier columnWidthModifier ) const
{
RowsCellInput const & inputDataValues( tableInputData.getCellsData() );
bool const hasColumnLayout = tableLayout.getColumnLayersCount() > 0;
RowsCellInput const & inputDataValues( tableInputData.getTableDataRows() );
size_t const inputDataRowsCount = !inputDataValues.empty() ? inputDataValues.front().size() : 0;
size_t const nbVisibleColumns = std::max( size_t( 1 ), ( hasColumnLayout ?
tableLayout.getVisibleLowermostColumnCount() :
Expand Down Expand Up @@ -282,6 +284,9 @@ void TableTextFormatter::initalizeTableGrids( PreparedTableLayout const & tableL
stretchColumnsByMergedCellsWidth( columnsWidth, dataCellsLayout, tableLayout, true );
stretchColumnsByMergedCellsWidth( columnsWidth, errorCellsLayout, tableLayout, true );

if( columnWidthModifier )
columnWidthModifier( columnsWidth );

// the columns width array is now sized after all the table, we can compute the total table width
tableTotalWidth = tableLayout.getBorderMargin() * 2 + 2;
for( size_t columnId = 0; columnId < columnsWidth.size(); ++columnId )
Expand Down Expand Up @@ -494,8 +499,8 @@ void TableTextFormatter::populateDataCellsLayout( PreparedTableLayout const & ta
string_view( &m_horizontalLine, 1 ) :
string_view( inputCell.value );
TableLayout::Alignment const alignment = inputCell.type == CellType::Header ?
tableLayout.defaultHeaderAlignment :
tableLayout.defaultValueAlignment;
tableLayout.getDefaultHeaderAlignment() :
tableLayout.getDefaultValueAlignment();

TableLayout::CellLayout & outputCell = outputRow.cells[idxColumn];
outputCell = TableLayout::CellLayout( inputCell.type, alignment );
Expand Down Expand Up @@ -702,34 +707,44 @@ void TableTextFormatter::applyColumnsWidth( stdVector< size_t > const & columnsW
}
}

void TableTextFormatter::outputTable( PreparedTableLayout const & tableLayout,
std::ostream & tableOutput,
CellLayoutRows const & headerCellsLayout,
CellLayoutRows const & dataCellsLayout,
CellLayoutRows & errorCellsLayout,
size_t const tableTotalWidth ) const
void TableTextFormatter::outputTableHeader( std::ostream & tableOutput,
PreparedTableLayout const & tableLayout,
CellLayoutRows const & headerCellsLayout,
string_view sepLine ) const
{
string const sepLine = string( tableTotalWidth, m_horizontalLine );
if( tableLayout.isLineBreakEnabled())
{
tableOutput << '\n';
}
tableOutput << sepLine << '\n';
tableOutput << tableLayout.getIndentationStr() << sepLine << '\n';
outputLines( tableLayout, headerCellsLayout, tableOutput );
}

if( !dataCellsLayout.empty())
void TableTextFormatter::outputTableData( std::ostream & tableOutput,
PreparedTableLayout const & tableLayout,
CellLayoutRows const & dataCellsLayout ) const
{
if( !dataCellsLayout.empty() )
{
outputLines( tableLayout, dataCellsLayout, tableOutput );
}
}

void TableTextFormatter::outputTableFooter( std::ostream & tableOutput,
PreparedTableLayout const & tableLayout,
CellLayoutRows & errorCellsLayout,
string_view sepLine,
bool hasData ) const
{
if( !errorCellsLayout.empty())
{
outputErrors( tableLayout, errorCellsLayout, tableOutput );
}

if( !dataCellsLayout.empty() || getErrorsList().hasErrors())
tableOutput << sepLine;

if( hasData || !errorCellsLayout.empty() )
{
tableOutput << tableLayout.getIndentationStr() << sepLine;
}

if( tableLayout.isLineBreakEnabled())
{
Expand Down Expand Up @@ -816,6 +831,7 @@ void TableTextFormatter::outputLines( PreparedTableLayout const & tableLayout,
if( isLeftBorderCell )
{ // left table border
isLeftBorderCell=false;
tableOutput << tableLayout.getIndentationStr();
tableOutput << m_verticalLine << string( nbBorderSpaces, cellSpaceChar );
}
else
Expand Down Expand Up @@ -845,4 +861,5 @@ void TableTextFormatter::outputLines( PreparedTableLayout const & tableLayout,
idxRow++;
}
}
}

} /* namespace geos */
62 changes: 45 additions & 17 deletions src/coreComponents/common/format/table/TableFormatter.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ class TableFormatter
};

/**
* @brief class for CSV formatting
* @brief Class to format data in a formatted CSV format
*/
class TableCSVFormatter final : public TableFormatter
{
Expand Down Expand Up @@ -189,9 +189,10 @@ string TableCSVFormatter::toString< TableData >( TableData const & tableData ) c


/**
* @brief class for log formatting
* @brief Class to format data in a formatted text format
* (for log output typically, expecting fixed character size).
*/
class TableTextFormatter final : public TableFormatter
class TableTextFormatter : public TableFormatter
{
public:

Expand Down Expand Up @@ -243,13 +244,15 @@ class TableTextFormatter final : public TableFormatter
void toStream( std::ostream & outputStream, DATASOURCE const & tableData ) const
{ toStreamImpl( outputStream, toString( tableData ) ); }

private:
protected:

/// symbol for separator construction
static constexpr char m_verticalLine = '|';
/// for the extremity of a row
static constexpr char m_horizontalLine = '-';

/// A functor which allow to customize the columns width after their computation.
using ColumnWidthModifier = std::function< void ( stdVector< size_t > & ) >;

/**
* @brief Initializes the table layout with the given table data and prepares necessary layouts for headers and data cells.
Expand All @@ -258,30 +261,54 @@ class TableTextFormatter final : public TableFormatter
* @param headerCellsLayout A reference to a `CellLayoutRows` where the header cells will be populated.
* @param dataCellsLayout A reference to a `CellLayoutRows` where the data cells will be populated.
* @param errorCellsLayout A reference to a `CellLayoutRows` where the error cells will be populated.
* @param separatorLine A string that will be used as the table separator line
* @param tableTotalWidth A string that will be used as the table separator line
* @param columnWidthModifier A functor which allow to customize the columns width after their computation.
*/
void initalizeTableGrids( PreparedTableLayout const & tableLayout,
TableData const & tableData,
CellLayoutRows & dataCellsLayout,
CellLayoutRows & headerCellsLayout,
CellLayoutRows & errorCellsLayout,
size_t & tableTotalWidth ) const;
size_t & tableTotalWidth,
ColumnWidthModifier columnWidthModifier ) const;

/**
* @brief Outputs the top part of the formatted table to the provided output stream.
* @param tableOutput A reference to an `std::ostream` where the formatted table will be written.
* @param tableLayout The layout of the table
* @param headerCellsLayout The header rows in a grid layout
* @param separatorLine A string that will be used as the table separator line
*/
void outputTableHeader( std::ostream & tableOutput,
PreparedTableLayout const & tableLayout,
CellLayoutRows const & headerCellsLayout,
string_view separatorLine ) const;

/**
* @brief Outputs the formatted table to the provided output stream.
* @brief Outputs the data part of the formatted table to the provided output stream.
* @param tableOutput A reference to an `std::ostream` where the formatted table will be written.
* @param tableLayout The layout of the table
* @param dataCellsLayout The data rows in a grid layout
*/
void outputTableData( std::ostream & tableOutput,
PreparedTableLayout const & tableLayout,
CellLayoutRows const & dataCellsLayout ) const;

/**
* @brief Outputs the bottom part of the formatted table to the provided output stream.
* @param tableOutput A reference to an `std::ostream` where the formatted table will be written.
* @param headerCellsLayout The layout of the header rows
* @param dataCellsLayout The layout of the data rows
* @param tableLayout The layout of the table
* @param separatorLine A string that will be used as the table separator line
* @param errorCellsLayout The layout of the error rows
* @param separatorLine The string to be used as the table separator line
* @param hasData Indicates whether there is data in the table TableData.
*/
void outputTable( PreparedTableLayout const & tableLayout,
std::ostream & tableOutput,
CellLayoutRows const & headerCellsLayout,
CellLayoutRows const & dataCellsLayout,
CellLayoutRows & errorCellsLayout,
size_t tableTotalWidth ) const;
void outputTableFooter( std::ostream & tableOutput,
PreparedTableLayout const & tableLayout,
CellLayoutRows & errorCellsLayout,
string_view separatorLine,
bool hasData ) const;

private:

/**
* @brief Outputs the formatted table lines to the output stream.
Expand Down Expand Up @@ -312,7 +339,7 @@ class TableTextFormatter final : public TableFormatter
*/
void populateTitleCellsLayout( PreparedTableLayout const & tableLayout,
CellLayoutRows & headerCellsLayout,
size_t const nbVisibleColumn ) const;
size_t nbVisibleColumn ) const;

/**
* @brief Populate a grid of CellLayout with all visible columns of the given table layout.
Expand Down Expand Up @@ -402,6 +429,7 @@ class TableTextFormatter final : public TableFormatter
void formatCell( std::ostream & tableOutput,
TableLayout::CellLayout const & cell,
size_t idxLine ) const;

};

/**
Expand Down
Loading
Loading