https://mooseframework.inl.gov
Loading...
Searching...
No Matches
CubicTransitionFunction.C
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
11
13
16{
18
19 params.addRequiredParam<Real>("function1_derivative_end_point", "First function");
20 params.addRequiredParam<Real>("function2_derivative_end_point", "Second function");
21
22 params.addClassDescription("Computes a cubic polynomial transition between two functions");
23
24 return params;
25}
26
28 : SmoothTransitionFunction(parameters),
29
30 _df1dx_end_point(getParam<Real>("function1_derivative_end_point")),
31 _df2dx_end_point(getParam<Real>("function2_derivative_end_point")),
32
33 _transition(_x_center, _transition_width)
34{
35 Point p1, p2;
36 Real t1 = 0.0, t2 = 0.0;
37 if (_use_time)
38 {
39 t1 = _transition.leftEnd();
40 t2 = _transition.rightEnd();
41 }
42 else
43 {
46 }
47
50}
51
52Real
53CubicTransitionFunction::value(Real t, const Point & p) const
54{
55 const Real x = _use_time ? t : p(_component);
56
58}
59
60RealVectorValue
61CubicTransitionFunction::gradient(Real /*t*/, const Point & /*p*/) const
62{
63 mooseError(name(), ": ", __PRETTY_FUNCTION__, " is not implemented.");
64}
registerMooseObject("ThermalHydraulicsApp", CubicTransitionFunction)
const std::vector< double > x
const Real p
Computes a cubic polynomial transition between two functions.
virtual RealVectorValue gradient(Real t, const Point &p) const
CubicTransition _transition
Transition object.
const Real & _df2dx_end_point
Derivative of second function at end point.
static InputParameters validParams()
CubicTransitionFunction(const InputParameters &parameters)
virtual Real value(Real t, const Point &p) const
const Real & _df1dx_end_point
Derivative of first function at end point.
virtual Real value(const Real &x, const Real &f1, const Real &f2) const override
Computes the transition value.
void initialize(const Real &f1_end_value, const Real &f2_end_value, const Real &df1dx_end_value, const Real &df2dx_end_value)
Initializes the polynomial coefficients.
virtual Real value(Real t, const Point &p) const
void addRequiredParam(const std::string &name, const std::string &doc_string)
void addClassDescription(const std::string &doc_string)
const std::string & name() const
void mooseError(Args &&... args) const
Base class for functions to smoothly transition from one function to another.
const Function & _function2
Second function.
static InputParameters validParams()
const Function & _function1
First function.
const bool _use_time
Use the time axis for transition?
const unsigned int _component
Component index of axis on which transition occurs.
const Real & rightEnd() const
Returns the coordinate of the right end of the transition.
const Real & leftEnd() const
Returns the coordinate of the left end of the transition.