https://mooseframework.inl.gov
Loading...
Searching...
No Matches
PiecewiseBilinear.h
Go to the documentation of this file.
1//* This file is part of the MOOSE framework
2//* https://mooseframework.inl.gov
3//*
4//* All rights reserved, see COPYRIGHT for full restrictions
5//* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6//*
7//* Licensed under LGPL 2.1, please see LICENSE for details
8//* https://www.gnu.org/licenses/lgpl-2.1.html
9
10#pragma once
11
12#include "Function.h"
13
14template <typename>
18
49{
50public:
52
54
55 // Necessary for using forward declaration of BilinearInterpolation in std::unique_ptr
56 virtual ~PiecewiseBilinear();
57
58 using Function::value;
62 virtual Real value(Real t, const Point & pt) const override;
63 virtual ADReal value(const ADReal & t, const ADPoint & pt) const override;
64
73 static void parse(const std::string & data_file_name,
74 std::vector<Real> & x,
75 std::vector<Real> & y,
77 const std::string & object_name);
78
79 const int _xaxis;
80 const int _yaxis;
81
82private:
83 std::unique_ptr<BilinearInterpolation> _bilinear_interp;
84 const std::string _data_file_name;
85 const int _axis;
86 const bool _axisValid;
87 const bool _yaxisValid;
88 const bool _xaxisValid;
89 const Real _scale_factor;
90 const bool _radial;
91
92 template <typename T, typename P>
93 T valueInternal(T t, const P & p) const;
94};
DualNumber< Real, DNDerivativeType, true > ADReal
ColumnMajorMatrixTempl< Real > ColumnMajorMatrix
This class applies the Least Squares algorithm to a set of points to provide a smooth curve for sampl...
This class defines a Tensor that can change its shape.
Base class for function objects.
Definition Function.h:30
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,...
Definition Function.C:30
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system.
const InputParameters & parameters() const
Get the parameters of the object.
Definition MooseBase.h:131
PiecewiseBilinear reads from a file the information necessary to build the vectors x and y and the Co...
T valueInternal(T t, const P &p) const
static InputParameters validParams()
static void parse(const std::string &data_file_name, std::vector< Real > &x, std::vector< Real > &y, ColumnMajorMatrix &z, const std::string &object_name)
Parse a text/CSV file to fill two-dimensional data.
const std::string _data_file_name
virtual Real value(Real t, const Point &pt) const override
This function will return a value based on the first input argument only.
std::unique_ptr< BilinearInterpolation > _bilinear_interp