OGS
CreatePiecewiseLinearCurve.cpp
Go to the documentation of this file.
1
14
15#include "BaseLib/ConfigTree.h"
16#include "BaseLib/Error.h"
17
18namespace MathLib
19{
20
22 BaseLib::ConfigTree const& config)
23{
24 auto x =
26 config.getConfigParameter<std::vector<double>>("coords");
27 auto y =
29 config.getConfigParameter<std::vector<double>>("values");
30
31 if (x.empty() || y.empty())
32 {
33 OGS_FATAL("The given coordinates or values vector is empty.");
34 }
35 if (x.size() != y.size())
36 {
38 "The given coordinates and values vector sizes are "
39 "different.");
40 }
41
42 return {std::move(x), std::move(y)};
43}
44} // namespace MathLib
#define OGS_FATAL(...)
Definition Error.h:26
T getConfigParameter(std::string const &param) const
PiecewiseLinearCurveConfig parsePiecewiseLinearCurveConfig(BaseLib::ConfigTree const &config)