www.mooseframework.org
PiecewiseBilinear.h
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://www.mooseframework.org
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 
14 template <typename>
18 
49 {
50 public:
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 private:
80  std::unique_ptr<BilinearInterpolation> _bilinear_interp;
81  const std::string _data_file_name;
82  const int _axis;
83  const int _yaxis;
84  const int _xaxis;
85  const bool _axisValid;
86  const bool _yaxisValid;
87  const bool _xaxisValid;
89  const bool _radial;
90 
91  template <typename T, typename P>
92  T valueInternal(T t, const P & p) const;
93 };
Base class for function objects.
Definition: Function.h:37
This class defines a Tensor that can change its shape.
This class applies the Least Squares algorithm to a set of points to provide a smooth curve for sampl...
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.
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
T valueInternal(T t, const P &p) const
virtual Real value(Real t, const Point &pt) const override
This function will return a value based on the first input argument only.
DualReal ADReal
Definition: ADRealForward.h:14
std::unique_ptr< BilinearInterpolation > _bilinear_interp
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
ColumnMajorMatrixTempl< Real > ColumnMajorMatrix
PiecewiseBilinear reads from a file the information necessary to build the vectors x and y and the Co...
const InputParameters & parameters() const
Get the parameters of the object.
const Real _scale_factor
virtual ~PiecewiseBilinear()
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:41
const std::string _data_file_name
PiecewiseBilinear(const InputParameters &parameters)