Go to the documentation of this file.
38 headerLine_(
dict.get<
bool>(
"hasHeaderLine")),
39 timeColumn_(
dict.get<
label>(
"timeColumn")),
40 componentColumns_(
dict.
lookup(
"valueColumns")),
41 separator_(
dict.lookupOrDefault<
string>(
"separator",
",")[0])
46 << componentColumns_ <<
" does not have the expected length "
68 if (componentColumns_[0] >= splitted.size())
71 <<
"No column " << componentColumns_[0] <<
" in "
76 return readScalar(splitted[componentColumns_[0]]);
81 Type csvTableReader<Type>::readValue(
const List<string>& splitted)
85 for (
label i = 0; i < pTraits<Type>::nComponents; ++i)
87 if (componentColumns_[i] >= splitted.size())
90 <<
"No column " << componentColumns_[i] <<
" in "
95 result[i] = readScalar(splitted[componentColumns_[i]]);
131 while (
pos != std::string::npos)
133 std::size_t nPos =
line.find(separator_,
pos);
135 if (nPos == std::string::npos)
147 if (splitted.size() <= 1)
152 scalar time = readScalar(splitted[timeColumn_]);
153 Type value = readValue(splitted);
186 os << componentColumns_;
191 os << componentColumns_;
195 os.
writeEntry(
"separator",
string(separator_));
ISstream & getLine(std::string &str, char delim='\n')
Raw, low-level getline into a string function.
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 standard (STL) streams.
const fileOperation & fileHandler()
Get current file handler.
Base class to read table data for the interpolationTable.
Ostream & endl(Ostream &os)
Add newline and flush stream.
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.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
virtual ~csvTableReader()
Destructor.
DynamicList< T, SizeMin > & append(const T &val)
Append an element to the end of this list.
Lookup type of boundary radiation properties.
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,...
virtual Ostream & writeKeyword(const keyType &kw)
Write the keyword followed by an appropriate indentation.
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.
Traits class for primitives.
Ostream & writeEntry(const keyType &key, const T &value)
Write a keyword/value entry.
virtual void write(Ostream &os) const
Write additional information.
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)