www.mooseframework.org
PiecewiseBase.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 #include "LinearInterpolation.h"
14 
15 class PiecewiseBase;
16 
17 template <>
19 
26 class PiecewiseBase : public Function
27 {
28 public:
30 
31  virtual void initialSetup();
32  virtual Real functionSize();
33  virtual Real domain(const int i);
34  virtual Real range(const int i);
35 
40  void setData(const std::vector<Real> & x, const std::vector<Real> & y);
41 
42 protected:
43  std::unique_ptr<LinearInterpolation> _linear_interp;
44  int _axis;
45  const bool _has_axis;
46  bool _data_set;
47 };
48 
virtual void initialSetup()
Gets called at the beginning of the simulation before this object is asked to do its job...
Definition: PiecewiseBase.C:39
std::unique_ptr< LinearInterpolation > _linear_interp
Definition: PiecewiseBase.h:43
Function base which provides a piecewise approximation to a provided (x,y) point data set...
Definition: PiecewiseBase.h:26
Base class for function objects.
Definition: Function.h:40
InputParameters validParams< PiecewiseBase >()
Definition: PiecewiseBase.C:14
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
void setData(const std::vector< Real > &x, const std::vector< Real > &y)
Provides a means for explicitly setting the x and y data.
Definition: PiecewiseBase.C:46
virtual Real domain(const int i)
Definition: PiecewiseBase.C:70
static PetscErrorCode Vec x
virtual Real functionSize()
Definition: PiecewiseBase.C:64
const InputParameters & parameters() const
Get the parameters of the object.
Definition: MooseObject.h:65
virtual Real range(const int i)
Definition: PiecewiseBase.C:76
PiecewiseBase(const InputParameters &parameters)
Definition: PiecewiseBase.C:27
const bool _has_axis
Definition: PiecewiseBase.h:45