Go to the documentation of this file.
40 std::initializer_list<std::pair<const char*,int>> compat,
41 const dictionary&
dict
49 ITstream& is =
dict.lookupCompat(
name, compat);
50 is.format(IOstream::ASCII);
54 if (cols.size() != pTraits<Type>::nComponents)
57 <<
name <<
" with " << cols
58 <<
" does not have the expected length "
59 << pTraits<Type>::nComponents <<
nl
72 label csvTableReader<label>::readValue
74 const List<string>& strings
77 return readLabel(strings[componentColumns_[0]]);
82 scalar csvTableReader<scalar>::readValue
84 const List<string>& strings
87 return readScalar(strings[componentColumns_[0]]);
96 const List<string>& strings
101 for (label i = 0; i < pTraits<Type>::nComponents; ++i)
103 result[i] = readScalar(strings[componentColumns_[i]]);
117 refColumn_(
dict.getCompat<label>(
"refColumn", {{
"timeColumn", 1912}})),
120 getComponentColumns(
"componentColumns", {{
"valueColumns", 1912}},
dict)
138 const label maxEntry =
139 max(refColumn_, componentColumns_[
findMax(componentColumns_)]);
166 (
pos != std::string::npos) && (
n <= maxEntry);
170 const auto nPos =
line.find(separator_,
pos);
172 if (nPos == std::string::npos)
184 if (strings.size() <= 1)
189 if (strings.size() <= maxEntry)
192 <<
"Not enough columns near line " << lineNo
193 <<
". Require " << (maxEntry+1) <<
" but found "
198 scalar
x = readScalar(strings[refColumn_]);
199 Type value = readValue(strings);
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.
void clear() noexcept
Clear the addressed list, i.e. set the size to zero.
void transfer(dictionary &dict)
Transfer the contents of the argument and annul the argument.
bool good() const noexcept
True if next operation might succeed.
virtual void write(Ostream &os) const
Write the remaining parameters.
#define NotImplemented
Issue a FatalErrorIn for a function not currently implemented.
DynamicList< T, SizeMin > & append(const T &val)
Append an element to the end of this list.
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
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,...
OBJstream os(runTime.globalPath()/outputName)
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.
List< ReturnType > get(const UPtrList< T > &list, const AccessOp &aop)
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
#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...
T getOrDefault(const word &keyword, const T &deflt, enum keyType::option matchOpt=keyType::REGEX) const
Database for solution data, solver performance and other reduced data.
dimensionedScalar pos(const dimensionedScalar &ds)