GEOS
Classes | Public Types | Public Member Functions | List of all members
geos::TableData2D Class Reference

Class for managing 2D table m_data. More...

#include <TableData.hpp>

Classes

struct  TableDataHolder
 Struct containing conversion informations. More...
 

Public Types

using RowType = real64
 Type real64 for a row.
 
using ColumnType = real64
 Type real64 for a column.
 

Public Member Functions

template<typename T >
void addCell (RowType rowValue, ColumnType columnValue, T const &value)
 Add a cell to the table. If necessary, create automatically the containing column & row. More...
 
void collectTableValues (arraySlice1d< real64 const > rowAxisValues, arraySlice1d< real64 const > columnAxisValues, arrayView1d< real64 const > values)
 Collects all the values needed to build the table. More...
 
TableData2D::TableDataHolder convertTable2D (arrayView1d< real64 const > const values, units::Unit const valueUnit, ArrayOfArraysView< real64 const > const coordinates, string_view rowAxisDescription, string_view columnAxisDescription)
 
TableDataHolder buildTableData (string_view dataDescription, string_view rowFmt="{}", string_view columnFmt="{}") const
 

Detailed Description

Class for managing 2D table m_data.

Definition at line 79 of file TableData.hpp.

Member Function Documentation

◆ addCell()

template<typename T >
void geos::TableData2D::addCell ( RowType  rowValue,
ColumnType  columnValue,
T const &  value 
)

Add a cell to the table. If necessary, create automatically the containing column & row.

Template Parameters
TThe value passed to addCell (can be any type).
Parameters
valueCell value to be added.
rowValueThe value of the row containing the cell.
columnValueThe value of the column containing the cell.

Definition at line 166 of file TableData.hpp.

◆ buildTableData()

TableDataHolder geos::TableData2D::buildTableData ( string_view  dataDescription,
string_view  rowFmt = "{}",
string_view  columnFmt = "{}" 
) const
Returns
Convert and return a struct containing a 1D Table, the column names list from a TableData2D and any errors related to the table
Parameters
dataDescriptionThe table dataDescription shown at the top left side
rowFmtThe y axis units of the table.
columnFmtThe x axis units of the table.
Note
The rows and columns FMT can be customized. The bracket "{}" will be replaced by the axis value. By default it displays the axis value. I.E to display a customized axis to show the pressures in y axis, a rowFmt value can be : "pressure [K] = {}"

◆ collectTableValues()

void geos::TableData2D::collectTableValues ( arraySlice1d< real64 const >  rowAxisValues,
arraySlice1d< real64 const >  columnAxisValues,
arrayView1d< real64 const >  values 
)

Collects all the values needed to build the table.

Parameters
rowAxisValuesVector containing all row axis values
columnAxisValuesVector containing all column axis values
valuesVector containing all table values

◆ convertTable2D()

TableData2D::TableDataHolder geos::TableData2D::convertTable2D ( arrayView1d< real64 const > const  values,
units::Unit const  valueUnit,
ArrayOfArraysView< real64 const > const  coordinates,
string_view  rowAxisDescription,
string_view  columnAxisDescription 
)
Parameters
valuesVector containing all table values
valueUnitThe table unit value
coordinatesArray containing row/column axis values
rowAxisDescriptionThe description for a row unit value
columnAxisDescriptionThe description for a column unit value
Returns
A struct containing the tableData converted and all header values ;

The documentation for this class was generated from the following file: