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);
52 dict.checkITstream(is, name);
54 if (cols.size() != pTraits<Type>::nComponents)
57 <<
name <<
" with " << cols
58 <<
" does not have the expected length "
59 << pTraits<Type>::nComponents <<
nl
60 <<
exit(FatalIOError);
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]]);
116 headerLine_(
dict.get<
bool>(
"hasHeaderLine")),
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);
Various functions to operate on Lists.
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
void clear() noexcept
Clear the addressed list, i.e. set the size to zero.
void append(const T &val)
Copy append an element to the end of this list.
streamFormat format() const noexcept
Get the current stream format.
bool good() const noexcept
True if next operation might succeed.
Generic input stream using a standard (STL) stream.
ISstream & getLine(std::string &str, char delim='\n')
Raw, low-level getline (until delimiter) into a string.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Ostream & writeEntry(const keyType &key, const T &value)
Write a keyword/value entry.
A 2-tuple for storing two objects of dissimilar types. The container is similar in purpose to std::pa...
void size(const label n)
Older name for setAddressableSize.
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Reads an interpolation table from a file - CSV-format.
Database for solution data, solver performance and other reduced data.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
void transfer(dictionary &dict)
Transfer the contents of the argument and annul the argument.
T getOrDefault(const word &keyword, const T &deflt, enum keyType::option matchOpt=keyType::REGEX) const
friend Ostream & operator(Ostream &, const faMatrix< Type > &)
A class for handling file names.
virtual bool write()
Write the output fields.
Base class to read table data for the interpolationTable.
#define NotImplemented
Issue a FatalErrorIn for a function not currently implemented.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
OBJstream os(runTime.globalPath()/outputName)
const fileOperation & fileHandler()
Get current file handler.
dimensionedScalar pos(const dimensionedScalar &ds)
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
List< label > labelList
A List of labels.
label readLabel(const char *buf)
Parse entire buffer as a label, skipping leading/trailing whitespace.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
label findMax(const ListType &input, label start=0)
errorManipArg< error, int > exit(error &err, const int errNo=1)
constexpr char nl
The newline '\n' character (0x0a)