Go to the documentation of this file.
20 MooseEnum normal_component(
"x=0 y=1 z=2",
"z");
24 "The component of the geometry that is normal to the spline x1/x2 values");
25 params.
addRequiredParam<std::vector<Real>>(
"x1",
"The first independent coordinate.");
26 params.
addRequiredParam<std::vector<Real>>(
"x2",
"The second independent coordinate.");
29 "yx11",
"The values of the derivative wrt x1 on the lower interpolation grid points.");
31 "yx1n",
"The values of the derivative wrt x1 on the upper interpolation grid points.");
33 "yx21",
"The values of the derivative wrt x2 on the lower interpolation grid points.");
35 "yx2n",
"The values of the derivative wrt x2 on the upper interpolation grid points.");
37 "yx1",
"1e30",
"The functional form of the derivative with respect to x1.");
39 "yx2",
"1e30",
"The functional form of the derivative with respect to x2.");
47 _normal_component(getParam<
MooseEnum>(
"normal_component")),
48 _yx1(getFunction(
"yx1")),
49 _yx2(getFunction(
"yx2"))
51 _x1 = getParam<std::vector<Real>>(
"x1");
52 _x2 = getParam<std::vector<Real>>(
"x2");
53 std::vector<Real> yvec = getParam<std::vector<Real>>(
"y");
55 _yx11 = getParam<std::vector<Real>>(
"yx11");
57 _yx1n = getParam<std::vector<Real>>(
"yx1n");
59 _yx21 = getParam<std::vector<Real>>(
"yx21");
61 _yx2n = getParam<std::vector<Real>>(
"yx2n");
63 unsigned int m =
_x1.size(),
n =
_x2.size(), mn = yvec.size();
65 mooseError(
"The length of the supplied y must be equal to the lengths of x1 and x2 multiplied "
68 std::vector<std::vector<Real>> y(
m, std::vector<Real>(
n));
70 for (
unsigned int i = 0; i <
m; ++i)
71 for (
unsigned int j = 0; j <
n; ++j)
76 else if (
_yx11.size() !=
n)
77 mooseError(
"The length of the vectors holding the first derivatives of y with respect to x1 "
78 "must match the length of x2.");
82 else if (
_yx1n.size() !=
n)
83 mooseError(
"The length of the vectors holding the first derivatives of y with respect to x1 "
84 "must match the length of x2.");
88 else if (
_yx21.size() !=
m)
89 mooseError(
"The length of the vectors holding the first derivatives of y with respect to x2 "
90 "must match the length of x1.");
94 else if (
_yx2n.size() !=
m)
95 mooseError(
"The length of the vectors holding the first derivatives of y with respect to x2 "
96 "must match the length of x1.");
124 Real x1_begin =
_x1[0];
126 Real xn_begin =
_x1.back();
152 Real x1_begin =
_x1[0];
154 Real xn_begin =
_x1.back();
165 else if (deriv_var == 2)
169 Real x1_end =
_x2[0];
171 Real xn_end =
_x2.back();
190 RealGradient grad = RealGradient(0, 0, 0);
210 Real x1_begin =
_x1[0];
212 Real xn_begin =
_x1.back();
223 else if (deriv_var == 2)
227 Real x1_end =
_x2[0];
229 Real xn_end =
_x2.back();
virtual Real secondDerivative(const Point &p, unsigned int deriv_var) const
void mooseError(Args &&... args) const
virtual Real value(Real t, const Point &p) const
Override this to evaluate the scalar function at point (t,x,y,z), by default this returns zero,...
bool isParamValid(const std::string &name) const
Test if the supplied parameter is valid.
std::vector< Real > _yx1n
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type It sho...
BicubicSplineInterpolation _ipol
std::vector< Real > _yx21
Interface for objects that need to use functions.
defineLegacyParams(BicubicSplineFunction)
Real sample(Real x1, Real x2, Real yx11=_deriv_bound, Real yx1n=_deriv_bound)
Samples value at point (x1, x2)
void setData(const std::vector< Real > &x1, const std::vector< Real > &x2, const std::vector< std::vector< Real >> &y, const std::vector< Real > &yx11=std::vector< Real >(), const std::vector< Real > &yx1n=std::vector< Real >(), const std::vector< Real > &yx21=std::vector< Real >(), const std::vector< Real > &yx2n=std::vector< Real >())
Set the x1, x2 and y values, and first derivatives at the edges.
Real sampleDerivative(Real x1, Real x2, unsigned int deriv_var, Real yp1=_deriv_bound, Real ypn=_deriv_bound)
Samples first derivative at point (x1, x2)
virtual Real derivative(const Point &p, unsigned int deriv_var) const
unsigned int _normal_component
registerMooseObject("MooseApp", BicubicSplineFunction)
virtual RealGradient gradient(Real t, const Point &p) const override
Function objects can optionally provide a gradient at a point.
std::vector< Real > _yx11
virtual Real value(Real t, const Point &p) const override
Override this to evaluate the scalar function at point (t,x,y,z), by default this returns zero,...
Function that uses spline interpolation.
static InputParameters validParams()
Class constructor.
std::vector< Real > _yx2n
BicubicSplineFunction(const InputParameters ¶meters)
Base class for function objects.
static InputParameters validParams()
Real sample2ndDerivative(Real x1, Real x2, unsigned int deriv_var, Real yp1=_deriv_bound, Real ypn=_deriv_bound)
Samples second derivative at point (x1, x2)