https://mooseframework.inl.gov
PiecewiseFunction.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 #include "FunctionInterface.h"
14 
19 {
20 public:
22 
23  using Function::value;
24  virtual Real value(Real t, const Point & p) const override;
25  virtual RealVectorValue gradient(Real t, const Point & p) const override;
26  virtual Real timeDerivative(Real t, const Point & p) const override;
27 
28 protected:
37  unsigned int getFunctionIndex(Real t, const Point & p) const;
38 
40  const unsigned int _component;
42  const bool _use_time;
44  const std::vector<Real> & _axis_coordinates;
45 
47  const std::vector<FunctionName> & _function_names;
49  const unsigned int _n_functions;
51  std::vector<const Function *> _functions;
52 
53 public:
55 };
const std::vector< Real > & _axis_coordinates
N-1 coordinates in the chosen axis, in increasing order, delimiting the N function regions...
const unsigned int _n_functions
Number of functions, N.
const std::vector< FunctionName > & _function_names
Names of the functions in the N regions.
virtual Real timeDerivative(Real t, const Point &p) const override
virtual Real value(Real t, const Point &p) const override
const bool _use_time
Use the time axis?
virtual RealVectorValue gradient(Real t, const Point &p) const override
static InputParameters validParams()
PiecewiseFunction(const InputParameters &parameters)
Function which provides a piecewise representation of arbitrary functions.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
unsigned int getFunctionIndex(Real t, const Point &p) const
Gets the index of the function at the specified time and spatial point.
const InputParameters & parameters() const
std::vector< const Function * > _functions
Functions in the N regions.
virtual Real value(Real t, const Point &p) const
const unsigned int _component
Axis on which the N-1 delimiting points lie.