Loading [MathJax]/extensions/tex2jax.js
OGS
Main Page
Related Pages
Namespaces
Namespace List
Namespace Members
All
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
Functions
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
Variables
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
v
w
Typedefs
b
c
e
f
h
j
k
l
m
n
p
q
r
s
t
v
w
x
Enumerations
b
c
d
e
f
g
i
l
m
n
o
p
s
t
u
v
Enumerator
a
b
c
d
e
f
g
h
l
m
n
p
r
s
t
v
y
Classes
Class List
Class Index
Class Hierarchy
Files
File List
File Members
All
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
r
s
t
v
w
x
Functions
a
c
d
e
f
g
i
m
o
p
r
s
t
v
w
x
Variables
Typedefs
Enumerations
Macros
a
b
c
e
g
h
i
l
m
n
o
p
r
s
t
v
w
x
CreatePiecewiseLinearCurve-impl.h
Go to the documentation of this file.
1
13
#include "
CreatePiecewiseLinearCurve.h
"
14
15
#include "
BaseLib/Error.h
"
16
#include "
BaseLib/ConfigTree.h
"
17
18
namespace
MathLib
19
{
20
template
<
typename
CurveType>
21
std::unique_ptr<CurveType>
createPiecewiseLinearCurve
(
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
{
37
OGS_FATAL
(
38
"The given coordinates and values vector sizes are "
39
"different."
);
40
}
41
return
std::make_unique<CurveType>(std::move(x), std::move(y));
42
}
43
}
// namespace MathLib
ConfigTree.h
CreatePiecewiseLinearCurve.h
Error.h
OGS_FATAL
#define OGS_FATAL(...)
Definition:
Error.h:26
BaseLib::ConfigTree
Definition:
ConfigTree.h:103
BaseLib::ConfigTree::getConfigParameter
T getConfigParameter(std::string const ¶m) const
Definition:
ConfigTree-impl.h:39
MathLib
MathLib::createPiecewiseLinearCurve
std::unique_ptr< CurveType > createPiecewiseLinearCurve(BaseLib::ConfigTree const &config)
Definition:
CreatePiecewiseLinearCurve-impl.h:21
MathLib
Curve
CreatePiecewiseLinearCurve-impl.h
Generated by
1.9.1