https://mooseframework.inl.gov
Loading...
Searching...
No Matches
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.
 
virtual ADReal value (const ADReal &x, const ADReal &f1, const ADReal &f2) const override
 Computes the transition value.
 
ADReal weight (const ADReal &x) const
 Computes the weight of the first function.
 
const ADReal & leftEnd () const
 Returns the coordinate of the left end of the transition.
 
const ADReal & rightEnd () const
 Returns the coordinate of the right end of the transition.
 

Protected Attributes

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

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}
Base class for smooth transitions between two functions of one variable.

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.

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

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

◆ 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.

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

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

◆ 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.

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
const std::vector< double > x
ADReal weight(const ADReal &x) const
Computes the weight of the first function.

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

◆ 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.

33{
34 using std::cos;
35 return 0.5 * (cos(libMesh::pi / (_x2 - _x1) * (x - _x1)) + 1.0);
36}
CTSub CT_OPERATOR_BINARY CTMul CTCompareLess CTCompareGreater CTCompareEqual _arg template cos(_arg) *_arg.template D< dtag >()) CT_SIMPLE_UNARY_FUNCTION(cos
const Real pi

Referenced by value().

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(), ADCubicTransition::value(), 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(), ADCubicTransition::value(), 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: