https://mooseframework.inl.gov
Public Member Functions | Protected Attributes | List of all members
ADWeightedTransition Class Reference

Weighted transition between two functions of one variable. More...

#include <ADWeightedTransition.h>

Inheritance diagram for ADWeightedTransition:
[legend]

Public Member Functions

 ADWeightedTransition (const ADReal &x_center, const ADReal &transition_width)
 Constructor. More...
 
virtual ADReal value (const ADReal &x, const ADReal &f1, const ADReal &f2) const override
 Computes the transition value. More...
 
ADReal weight (const ADReal &x) const
 Computes the weight of the first function. More...
 
const ADRealleftEnd () const
 Returns the coordinate of the left end of the transition. More...
 
const ADRealrightEnd () const
 Returns the coordinate of the right end of the transition. More...
 

Protected Attributes

const ADReal _x_center
 Center point of transition. More...
 
const ADReal _transition_width
 Width of transition. More...
 
const ADReal _x1
 Left end point of transition. More...
 
const ADReal _x2
 Right end point of transition. More...
 

Detailed Description

Weighted transition between two functions of one variable.

Definition at line 17 of file ADWeightedTransition.h.

Constructor & Destructor Documentation

◆ ADWeightedTransition()

ADWeightedTransition::ADWeightedTransition ( const ADReal x_center,
const ADReal transition_width 
)

Constructor.

Parameters
[in]x_centerCenter point of transition
[in]transition_widthWidth of transition

Definition at line 12 of file ADWeightedTransition.C.

13  : ADSmoothTransition(x_center, transition_width)
14 {
15 }
ADSmoothTransition(const ADReal &x_center, const ADReal &transition_width)
Constructor.

Member Function Documentation

◆ leftEnd()

const ADReal& ADSmoothTransition::leftEnd ( ) const
inlineinherited

Returns the coordinate of the left end of the transition.

Definition at line 40 of file ADSmoothTransition.h.

Referenced by ADSmoothTransitionTestMaterial::ADSmoothTransitionTestMaterial(), and ADShaftConnectedPump1PhaseUserObject::computeFluxesAndResiduals().

40 { return _x1; }
const ADReal _x1
Left end point of transition.

◆ rightEnd()

const ADReal& ADSmoothTransition::rightEnd ( ) const
inlineinherited

Returns the coordinate of the right end of the transition.

Definition at line 45 of file ADSmoothTransition.h.

Referenced by ADSmoothTransitionTestMaterial::ADSmoothTransitionTestMaterial(), and ADShaftConnectedPump1PhaseUserObject::computeFluxesAndResiduals().

45 { return _x2; }
const ADReal _x2
Right end point of transition.

◆ value()

ADReal ADWeightedTransition::value ( const ADReal x,
const ADReal f1,
const ADReal f2 
) const
overridevirtual

Computes the transition value.

Parameters
[in]xPoint at which to evaluate function
[in]f1Left function
[in]f2Right function

Implements ADSmoothTransition.

Definition at line 18 of file ADWeightedTransition.C.

Referenced by ADShaftConnectedPump1PhaseUserObject::computeFluxesAndResiduals(), and ADSmoothTransitionTestMaterial::computeQpProperties().

19 {
20  if (x <= _x1)
21  return f1;
22  else if (x >= _x2)
23  return f2;
24  else
25  {
26  const ADReal w = weight(x);
27  return w * f1 + (1.0 - w) * f2;
28  }
29 }
DualNumber< Real, DNDerivativeType, true > ADReal
ADReal weight(const ADReal &x) const
Computes the weight of the first function.
const std::vector< double > x
const ADReal _x2
Right end point of transition.
const ADReal _x1
Left end point of transition.

◆ weight()

ADReal ADWeightedTransition::weight ( const ADReal x) const

Computes the weight of the first function.

Parameters
[in]xPoint at which to evaluate weight

Definition at line 32 of file ADWeightedTransition.C.

Referenced by value().

33 {
34  return 0.5 * (std::cos(libMesh::pi / (_x2 - _x1) * (x - _x1)) + 1.0);
35 }
const std::vector< double > x
const ADReal _x2
Right end point of transition.
const ADReal _x1
Left end point of transition.
const Real pi

Member Data Documentation

◆ _transition_width

const ADReal ADSmoothTransition::_transition_width
protectedinherited

Width of transition.

Definition at line 51 of file ADSmoothTransition.h.

◆ _x1

const ADReal ADSmoothTransition::_x1
protectedinherited

Left end point of transition.

Definition at line 54 of file ADSmoothTransition.h.

Referenced by ADCubicTransition::initialize(), ADSmoothTransition::leftEnd(), value(), ADCubicTransition::value(), and weight().

◆ _x2

const ADReal ADSmoothTransition::_x2
protectedinherited

Right end point of transition.

Definition at line 56 of file ADSmoothTransition.h.

Referenced by ADCubicTransition::initialize(), ADSmoothTransition::rightEnd(), value(), ADCubicTransition::value(), and weight().

◆ _x_center

const ADReal ADSmoothTransition::_x_center
protectedinherited

Center point of transition.

Definition at line 49 of file ADSmoothTransition.h.


The documentation for this class was generated from the following files: