Skip to content

refactor: replace hand-written CSVs with the Table infrastructure #4039

Open
kdrienCG wants to merge 13 commits into
developfrom
refactor/kdrienCG/useTablesWithCSVs
Open

refactor: replace hand-written CSVs with the Table infrastructure #4039
kdrienCG wants to merge 13 commits into
developfrom
refactor/kdrienCG/useTablesWithCSVs

Conversation

@kdrienCG

@kdrienCG kdrienCG commented Apr 24, 2026

Copy link
Copy Markdown
Contributor

This PR replaces "hand-written" CSV tables in two well files with the Tables infrastructure (TableLayout, TableData).

Add an overload constructor in TableLayout to accept only a vector of columns (without a title, similar to the constructor with only an initializer_list)
@kdrienCG kdrienCG self-assigned this Apr 24, 2026
@kdrienCG kdrienCG added the type: cleanup / refactor Non-functional change (NFC) label Apr 24, 2026
@kdrienCG kdrienCG marked this pull request as ready for review May 4, 2026 13:04
@herve-gross

Copy link
Copy Markdown
Contributor

@kdrienCG can you rebase this on the latest develop? @jafranc maybe you can help for this. Thanks!

Comment thread src/coreComponents/physicsSolvers/fluidFlow/wells/CompositionalMultiphaseWell.cpp Outdated

@MelReyCG MelReyCG left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same remarks for single-phase

Comment on lines +24 to +31
#include "common/Path.hpp"
#include "common/StdContainerWrappers.hpp"
#include "common/TimingMacros.hpp"
#include "common/format/Format.hpp"
#include "common/format/table/TableData.hpp"
#include "common/format/table/TableFormatter.hpp"
#include "common/format/table/TableLayout.hpp"
#include "common/logger/Logger.hpp"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please do not add already added includes (maybe deactivate clangd auto-include?)
(also for the <filesystem> below)

Comment on lines +2211 to +2225
stdVector< string > columnNames;
columnNames.reserve( 5 + numPhase + numComp );
columnNames.emplace_back( GEOS_FMT( "Time [{}]", units::getSymbol( units::Unit::Time ) ) );
columnNames.emplace_back( GEOS_FMT( "dt [{}]", units::getSymbol( units::Unit::Time ) ) );
columnNames.emplace_back( GEOS_FMT( "BHP [{}]", units::getSymbol( units::Unit::Pressure ) ) );
columnNames.emplace_back( GEOS_FMT( "Total rate [{}/s]", massUnit ) );
columnNames.emplace_back( GEOS_FMT( "Total {} volumetric rate [{}m3/s]", conditionKey, unitKey ) );
for( integer ip = 0; ip < numPhase; ++ip )
{
outputFile.open( m_ratesOutputDir + "/" + wellControlsName + ".csv", std::ios_base::app );
outputFile << time_n << "," << dt;
columnNames.emplace_back( GEOS_FMT( "Phase {} {} volumetric rate [{}m3/s]", ip, conditionKey, unitKey ) );
}
for( integer ic = 0; ic < numComp; ++ic )
{
columnNames.emplace_back( GEOS_FMT( "Component {} rate [{}/s]", ic, massUnit ) );
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If possible, relocate this work at initialization or only for the first time.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same request for TableLayout & Table*Formatter instances.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: cleanup / refactor Non-functional change (NFC)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants