Go to the documentation of this file.
40 const dictionary&
dict
49 is.format(IOstream::ASCII);
53 if (cols.size() != pTraits<Type>::nComponents)
56 <<
name <<
" with " << cols
57 <<
" does not have the expected length "
58 << pTraits<Type>::nComponents <<
nl
71 label csvTableReader<label>::readValue
73 const List<string>& strings
76 return readLabel(strings[componentColumns_[0]]);
81 scalar csvTableReader<scalar>::readValue
83 const List<string>& strings
86 return readScalar(strings[componentColumns_[0]]);
95 const List<string>& strings
100 for (label i = 0; i < pTraits<Type>::nComponents; ++i)
102 result[i] = readScalar(strings[componentColumns_[i]]);
115 headerLine_(
dict.get<
bool>(
"hasHeaderLine")),
116 refColumn_(
dict.get<label>(
"timeColumn")),
117 componentColumns_(getComponentColumns(
"valueColumns",
dict)),
118 separator_(
dict.getOrDefault<
string>(
"separator",
",")[0])
134 const label maxEntry =
135 max(refColumn_, componentColumns_[
findMax(componentColumns_)]);
162 (
pos != std::string::npos) && (
n <= maxEntry);
166 const auto nPos =
line.find(separator_,
pos);
168 if (nPos == std::string::npos)
180 if (strings.size() <= 1)
185 if (strings.size() <= maxEntry)
188 <<
"Not enough columns near line " << lineNo
189 <<
". Require " << (maxEntry+1) <<
" but found "
194 scalar
x = readScalar(strings[refColumn_]);
195 Type value = readValue(strings);
226 os.
writeEntry(
"componentColumns", componentColumns_);
229 os.
writeEntry(
"separator",
string(separator_));
List< label > labelList
A List of labels.
ISstream & getLine(std::string &str, char delim='\n')
Raw, low-level getline (until delimiter) into a string.
A class for handling file names.
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
List< T > values(const HashTable< T, Key, Hash > &tbl, const bool doSort=false)
List of values from HashTable, optionally sorted.
streamFormat format() const noexcept
Get the current stream format.
Generic input stream using a standard (STL) stream.
const fileOperation & fileHandler()
Get current file handler.
Base class to read table data for the interpolationTable.
csvTableReader(const dictionary &dict)
Construct from dictionary.
A class for handling character strings derived from std::string.
void transfer(dictionary &dict)
Transfer the contents of the argument and annul the argument.
virtual void write(Ostream &os) const
Write the remaining parameters.
#define NotImplemented
Issue a FatalErrorIn for a function not currently implemented.
word name(const complex &c)
Return string representation of complex.
DynamicList< T, SizeMin > & append(const T &val)
Append an element to the end of this list.
void clear()
Clear the addressed list, i.e. set the size to zero.
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
streamFormat
Data format (ascii | binary)
Reads an interpolation table from a file - CSV-format.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
errorManipArg< error, int > exit(error &err, const int errNo=1)
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
label readLabel(const char *buf)
Parse entire buffer as a label, skipping leading/trailing whitespace.
label findMax(const ListType &input, label start=0)
Ostream & writeEntry(const keyType &key, const T &value)
Write a keyword/value entry.
virtual void write(Ostream &os) const
Write additional information.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
Various functions to operate on Lists.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
A 2-tuple for storing two objects of dissimilar types. The container is similar in purpose to std::pa...
bool good() const
Return true if next operation might succeed.
Database for solution data, solver performance and other reduced data.
dimensionedScalar pos(const dimensionedScalar &ds)