Skip to content

Commit 8804a6e

Browse files
committed
Squashed commit of the following:
commit 88e5db1 Author: MelReyCG <melvin.rey@capgemini.com> Date: Thu Mar 27 13:58:47 2025 +0100 Revert "➖ removal of gcc<9 compiler option" This reverts commit 977a24d. commit 5759d0a Author: MelReyCG <melvin.rey@capgemini.com> Date: Thu Mar 27 13:43:44 2025 +0100 🚨 🎨 remove some CUDA warning commit 977a24d Author: MelReyCG <melvin.rey@capgemini.com> Date: Thu Mar 27 10:18:04 2025 +0100 ➖ removal of gcc<9 compiler option commit 9f032fd Author: MelReyCG <melvin.rey@capgemini.com> Date: Wed Mar 26 15:10:18 2025 +0100 🎨 uncrustify commit 84894bb Author: MelReyCG <melvin.rey@capgemini.com> Date: Wed Mar 26 14:02:47 2025 +0100 📝 last lacking docs commit a9298de Author: MelReyCG <melvin.rey@capgemini.com> Date: Wed Mar 26 13:53:39 2025 +0100 📝 🐛 doxygen region not suported for this usecase :'( commit 35911a0 Author: MelReyCG <melvin.rey@capgemini.com> Date: Wed Mar 26 12:01:42 2025 +0100 📝 🎨 Improve Cell object robustness & encapsulation + docs commit dbc7f0d Author: MelReyCG <melvin.rey@capgemini.com> Date: Tue Mar 25 16:07:24 2025 +0100 🐛 compil fix commit b37eefc Author: MelReyCG <melvin.rey@capgemini.com> Date: Tue Mar 25 15:43:27 2025 +0100 🐛 compil fix commit 4642bda Author: MelReyCG <melvin.rey@capgemini.com> Date: Tue Mar 25 15:36:44 2025 +0100 🐛 🎨 repaired addSubColumns so it really append + added the "Cell" type to base Column on it and propose a type that stores the setting AND the data (for further works) commit 47b493b Author: MelReyCG <melvin.rey@capgemini.com> Date: Tue Mar 25 11:27:28 2025 +0100 🦺 rebaseline commit 953ea3b Author: MelReyCG <melvin.rey@capgemini.com> Date: Tue Mar 25 11:24:35 2025 +0100 🐛 completed the hidden column fix in commit e495521 commit 1202d4e Author: MelReyCG <melvin.rey@capgemini.com> Date: Tue Mar 25 11:11:06 2025 +0100 📝 docs commit 9327e03 Author: MelReyCG <melvin.rey@capgemini.com> Date: Mon Mar 24 17:55:13 2025 +0100 📝 docs commit e495521 Author: MelReyCG <melvin.rey@capgemini.com> Date: Mon Mar 24 16:51:43 2025 +0100 🐛 ✅ 2 bug fixes: when parent column only is not visible (now hides children) + it is no longer possible to enter wrong visibility value commit 7972176 Merge: 9653609 3c4000e Author: MelReyCG <melvin.rey@capgemini.com> Date: Mon Mar 24 15:47:14 2025 +0100 Merge remote-tracking branch 'origin/develop' into bugfix/rey/csv-export-fail commit 3c4000e Author: Pavel Tomin <paveltomin@users.noreply.github.com> Date: Sat Mar 22 08:35:57 2025 -0500 feat: make possible to use solid mechanics solver to perform poromechanics initialization (#3396) commit 2118b48 Author: Dickson Kachuma <81433670+dkachuma@users.noreply.github.com> Date: Fri Mar 21 17:53:47 2025 -0500 feat: Add a compositional Phillips brine density model (#3598) Co-authored-by: Omar Duran <omaryesiduran@gmail.com> commit 8863635 Author: Brian Han <han12@llnl.gov> Date: Fri Mar 21 11:53:52 2025 -0700 Fix links in spack docs; reword beginning section (#3550) Co-authored-by: Matteo Cusini <49037133+CusiniM@users.noreply.github.com> commit ab75c18 Author: Brian Han <han12@llnl.gov> Date: Fri Mar 21 09:22:21 2025 -0700 fix: CI style and docs checks (#3584) * Add host-config path so style and docs jobs can find deps * Capture return code of cmake configuration line in config-build.py instead of always returning success on cmake configure line call * Fix doyxgen errors - undo deleted getMeshTargets() comment * Rerun uncrustify --------- Co-authored-by: Matteo Cusini <49037133+CusiniM@users.noreply.github.com> commit 9653609 Author: MelReyCG <melvin.rey@capgemini.com> Date: Fri Mar 21 14:10:26 2025 +0100 🐛 ✅ finalized the fix for when the reference row has merged cell : removed the reference-row concept in favor of a columns-width array commit 158485e Author: MelReyCG <melvin.rey@capgemini.com> Date: Fri Mar 21 14:07:48 2025 +0100 🧪 added failing test for the side case when the reference row has merged cell(s) commit 8b425a9 Author: MelReyCG <melvin.rey@capgemini.com> Date: Fri Mar 21 14:05:09 2025 +0100 🐛 ✅ finalized the fix for the side-case bug (when only one merged line) + correct unit test commit 3d71945 Author: MelReyCG <melvin.rey@capgemini.com> Date: Fri Mar 21 12:05:38 2025 +0100 🐛 🚧 fix two side-case bugs + docs on a bug to fix/warn later commit 8ff38d3 Merge: aea705c 5732c5c Author: MelReyCG <melvin.rey@capgemini.com> Date: Fri Mar 21 10:19:40 2025 +0100 Merge commit '5732c5c0be16ead0b846c302ed06d30988da4a9f' into bugfix/rey/csv-export-fail commit aea705c Author: MelReyCG <melvin.rey@capgemini.com> Date: Fri Mar 21 10:11:05 2025 +0100 🦺 rebaseline commit 5732c5c Author: Frank Fei <frankfei0929@gmail.com> Date: Thu Mar 20 18:23:52 2025 -0700 feat: phase-field nucleation modeling of hydraulic fracturing (#2125) * add constitutive files for the phase-field nucleation formulation * add constitutive files for the phase-field nucleation formulation * modify the pf formulation by adding an external driving force * add a member variable for the external driving force and a member function to output it * add the new constitutive for pf nucleation into the passthru * Add DamageExtDrivingForce files into CMakeLists * solve the segmentation error * Add an input file for the phase-field nucleation formulation * correct the calculation of the external driving force * adding TableFunction files for the surfing boundary condition * adding an option variable for the external driving force term * adding the initial fracture and surfing boundary condition * set upper and lower bounds of the damage when calculating the degradation function * correct the typo in the formulation * set a threshold for the strain energy based on c_e to keep the damage value non-negative * clean the phase-field code and add the external driving force term into the Damage base code * Add a switch of the external driving force to check if the nucleation formulation is called * clean the phase-field code by merging the nucleation formulation into the damage base code * create the input file and mesh for the three point test * add new mesh files for the 3 points loading test * change the upper limit of d to 1 in the degradation function * add the input file for the test to calibrate modeling parameters * add an input file for the wellbore problem * fixed changes in schema and .rst files for nucleation formulation * remove unnecessary function for specifying the nodal value * fixed the linear solver parameters and changed the material parameters to cement * added a small tolerance in the degradation such that it has a small residual when d = 1 * modified the upper threshold of d * added a nodal scale array to calculate the traction magnitude * added a damageUpperBound variable to indicate the upper limit of the phase-field * renamed the flag to add the external driving force for the nucleation model * changed the default value of upper bound * removed the function to apply damage on traction B.C. * reset the default value of the upper bound of damage * added a lower limit parameter for the degradation * added a damage upper bound constraint * changed the parameter for the smoke file * removed the unnecessary changes in TractionBoundaryCondition * added discretization for surface generator in parameter file and changed MeshTargets loop. * added a flag to indicate whether to apply the nodal damage irreversibility constraint * made the signs consistent when assembling the system * added the flag to indicate the crack irreversibility constraint * removed the discretization in surface generator parameters * rebaselined for the phasefield_nucleation_formulation * added checks of input parameters if the extDrivingForceFlag is turned on * added lapack routines and functions to compute least squares solutions * added the function to update pressure gradient in a cell * added a phase-field poromechanics solver * modified Damage model for pressurized fracture * added new variables into spectral and vol-dev damage models * added a porous solid model for damage model * added new PhaseFieldPoromechancisSolver into CmakeLists * changed damage variable name according to the Damage model * added a poromechanics damage kernel for assembly of solid mechanics and flow equation. * added the permeability model for damaged materials * added a fracture injection example * added pressure effect term in the damage equation * added the input file for the wellbore problem * temporarily turned off chechSystemSolution * applied damage on surface traction * added an input file for the wellbore concrete specimen * added a wellbore example for the solid phase-field nucleation solver * updated the schema and docs for the new solver and models * modified parameter in damage permeability * changed the scale ont he degraded traction * added the pressurized damage kernel * added the function to apply the degradation on traction B.C. * moved pressureGradient and its update function to SinglePhaseBase * refactored the damage kernel and PorousDamageSolid for singlePhasePoromechanics * updated total stress calculation in the phase-field poromechancis solve * modified phaseFieldPoromechanics to fit in the template of coupledSolver * compiled with the new phaseFieldPoromechanics solver * removed unnecessary pressure gradient update * change the imposed damage to 1 for irreversibility * changed the fracture pressure term to pressure_n * modified injection case xml * corrected the string array type * to model pressurized crack * changed the linear solver for the damage solver * added fields of certain parameters to allow for random distribution * added field variables for compressive strength and delat coefficient * made SinglePhasePoromechanicsDamage a derivative of SinglePhasePoromechanics kernel and updated copyright content * made the damage dependent constant an input parameter * removed pressurized damage kernel for nonporous impermeable solid in this branch * modified xmls and added a smoke test * added SinglePhasePoromechanics_impl.hpp to the instantiation of SinglePhasePoromechanicsDamage --------- commit ccc9eac Author: MelReyCG <melvin.rey@capgemini.com> Date: Thu Mar 20 18:04:09 2025 +0100 🐛 forgot a side case (when we have no data) commit 6bb553c Author: MelReyCG <melvin.rey@capgemini.com> Date: Thu Mar 20 17:49:17 2025 +0100 🎨 uncrustify + better suggestion commit 9a7f8be Author: MelReyCG <melvin.rey@capgemini.com> Date: Thu Mar 20 17:48:55 2025 +0100 🎨 uncrustify + better suggestion commit 1dfb5d2 Author: MelReyCG <melvin.rey@capgemini.com> Date: Thu Mar 20 16:51:54 2025 +0100 🐛 fix compilation by using the right macro commit 08bd71b Author: MelReyCG <melvin.rey@capgemini.com> Date: Thu Mar 20 16:49:19 2025 +0100 🐛 fix compilation by removing a unused var, and actually use another one. commit 6cd6a20 Author: MelReyCG <melvin.rey@capgemini.com> Date: Thu Mar 20 16:42:03 2025 +0100 🎨 uncrustify commit 3cd1826 Author: MelReyCG <melvin.rey@capgemini.com> Date: Thu Mar 20 16:30:07 2025 +0100 🦺 rebaseline commit 50e1739 Author: MelReyCG <melvin.rey@capgemini.com> Date: Thu Mar 20 15:53:04 2025 +0100 🎨 uncoupled title & header layout populating (we will later be able to insert other content in-between more easily) commit beda2bb Author: MelReyCG <melvin.rey@capgemini.com> Date: Thu Mar 20 13:45:17 2025 +0100 📝 documenting test goal explanation commit c734b7b Author: MelReyCG <melvin.rey@capgemini.com> Date: Thu Mar 20 11:47:34 2025 +0100 📝 adding a note for error management commit 0879433 Author: MelReyCG <melvin.rey@capgemini.com> Date: Thu Mar 20 10:31:38 2025 +0100 📦 schemaschemaschemaschemaschema commit a00f6bc Author: MelReyCG <melvin.rey@capgemini.com> Date: Thu Mar 20 10:30:30 2025 +0100 🦺 rebaseline commit 743a89f Author: MelReyCG <melvin.rey@capgemini.com> Date: Wed Mar 19 16:35:47 2025 +0100 🔧 support for std::filesystem for CUDA/GCC8.5 compilers commit 5db0b2e Merge: 8febff2 24eca07 Author: MelReyCG <melvin.rey@capgemini.com> Date: Wed Mar 19 16:23:59 2025 +0100 Merge remote-tracking branch 'origin/develop' into bugfix/rey/csv-export-fail commit 8febff2 Author: MelReyCG <melvin.rey@capgemini.com> Date: Wed Mar 19 15:30:58 2025 +0100 ✨ ✅ support table formatting without layout specification, add a unit-test for it commit 24eca07 Author: Dickson Kachuma <81433670+dkachuma@users.noreply.github.com> Date: Wed Mar 19 09:28:30 2025 -0500 feat: Soreide-Whitson equation of state (#3597) Co-authored-by: Omar Duran <omaryesiduran@gmail.com> commit 4b13f7b Author: Dickson Kachuma <81433670+dkachuma@users.noreply.github.com> Date: Wed Mar 19 09:28:06 2025 -0500 feat: Add precision field to PVTDriver (#3600) commit 8620c7b Author: MelReyCG <melvin.rey@capgemini.com> Date: Wed Mar 19 11:17:44 2025 +0100 Merge remote-tracking branch 'origin/develop' into bugfix/rey/csv-export-fail commit 33fc3fc Author: Pavel Tomin <paveltomin@users.noreply.github.com> Date: Tue Mar 18 18:57:40 2025 -0400 build: remove large mem (#3590) commit 8d9ac9d Author: Dickson Kachuma <81433670+dkachuma@users.noreply.github.com> Date: Tue Mar 18 16:26:35 2025 -0500 refactor: Separate compositional fluid parameters from models (#3594) commit c988661 Author: Omar Duran <omaryesiduran@gmail.com> Date: Tue Mar 18 12:26:14 2025 -0700 ci: oduran/xml_validation (#3588) commit cfab6c8 Author: Arnaud DUDES <155963334+arng40@users.noreply.github.com> Date: Tue Mar 18 20:24:00 2025 +0100 docs: Log level documentation on remaining package (#3494) commit 96a9449 Author: MelReyCG <melvin.rey@capgemini.com> Date: Tue Mar 18 11:59:52 2025 +0100 🚧 added no-layout formatter (untested) commit c636a09 Author: MelReyCG <melvin.rey@capgemini.com> Date: Tue Mar 18 11:57:45 2025 +0100 📦 other schema commit a7f1771 Merge: e413bf2 7000da0 Author: MelReyCG <melvin.rey@capgemini.com> Date: Tue Mar 18 11:54:47 2025 +0100 Merge remote-tracking branch 'origin/develop' into bugfix/rey/csv-export-fail commit 7000da0 Author: Randolph Settgast <settgast1@llnl.gov> Date: Mon Mar 17 11:11:58 2025 -0700 remove some constructors/destructors in VEM implementation to avoid warnings (#3599)
1 parent ffffd42 commit 8804a6e

8 files changed

Lines changed: 309 additions & 123 deletions

File tree

.integrated_tests.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
baselines:
22
bucket: geosx
3-
baseline: integratedTests/baseline_integratedTests-pr2125-10859-1db8623
3+
baseline: integratedTests/baseline_integratedTests-pr3537-10887-9327e03
44

55
allow_fail:
66
all: ''

BASELINE_NOTES.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ PR #3537 (2025-03-20)
1010
=====================
1111
Added two attributes to TableFunction: writeCSV and logLevel.
1212

13+
PR #3396 (2024-03-21)
14+
=====================
15+
Use solid mechanics solver directly to perform poromechanics initialization.
1316

1417
PR #2125 (2024-03-20)
1518
=====================

src/coreComponents/common/format/table/TableFormatter.cpp

Lines changed: 31 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
namespace geos
2828
{
2929

30-
3130
TableFormatter::TableFormatter():
3231
m_tableLayout()
3332
{}
@@ -52,7 +51,7 @@ string TableCSVFormatter::headerToString() const
5251
size_t total_size = 0;
5352
for( auto const & column : m_tableLayout.getColumns())
5453
{
55-
for( auto const & str : column.m_headerLayout.m_lines )
54+
for( auto const & str : column.m_header.m_layout.getLines() )
5655
{
5756
total_size += str.size();
5857
}
@@ -63,7 +62,7 @@ string TableCSVFormatter::headerToString() const
6362
for( std::size_t idxColumn = 0; idxColumn < m_tableLayout.getColumns().size(); ++idxColumn )
6463
{
6564
std::ostringstream strValue;
66-
for( auto const & str : m_tableLayout.getColumns()[idxColumn].m_headerLayout.m_lines )
65+
for( auto const & str : m_tableLayout.getColumns()[idxColumn].m_header.m_layout.getLines() )
6766
{
6867
result.append( str );
6968
}
@@ -220,15 +219,15 @@ void TableTextFormatter::populateTitleCellsLayout( PreparedTableLayout const & t
220219
CellLayoutRows & headerCellsLayout ) const
221220
{
222221
TableLayout::CellLayout const & titleInput = tableLayout.getTitleLayout();
223-
if( !titleInput.m_lines.empty() && !titleInput.m_lines.front().empty() )
222+
if( !titleInput.isEmpty() )
224223
{ // if it exists, we add the title, as a first row with all cells merged in one containing the title text
225224
headerCellsLayout.reserve( headerCellsLayout.size() + 2 );
226225

227226
// the title row consists in a row of cells merging with the last cell containing the title text
228227
headerCellsLayout.emplace_back() = {
229228
std::vector< TableLayout::CellLayout >( tableLayout.getVisibleLowermostColumnCount(),
230229
TableLayout::CellLayout( CellType::MergeNext ) ), // cells
231-
titleInput.m_lines.size(), // sublinesCount
230+
titleInput.getHeight(), // sublinesCount
232231
};
233232
headerCellsLayout.back().cells.back() = titleInput;
234233

@@ -277,7 +276,7 @@ void TableTextFormatter::populateHeaderCellsLayout( PreparedTableLayout const &
277276

278277
for( auto it = tableLayout.beginDeepFirst(); it != tableLayout.endDeepFirst(); ++it )
279278
{
280-
CellLayout const & currentCell = it->m_headerLayout;
279+
CellLayout const & currentCell = it->m_header.m_layout;
281280
if( currentCell.m_cellType != CellType::Hidden )
282281
{
283282
size_t const layer = it.getCurrentLayer();
@@ -293,7 +292,7 @@ void TableTextFormatter::populateHeaderCellsLayout( PreparedTableLayout const &
293292

294293
// the current cell layer number of lines must be the max of all cells of this layer
295294
headerCellsLayout[rowId].sublinesCount = std::max( headerCellsLayout[rowId].sublinesCount,
296-
currentCell.m_lines.size() );
295+
currentCell.getHeight() );
297296

298297
// we add the current cell and all its subdivision
299298
for( size_t idxColumn = 0; idxColumn < subdivsCount[std::ptrdiff_t( it.getPtr() )]; idxColumn++ )
@@ -309,7 +308,7 @@ void TableTextFormatter::populateHeaderCellsLayout( PreparedTableLayout const &
309308
for( size_t subLayer = layer + 1; subLayer < columnsLayersCount; subLayer++ )
310309
{
311310
CellLayout emptyCell{CellType::Header, TableLayout::Alignment::center};
312-
emptyCell.m_cellWidth = currentCell.m_cellWidth;
311+
emptyCell.setWidth( currentCell.getWidth() );
313312
headerCellsLayout[getColumnRowId( subLayer )].cells.push_back( emptyCell );
314313
}
315314
}
@@ -356,10 +355,10 @@ void TableTextFormatter::populateDataCellsLayout( PreparedTableLayout const & ta
356355
continue;
357356
}
358357

359-
if( columnIt->m_headerLayout.m_cellType != CellType::Hidden )
358+
if( columnIt->isVisible() )
360359
{
361360
TableData::CellData const & inputCell = inputDataValues[idxRow][idxInputColumn];
362-
CellType const type = columnIt->m_headerLayout.m_cellType == CellType::Hidden ?
361+
CellType const type = !columnIt->isVisible() ?
363362
CellType::Hidden :
364363
inputCell.type;
365364
string_view value = inputCell.type == CellType::Separator ?
@@ -370,7 +369,7 @@ void TableTextFormatter::populateDataCellsLayout( PreparedTableLayout const & ta
370369
outputCell = TableLayout::CellLayout( type, columnIt->m_alignment.valueAlignment );
371370
outputCell.prepareLayout( value, tableLayout.getMaxColumnWidth() );
372371

373-
maxLinesInRow = std::max( maxLinesInRow, outputCell.m_lines.size() );
372+
maxLinesInRow = std::max( maxLinesInRow, outputCell.getHeight() );
374373
idxOutputColumn++;
375374
}
376375
idxInputColumn++;
@@ -409,7 +408,7 @@ void TableTextFormatter::populateDataCellsLayout( PreparedTableLayout const & ta
409408
outputCell = TableLayout::CellLayout( inputCell.type, defaultAlignment.valueAlignment );
410409
outputCell.prepareLayout( value, tableLayout.getMaxColumnWidth() );
411410

412-
maxLinesInRow = std::max( maxLinesInRow, outputCell.m_lines.size() );
411+
maxLinesInRow = std::max( maxLinesInRow, outputCell.getHeight() );
413412
}
414413
outputRow.sublinesCount = maxLinesInRow;
415414
}
@@ -433,7 +432,7 @@ void TableTextFormatter::populateErrorCellsLayout( PreparedTableLayout const & t
433432
1
434433
} );
435434

436-
for( auto const & error : getErrorsList().errorText )
435+
for( string_view error : getErrorsList().errorText )
437436
{
438437
errorCellsLayout.push_back(
439438
{
@@ -442,10 +441,9 @@ void TableTextFormatter::populateErrorCellsLayout( PreparedTableLayout const & t
442441
1
443442
} );
444443

445-
errorCellsLayout[errorCellsLayout.size() - 1].cells[nbCells - 1].m_cellWidth = 0;
444+
errorCellsLayout[errorCellsLayout.size() - 1].cells[nbCells - 1].setWidth( 0 );
446445
errorCellsLayout[errorCellsLayout.size() - 1].cells[nbCells - 1].m_cellType = CellType::Value;
447-
errorCellsLayout[errorCellsLayout.size() - 1].cells[nbCells - 1].m_lines.emplace_back( error );
448-
446+
errorCellsLayout[errorCellsLayout.size() - 1].cells[nbCells - 1].getLines().emplace_back( error );
449447
}
450448
}
451449

@@ -464,8 +462,8 @@ void TableTextFormatter::stretchColumnsByCellsWidth( std::vector< size_t > & col
464462
auto const & cell = rowCells[columnId];
465463
bool const isToMerge = columnId > 0 && rowCells[columnId-1].m_cellType == CellType::MergeNext;
466464
bool const isContentCell = cell.m_cellType != CellType::MergeNext;
467-
if( isContentCell && !isToMerge && columnsWidth[columnId] < cell.m_cellWidth )
468-
columnsWidth[columnId] = rowCells[columnId].m_cellWidth;
465+
if( isContentCell && !isToMerge && columnsWidth[columnId] < cell.getWidth() )
466+
columnsWidth[columnId] = rowCells[columnId].getWidth();
469467
}
470468
}
471469
}
@@ -490,8 +488,8 @@ void TableTextFormatter::stretchColumnsByMergedCellsWidth( std::vector< size_t >
490488
bool const isContentCell = cell.m_cellType != CellType::MergeNext;
491489
bool const isLastToMerge = columnId > 0 && tableGrid[rowId].cells[columnId-1].m_cellType == CellType::MergeNext;
492490
if( isContentCell && isLastToMerge )
493-
{ // detected cells to merge, accumulating content width & column number & space
494-
size_t mergedCellsWidth = cell.m_cellWidth;
491+
{ // detected cells to merge, accumulating content width & column number & space
492+
size_t mergedCellsWidth = cell.getWidth();
495493
size_t mergedColumnsWidth = columnsWidth[columnId] + flexSpaces[columnId];
496494
size_t mergedCellsCount = 1;
497495
for( integer mergedId = columnId - 1; mergedId >= 0; --mergedId )
@@ -516,8 +514,8 @@ void TableTextFormatter::stretchColumnsByMergedCellsWidth( std::vector< size_t >
516514
}
517515
}
518516
else
519-
{ //if not overflowing, it means the merged cell needs to be stretch to fit the available column space.
520-
cell.m_cellWidth += size_t( -overflowingWidth );
517+
{ //if not overflowing, it means the merged cell needs to be stretch to fit the available column space.
518+
cell.setWidth( cell.getWidth() + size_t( -overflowingWidth ) );
521519
}
522520
}
523521
}
@@ -549,7 +547,7 @@ void TableTextFormatter::stretchColumnsByMergedCellsWidth( std::vector< size_t >
549547
{
550548
// this is the last cell to merge (which contains the actual merged content),
551549
// we can compute here the space potencially wasted by the flexible space
552-
integer const potentialOversize = integer( mergedColumnsWidth ) - integer( mergedCell.m_cellWidth );
550+
integer const potentialOversize = integer( mergedColumnsWidth ) - integer( mergedCell.getWidth() );
553551
oversize = std::min( oversize, potentialOversize );
554552
break;
555553
}
@@ -591,7 +589,7 @@ void TableTextFormatter::applyColumnsWidth( std::vector< size_t > const & column
591589
bool const isToMerge = columnId > 0 && tableGrid[rowId].cells[columnId-1].m_cellType == CellType::MergeNext;
592590
if( !isToMerge )
593591
{
594-
cell.m_cellWidth = std::max( cell.m_cellWidth, columnsWidth[columnId] );
592+
cell.setWidth( std::max( cell.getWidth(), columnsWidth[columnId] ) );
595593
}
596594
else
597595
{
@@ -604,7 +602,7 @@ void TableTextFormatter::applyColumnsWidth( std::vector< size_t > const & column
604602

605603
mergedColumnsWidth += columnsWidth[previousColumnId] + spaceBetweenColumns;
606604
}
607-
cell.m_cellWidth = mergedColumnsWidth;
605+
cell.setWidth( mergedColumnsWidth );
608606
}
609607
}
610608
}
@@ -637,10 +635,10 @@ void TableTextFormatter::outputTable( PreparedTableLayout const & tableLayout,
637635
TableLayout::CellLayout & errorConfig = errorLayout.cells[errorLayout.cells.size() - 1];
638636
if( errorConfig.m_cellType == CellType::Value )
639637
{
640-
size_t tableWidth = errorConfig.m_cellWidth;
641-
errorConfig.prepareLayout( errorConfig.m_lines.front(), errorConfig.m_cellWidth );
642-
errorConfig.m_cellWidth = tableWidth;
643-
errorLayout.sublinesCount = errorConfig.m_lines.size();
638+
size_t tableWidth = errorConfig.getWidth();
639+
errorConfig.prepareLayout( errorConfig.getLines().front(), errorConfig.getWidth() );
640+
errorConfig.setWidth( tableWidth );
641+
errorLayout.sublinesCount = errorConfig.getHeight();
644642
}
645643
}
646644

@@ -681,14 +679,14 @@ void TableTextFormatter::formatCell( std::ostringstream & tableOutput,
681679
{
682680
if( cell.m_cellType == CellType::Separator )
683681
{
684-
tableOutput << string( cell.m_cellWidth, m_horizontalLine );
682+
tableOutput << string( cell.getWidth(), m_horizontalLine );
685683
}
686684
else
687685
{
688-
string_view value = idxLine < cell.m_lines.size() && cell.m_cellType != CellType::Hidden ?
689-
string_view( cell.m_lines[idxLine] ):
686+
string_view value = idxLine < cell.getHeight() && cell.m_cellType != CellType::Hidden ?
687+
string_view( cell.getLines()[idxLine] ):
690688
string_view( "" );
691-
tableOutput << buildCell( cell.m_alignment, value, cell.m_cellWidth );
689+
tableOutput << buildCell( cell.m_alignment, value, cell.getWidth() );
692690
}
693691
}
694692

src/coreComponents/common/format/table/TableFormatter.hpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,14 @@ class TableFormatter
4141
/// Represent a row of the Table (header or values) when structured for formatting
4242
struct CellLayoutRow
4343
{
44+
/// The cell list of the row instance.
4445
std::vector< TableLayout::CellLayout > cells;
46+
47+
/// The maximum number of lines in the `cells` texts (no text is considered as one line).
4548
size_t sublinesCount;
4649
};
4750

48-
/// Represent the Table (header or values) when structured for formatting
51+
/// Represent a table section (title + header or values) layout: view on the data and its layout settings.
4952
using CellLayoutRows = std::vector< CellLayoutRow >;
5053

5154
/**

0 commit comments

Comments
 (0)