LCOV - code coverage report
Current view: top level - src/functions - CubicTransitionFunction.C (source / functions) Hit Total Coverage
Test: idaholab/moose thermal_hydraulics: #30301 (3b550b) with base 2ad78d Lines: 21 24 87.5 %
Date: 2025-07-30 13:02:48 Functions: 3 4 75.0 %
Legend: Lines: hit not hit

          Line data    Source code
       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             : #include "CubicTransitionFunction.h"
      11             : 
      12             : registerMooseObject("ThermalHydraulicsApp", CubicTransitionFunction);
      13             : 
      14             : InputParameters
      15          82 : CubicTransitionFunction::validParams()
      16             : {
      17          82 :   InputParameters params = SmoothTransitionFunction::validParams();
      18             : 
      19         164 :   params.addRequiredParam<Real>("function1_derivative_end_point", "First function");
      20         164 :   params.addRequiredParam<Real>("function2_derivative_end_point", "Second function");
      21             : 
      22          82 :   params.addClassDescription("Computes a cubic polynomial transition between two functions");
      23             : 
      24          82 :   return params;
      25           0 : }
      26             : 
      27          44 : CubicTransitionFunction::CubicTransitionFunction(const InputParameters & parameters)
      28             :   : SmoothTransitionFunction(parameters),
      29             : 
      30          44 :     _df1dx_end_point(getParam<Real>("function1_derivative_end_point")),
      31          88 :     _df2dx_end_point(getParam<Real>("function2_derivative_end_point")),
      32             : 
      33          88 :     _transition(_x_center, _transition_width)
      34             : {
      35             :   Point p1, p2;
      36             :   Real t1 = 0.0, t2 = 0.0;
      37          44 :   if (_use_time)
      38             :   {
      39          22 :     t1 = _transition.leftEnd();
      40          22 :     t2 = _transition.rightEnd();
      41             :   }
      42             :   else
      43             :   {
      44          22 :     p1(_component) = _transition.leftEnd();
      45          22 :     p2(_component) = _transition.rightEnd();
      46             :   }
      47             : 
      48          88 :   _transition.initialize(
      49          44 :       _function1.value(t1, p1), _function2.value(t2, p2), _df1dx_end_point, _df2dx_end_point);
      50          44 : }
      51             : 
      52             : Real
      53        1972 : CubicTransitionFunction::value(Real t, const Point & p) const
      54             : {
      55        1972 :   const Real x = _use_time ? t : p(_component);
      56             : 
      57        1972 :   return _transition.value(x, _function1.value(t, p), _function2.value(t, p));
      58             : }
      59             : 
      60             : RealVectorValue
      61           0 : CubicTransitionFunction::gradient(Real /*t*/, const Point & /*p*/) const
      62             : {
      63           0 :   mooseError(name(), ": ", __PRETTY_FUNCTION__, " is not implemented.");
      64             : }

Generated by: LCOV version 1.14